walter6 Posted August 10, 2012 Share Posted August 10, 2012 Hello, I just started using the Google Analytics module on Prestashop v1.4.8 but it doesn't really work well as it's only tracking links in this format: /products /index /category /contactform ... instead of something like /5-myproduct.html Because of this, so many important features don't work properly (like in-Page analytics etc.) Is there a way to fix this? If not...where could I add the GA code manually? Any help will be highly appreciated... 1 Link to comment Share on other sites More sharing options...
davewalschot Posted August 28, 2012 Share Posted August 28, 2012 Hello, I just started using the Google Analytics module on Prestashop v1.4.8 but it doesn't really work well as it's only tracking links in this format: /products /index /category /contactform ... instead of something like /5-myproduct.html Because of this, so many important features don't work properly (like in-Page analytics etc.) Is there a way to fix this? If not...where could I add the GA code manually? Any help will be highly appreciated... Same problem over here! also trying to find a solution! Let me know if you have found one, i'll do the same! Link to comment Share on other sites More sharing options...
walter6 Posted August 28, 2012 Author Share Posted August 28, 2012 @davewalschot Yes, I found a solution. Just insert your Google Analytics script at the end of the header.tpl file beween a {literal} ...your GA code... {/literal} tag. Don't forget to disable the GA module. Works perfectly for me... Link to comment Share on other sites More sharing options...
davewalschot Posted August 29, 2012 Share Posted August 29, 2012 Thanks!! Dave www.pipeline-elektronische-sigaret.nl Link to comment Share on other sites More sharing options...
El Patron Posted August 29, 2012 Share Posted August 29, 2012 If you ensure that your google analyitcs module is hooked to your 'header of pages' technical name 'header' then you should have analytics for every page. Assuming you have a PS compliant theme. Link to comment Share on other sites More sharing options...
Rhobur Posted August 29, 2012 Share Posted August 29, 2012 Mine is hooked in header but still works as walter6 reports; it seems that the direct code inclusion in header.tpl is better. Link to comment Share on other sites More sharing options...
El Patron Posted August 29, 2012 Share Posted August 29, 2012 Mine is hooked in header but still works as walter6 reports; it seems that the direct code inclusion in header.tpl is better. I do agree that including in header works, until you load a new theme then it doesn't work. But IMHO having a compliant theme is better than people having to change files and then know they have to turn off smarty compile. Link to comment Share on other sites More sharing options...
davewalschot Posted August 29, 2012 Share Posted August 29, 2012 Guys, Thanks for joining the discussion! though the issue that i have (and walter6 had) is not that pages are not included in GA but that the the pages that are included (AFAIK all of mine get reported) do not show the right level of detail. To give you one example. All my product show up with the same page name being "/product" (see screenshot) instead of url path to identify the unique product page. Altough that in GA one can also select the field "title" which useally is unique per page, a lot of analysis are based on the "page name" field. Therefore this is not really an option if you want to know the details. I also have another site based on joomla, the GA there does report the full path of the page name. This makes the prestashop ganalytics module implementation suspect I havent tried the option that walter6 posted Just insert your Google Analytics script at the end of the header.tpl file beween a {literal} ...your GA code... {/literal} but looking at the ganalytics code i expect to lose information like the conversion stuff Link to comment Share on other sites More sharing options...
El Patron Posted August 29, 2012 Share Posted August 29, 2012 First, I probably came off a bit strong...my background is don't modify the vanilla code....I had one customer who inserted his analytics into the header.tpl this and could not understand why our multishop module was not giving analyitcs the correct ua-id..for his other domains. But the crux of it that this does not fix the underlying issue, i.e. the module works for the vast majority % of the community...so where is the problem? My assumption is that it is not the module inserting the google analytics code but rather something else. Here is my google analtyics running on 1.4.6.2 and analyitcs module version v1.3. As you can see my pages are reported with all detail. http://screencast.com/t/fUI9WbVBe Link to comment Share on other sites More sharing options...
davewalschot Posted August 29, 2012 Share Posted August 29, 2012 Hi elpatron, havent noticed you "comming off strong" Below a screenshot from 1.4.6.? or 1.4.7, after upgrade though is gone. looking at the header.tpl the module i think that that is where the events get pushed _gaq.push(['_setAccount', '{$ganalytics_id}']); // Recommanded value by Google doc and has to before the trackPageView _gaq.push(['_setSiteSpeedSampleRate', 5]); I am tempted to change the code (just for the fake of the experiment) as i dont see a parameter passed here that indicates the page. Having a 2 minute view at the google doc (and not being an expert in anything) i find this GA code to send the page _gaq.push(['_trackPageview', '/home/landingPage']); copied from https://developers.google.com/analytics/devguides/collection/gajs/methods/gaJSApiBasicConfiguration#_gat.GA_Tracker_._trackPageview any comments? or anyone knowing the php variable to get the path out of his head? Link to comment Share on other sites More sharing options...
davewalschot Posted August 29, 2012 Share Posted August 29, 2012 I coudn't let it go, checked the code a bit further. a few line below the ganalytic code states {if isset($pageTrack)}_gaq.push(['_trackPageview', '{$pageTrack}']);{/if} Which is actually the code to send the page, BUT the $pageTrack variable is filled with what is seen in Google Analytics. in another variable ($request_uri) the URL (eg /en/accessories-ipod/8-belkin-leather) is stored. Unless this field is somehow changed by some other module (which is very unlikely i think) the prestashop guys decided to change this (i think) somewhere in the past. Guess we need to ask them why, perhaps I am making wrong assumptions here whats the best way of doing that? filing a bug report? btw i checked this against the latest 1.4.9 Link to comment Share on other sites More sharing options...
El Patron Posted August 30, 2012 Share Posted August 30, 2012 Here is an interesting thread. http://www.prestashop.com/forums/topic/172576-google-analytics-tracking/ 1 Link to comment Share on other sites More sharing options...
davewalschot Posted August 30, 2012 Share Posted August 30, 2012 Checked it and am now testing it with a small addition First results look very positive (the GA real-time-view) Thanks! 1 Link to comment Share on other sites More sharing options...
davewalschot Posted September 10, 2012 Share Posted September 10, 2012 (edited) Update; This change certainly something everyone into analytics should have, After changing (see http://www.prestashop.com/forums/topic/172576-google-analytics-tracking/) we are able to do a much more detailed analysis. The part that is still working 100% is the orders part, hope to have a further look at that soon. I recommend everyone with the default GA prestashop module to use this. I will update this thread once i have made the final changes. Edited September 10, 2012 by davewalschot (see edit history) 1 Link to comment Share on other sites More sharing options...
Recommended Posts