Gipielle Posted January 19, 2014 Share Posted January 19, 2014 We have a problem with Google Analytics Module Version 1.6 We have update the version 1.4.3 of the ganalytics module using prestashop (1.5.4.1) backoffice to the new version 1.6 Analytics now doesn't work, we have tried to reinstall, disable, reset the module but nothing changes. It seems that the analytics code is present in our pages ( www.betafer.it )but it is not correct. How can we solve ? We need to create a new ticket in prestashop forge ? Best Regards. Link to comment Share on other sites More sharing options...
w3bsolutions Posted January 19, 2014 Share Posted January 19, 2014 Same problem here. Link to comment Share on other sites More sharing options...
Alexmp4 Posted January 20, 2014 Share Posted January 20, 2014 Same problem for me... Any new solution ? Link to comment Share on other sites More sharing options...
NemoPS Posted January 20, 2014 Share Posted January 20, 2014 Same here, working on finding a solution Link to comment Share on other sites More sharing options...
Olcho Posted January 20, 2014 Share Posted January 20, 2014 Same problem Link to comment Share on other sites More sharing options...
Gipielle Posted January 20, 2014 Author Share Posted January 20, 2014 Five We have placed analytics code in the footer but we hope to use the module .... Link to comment Share on other sites More sharing options...
NemoPS Posted January 20, 2014 Share Posted January 20, 2014 It seems that enabling universal analytics works for me. Weird Link to comment Share on other sites More sharing options...
Gipielle Posted January 20, 2014 Author Share Posted January 20, 2014 For us no... Link to comment Share on other sites More sharing options...
w3bsolutions Posted January 20, 2014 Share Posted January 20, 2014 that is not working for me either... Link to comment Share on other sites More sharing options...
Olcho Posted January 21, 2014 Share Posted January 21, 2014 Also for me it doesn't work Link to comment Share on other sites More sharing options...
keskifo Posted January 21, 2014 Share Posted January 21, 2014 Tried to re-initialize the plug-in, nothing. Still not working! Link to comment Share on other sites More sharing options...
Totti Posted January 21, 2014 Share Posted January 21, 2014 http://forge.prestashop.com/browse/PNM-2015?jql=text%20~%20analytics%20ORDER%20BY%20created%20DESC 3 Link to comment Share on other sites More sharing options...
w3bsolutions Posted January 21, 2014 Share Posted January 21, 2014 http://forge.prestashop.com/browse/PNM-2015?jql=text%20~%20analytics%20ORDER%20BY%20created%20DESC Thanks! That worked for me. 1 Link to comment Share on other sites More sharing options...
i-covers.dk Posted April 7, 2014 Share Posted April 7, 2014 Did anybody figure this out - I have the same problem and I have no idea how to set up my shop with analytics... Link to comment Share on other sites More sharing options...
vekia Posted April 8, 2014 Share Posted April 8, 2014 you also updated from 1.6 on prestashop 1.5.4.1 ? Link to comment Share on other sites More sharing options...
eugenioviudez Posted April 22, 2014 Share Posted April 22, 2014 I have same issue with ganalytics. I updated from 1.5 to 1.6 and I tried install/reinstall with no exit. I see the Analytics script but doesnt works: URL: http://coteseduction.com/ The error message that shows the Chrome plugin Tag Assistant is "Error: Invalid or missing web property ID" I have no clue how to solve it. Link to comment Share on other sites More sharing options...
eugenioviudez Posted April 22, 2014 Share Posted April 22, 2014 Well, I've modified the file header.tpl of ganalytics module and copy/paste the Google Analytics code and now works.... It's really weird but works... Link to comment Share on other sites More sharing options...
myquickjuice Posted May 28, 2014 Share Posted May 28, 2014 I'm having the same problem with google analytics not working.. I've tried all the solutions as listed above and none seemed to have solved the issue. my version of prestashop is 1.6 Link to comment Share on other sites More sharing options...
nzecheru Posted July 10, 2014 Share Posted July 10, 2014 Where exactly do you add the single line to update the Analytics tracking code to support Display Advertising? The header.tpl file I am using is from here: https://github.com/PrestaShop/PrestaShop-modules/blob/master/ganalytics/views/templates/hook/header.tpl I changed for both UA and Classis, but still no result: "Tracking code changes needed (as of Jul 10, 2014, 4:33:53 PM). Your Analytics tracking code does not include the necessary support for the Demographics and Interest reports. Learn more about the simple, one-line, one-time change to your tracking code to add this support. Below is my header.tpl file. <script type="text/javascript"> {if $universal_analytics eq true} {literal} (function (i, s, o, g, r, a, m) { i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () { (i[r].q = i[r].q || []).push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o), m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); {/literal} ga('create', '{$ganalytics_id|escape:'htmlall':'UTF-8'}'{if isset($pageTrack)}, '{$pageTrack|escape:'htmlall':'UTF-8'}'{/if}); {if $isOrder eq true} ga('require', 'ecommerce', 'ecommerce.js'); ga('require', 'displayfeatures'); {else} ga('send', 'pageview'); {/if} {if $isOrder eq true} ga('ecommerce:addTransaction', { 'id': '{$trans.id|escape:'htmlall':'UTF-8'}', 'affiliation': '{$trans.store|escape:'htmlall':'UTF-8'}', 'revenue': '{$trans.total|escape:'htmlall':'UTF-8'}', 'tax': '{$trans.tax|escape:'htmlall':'UTF-8'}', 'shipping': '{$trans.shipping|escape:'htmlall':'UTF-8'}', 'city': '{$trans.city|escape:'htmlall':'UTF-8'}', 'state': '{$trans.state|escape:'htmlall':'UTF-8'}', 'country': '{$trans.country|escape:'htmlall':'UTF-8'}', 'currency': '{$trans.currency|escape:'htmlall':'UTF-8'}' }); {foreach from=$items item=item} ga('ecommerce:addItem', { 'id': '{$item.OrderId|escape:'htmlall':'UTF-8'}', 'sku': '{$item.SKU|escape:'htmlall':'UTF-8'}', 'name': '{$item.Product|escape:'htmlall':'UTF-8'}', 'category': '{$item.Category|escape:'htmlall':'UTF-8'}', 'price': '{$item.Price|escape:'htmlall':'UTF-8'}', 'quantity': '{$item.Quantity|escape:'htmlall':'UTF-8'}' }); {/foreach} {literal} (function() { {/literal}{if $isOrder eq true}{literal} var key = 'ga_trans'; var idtrans = {/literal}{$trans.id|intval}{literal}; if (!!$.prototype.totalStorage) var view_ga_trans = parseInt($.totalStorage(key)); else if (typeof localStorage !== 'undefined' && localStorage) var view_ga_trans = parseInt(localStorage.getItem(key)); if (typeof view_ga_trans !== 'undefined' && view_ga_trans > 0 && idtrans == view_ga_trans ) return false; if (!!$.prototype.totalStorage) $.totalStorage(parseInt(key, idtrans)); else if (typeof localStorage !== 'undefined' && localStorage) localStorage.setItem(key, parseInt(idtrans)); {/literal}{/if}{literal} ga('ecommerce:send'); })(); {/literal} {/if} {else} var _gaq = _gaq || []; _gaq.push(['_setAccount', '{$ganalytics_id|escape:'htmlall':'UTF-8'}']); // Recommended value by Google doc and has to before the trackPageView _gaq.push(['_setSiteSpeedSampleRate', 5]); _gaq.push(['_trackPageview'{if isset($pageTrack)}, '{$pageTrack|escape:'htmlall':'UTF-8'}'{/if}]); {if $isOrder eq true} {* If it's an order we need more data for stats *} _gaq.push(['_addTrans', '{$trans.id|escape:'htmlall':'UTF-8'}', {* order ID - required *} '{$trans.store|escape:'htmlall':'UTF-8'}', {* affiliation or store name *} '{$trans.total|escape:'htmlall':'UTF-8'}', {* total - required *} '{$trans.tax|escape:'htmlall':'UTF-8'}', {* tax *} '{$trans.shipping|escape:'htmlall':'UTF-8'}', {* shipping *} '{$trans.city|escape:'htmlall':'UTF-8'}', {* city *} '{$trans.state|escape:'htmlall':'UTF-8'}', {* state or province *} '{$trans.country|escape:'htmlall':'UTF-8'}' {* country *} ]); {foreach from=$items item=item} _gaq.push(['_addItem', '{$item.OrderId|escape:'htmlall':'UTF-8'}', {* order ID - required *} '{$item.SKU|escape:'htmlall':'UTF-8'}', {* SKU/code - required *} '{$item.Product|escape:'htmlall':'UTF-8'}', {* product name *} '{$item.Category|escape:'htmlall':'UTF-8'}', {* category or variation *} '{$item.Price|escape:'htmlall':'UTF-8'}', {* unit price - required *} '{$item.Quantity|escape:'htmlall':'UTF-8'}' {* quantity - required *} ]); {/foreach} {* submits transaction to the Analytics servers *} {literal} _gaq.push(['_trackTrans']); {/literal} {/if} {literal} (function() { {/literal}{if $isOrder eq true}{literal} var key = 'ga_trans'; var idtrans = {/literal}{$trans.id|intval}{literal}; if (!!$.prototype.totalStorage) var view_ga_trans = parseInt($.totalStorage(key)); else if (typeof localStorage !== 'undefined' && localStorage) var view_ga_trans = parseInt(localStorage.getItem(key)); if (typeof view_ga_trans !== 'undefined' && view_ga_trans > 0 && idtrans == view_ga_trans ) return false; if (!!$.prototype.totalStorage) $.totalStorage(parseInt(key, idtrans)); else if (typeof localStorage !== 'undefined' && localStorage) localStorage.setItem(key, parseInt(idtrans)); {/literal}{/if}{literal} var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; {*ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';*} ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); {/literal} {/if} </script> Link to comment Share on other sites More sharing options...
skechav Posted August 2, 2014 Share Posted August 2, 2014 (edited) Dear nzecheru, The problem with google code validation for Demographics is a well known problem and has been discussed enough on googles product forums. If you read some topics there, you will realize that since the correct code appears when you preview the source code output of your website with your browser, you can just press "Skip validation" button and it will work. You wiil get a "success" message form google on the next step. As with your code just move the ga('require', 'displayfeatures'); after the {else} and before the ga('send', 'pageview'); Everything else seems fine to me. If you are using P.S 1.6.8 like me it will work. Here is the code I use : {* * 2007-2014 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2014 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} <script type="text/javascript"> {if $universal_analytics eq true} {literal} (function (i, s, o, g, r, a, m) { i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () { (i[r].q = i[r].q || []).push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o), m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); {/literal} ga('create', '{$ganalytics_id|escape:'htmlall':'UTF-8'}'{if isset($pageTrack)}, '{$pageTrack|escape:'htmlall':'UTF-8'}'{/if}, 'auto'); {if $isOrder eq true} ga('require', 'ecommerce', 'ecommerce.js'); {else} ga('require', 'displayfeatures'); ga('send', 'pageview'); {/if} {if $isOrder eq true} ga('ecommerce:addTransaction', { 'id': '{$trans.id|escape:'htmlall':'UTF-8'}', 'affiliation': '{$trans.store|escape:'htmlall':'UTF-8'}', 'revenue': '{$trans.total|escape:'htmlall':'UTF-8'}', 'tax': '{$trans.tax|escape:'htmlall':'UTF-8'}', 'shipping': '{$trans.shipping|escape:'htmlall':'UTF-8'}', 'city': '{$trans.city|escape:'htmlall':'UTF-8'}', 'state': '{$trans.state|escape:'htmlall':'UTF-8'}', 'country': '{$trans.country|escape:'htmlall':'UTF-8'}', 'currency': '{$trans.currency|escape:'htmlall':'UTF-8'}' }); {foreach from=$items item=item} ga('ecommerce:addItem', { 'id': '{$item.OrderId|escape:'htmlall':'UTF-8'}', 'sku': '{$item.SKU|escape:'htmlall':'UTF-8'}', 'name': '{$item.Product|escape:'htmlall':'UTF-8'}', 'category': '{$item.Category|escape:'htmlall':'UTF-8'}', 'price': '{$item.Price|escape:'htmlall':'UTF-8'}', 'quantity': '{$item.Quantity|escape:'htmlall':'UTF-8'}' }); {/foreach} {literal} (function() { {/literal}{if $isOrder eq true}{literal} var key = 'ga_trans'; var idtrans = {/literal}{$trans.id|intval}{literal}; if (!!$.prototype.totalStorage) var view_ga_trans = parseInt($.totalStorage(key)); else if (typeof localStorage !== 'undefined' && localStorage) var view_ga_trans = parseInt(localStorage.getItem(key)); if (typeof view_ga_trans !== 'undefined' && view_ga_trans > 0 && idtrans == view_ga_trans ) return false; if (!!$.prototype.totalStorage) $.totalStorage(parseInt(key, idtrans)); else if (typeof localStorage !== 'undefined' && localStorage) localStorage.setItem(key, parseInt(idtrans)); {/literal}{/if}{literal} ga('ecommerce:send'); })(); {/literal} {/if} {else} var _gaq = _gaq || []; _gaq.push(['_setAccount', '{$ganalytics_id|escape:'htmlall':'UTF-8'}']); // Recommended value by Google doc and has to before the trackPageView _gaq.push(['_setSiteSpeedSampleRate', 5]); _gaq.push(['_trackPageview'{if isset($pageTrack)}, '{$pageTrack|escape:'htmlall':'UTF-8'}'{/if}]); {if $isOrder eq true} {* If it's an order we need more data for stats *} _gaq.push(['_addTrans', '{$trans.id|escape:'htmlall':'UTF-8'}', {* order ID - required *} '{$trans.store|escape:'htmlall':'UTF-8'}', {* affiliation or store name *} '{$trans.total|escape:'htmlall':'UTF-8'}', {* total - required *} '{$trans.tax|escape:'htmlall':'UTF-8'}', {* tax *} '{$trans.shipping|escape:'htmlall':'UTF-8'}', {* shipping *} '{$trans.city|escape:'htmlall':'UTF-8'}', {* city *} '{$trans.state|escape:'htmlall':'UTF-8'}', {* state or province *} '{$trans.country|escape:'htmlall':'UTF-8'}' {* country *} ]); {foreach from=$items item=item} _gaq.push(['_addItem', '{$item.OrderId|escape:'htmlall':'UTF-8'}', {* order ID - required *} '{$item.SKU|escape:'htmlall':'UTF-8'}', {* SKU/code - required *} '{$item.Product|escape:'htmlall':'UTF-8'}', {* product name *} '{$item.Category|escape:'htmlall':'UTF-8'}', {* category or variation *} '{$item.Price|escape:'htmlall':'UTF-8'}', {* unit price - required *} '{$item.Quantity|escape:'htmlall':'UTF-8'}' {* quantity - required *} ]); {/foreach} {* submits transaction to the Analytics servers *} {literal} _gaq.push(['_trackTrans']); {/literal} {/if} {literal} (function() { {/literal}{if $isOrder eq true}{literal} var key = 'ga_trans'; var idtrans = {/literal}{$trans.id|intval}{literal}; if (!!$.prototype.totalStorage) var view_ga_trans = parseInt($.totalStorage(key)); else if (typeof localStorage !== 'undefined' && localStorage) var view_ga_trans = parseInt(localStorage.getItem(key)); if (typeof view_ga_trans !== 'undefined' && view_ga_trans > 0 && idtrans == view_ga_trans ) return false; if (!!$.prototype.totalStorage) $.totalStorage(parseInt(key, idtrans)); else if (typeof localStorage !== 'undefined' && localStorage) localStorage.setItem(key, parseInt(idtrans)); {/literal}{/if}{literal} var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); {/literal} {/if} </script> Good luck, and feel free to come back if it won't work for you. (Details about validation problem here :https://productforums.google.com/forum/#!searchin/analytics/not$20validating|sort:relevance/analytics/_C2M4pZ9sEI/6r68GHifH5EJ) Edited August 2, 2014 by skechav (see edit history) 1 Link to comment Share on other sites More sharing options...
nzecheru Posted August 4, 2014 Share Posted August 4, 2014 Thank you skechav! Link to comment Share on other sites More sharing options...
dariovine Posted August 29, 2014 Share Posted August 29, 2014 If you read in the official google documentation here https://support.google.com/analytics/answer/2819948?hl=en right at the bottom it says: Click Validate tracking code. Analytics then checks to see whether you made the correct change to your code. If the validation fails, then you see this same page again. Analytics may be unable to validate your code changes under the following circumstances: You are using Google Tag Manager or a third-party tag manager to include the Analytics tracking code on your pages. You have included comments in your tracking code. You are hosting dc.js on your own servers, or including it from an external script. If you are certain that you’ve made the correct change, you can click Skip validation. With the reports enabled and the tracking-code modification in place, you should see data in your reports within 24 hours. I hope it helps to clarify 1 Link to comment Share on other sites More sharing options...
jhd Posted September 6, 2014 Share Posted September 6, 2014 Dear nzecheru, The problem with google code validation for Demographics is a well known problem and has been discussed enough on googles product forums. If you read some topics there, you will realize that since the correct code appears when you preview the source code output of your website with your browser, you can just press "Skip validation" button and it will work. You wiil get a "success" message form google on the next step. As with your code just move the ga('require', 'displayfeatures'); after the {else} and before the ga('send', 'pageview'); Everything else seems fine to me. If you are using P.S 1.6.8 like me it will work. Here is the code I use : {* * 2007-2014 PrestaShop * * NOTICE OF LICENSE * * This source file is subject to the Academic Free License (AFL 3.0) * that is bundled with this package in the file LICENSE.txt. * It is also available through the world-wide-web at this URL: * http://opensource.org/licenses/afl-3.0.php * If you did not receive a copy of the license and are unable to * obtain it through the world-wide-web, please send an email * to [email protected] so we can send you a copy immediately. * * DISCLAIMER * * Do not edit or add to this file if you wish to upgrade PrestaShop to newer * versions in the future. If you wish to customize PrestaShop for your * needs please refer to http://www.prestashop.com for more information. * * @author PrestaShop SA <[email protected]> * @copyright 2007-2014 PrestaShop SA * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of PrestaShop SA *} <script type="text/javascript"> {if $universal_analytics eq true} {literal} (function (i, s, o, g, r, a, m) { i['GoogleAnalyticsObject'] = r; i[r] = i[r] || function () { (i[r].q = i[r].q || []).push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o), m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; m.parentNode.insertBefore(a, m) })(window, document, 'script', '//www.google-analytics.com/analytics.js', 'ga'); {/literal} ga('create', '{$ganalytics_id|escape:'htmlall':'UTF-8'}'{if isset($pageTrack)}, '{$pageTrack|escape:'htmlall':'UTF-8'}'{/if}, 'auto'); {if $isOrder eq true} ga('require', 'ecommerce', 'ecommerce.js'); {else} ga('require', 'displayfeatures'); ga('send', 'pageview'); {/if} {if $isOrder eq true} ga('ecommerce:addTransaction', { 'id': '{$trans.id|escape:'htmlall':'UTF-8'}', 'affiliation': '{$trans.store|escape:'htmlall':'UTF-8'}', 'revenue': '{$trans.total|escape:'htmlall':'UTF-8'}', 'tax': '{$trans.tax|escape:'htmlall':'UTF-8'}', 'shipping': '{$trans.shipping|escape:'htmlall':'UTF-8'}', 'city': '{$trans.city|escape:'htmlall':'UTF-8'}', 'state': '{$trans.state|escape:'htmlall':'UTF-8'}', 'country': '{$trans.country|escape:'htmlall':'UTF-8'}', 'currency': '{$trans.currency|escape:'htmlall':'UTF-8'}' }); {foreach from=$items item=item} ga('ecommerce:addItem', { 'id': '{$item.OrderId|escape:'htmlall':'UTF-8'}', 'sku': '{$item.SKU|escape:'htmlall':'UTF-8'}', 'name': '{$item.Product|escape:'htmlall':'UTF-8'}', 'category': '{$item.Category|escape:'htmlall':'UTF-8'}', 'price': '{$item.Price|escape:'htmlall':'UTF-8'}', 'quantity': '{$item.Quantity|escape:'htmlall':'UTF-8'}' }); {/foreach} {literal} (function() { {/literal}{if $isOrder eq true}{literal} var key = 'ga_trans'; var idtrans = {/literal}{$trans.id|intval}{literal}; if (!!$.prototype.totalStorage) var view_ga_trans = parseInt($.totalStorage(key)); else if (typeof localStorage !== 'undefined' && localStorage) var view_ga_trans = parseInt(localStorage.getItem(key)); if (typeof view_ga_trans !== 'undefined' && view_ga_trans > 0 && idtrans == view_ga_trans ) return false; if (!!$.prototype.totalStorage) $.totalStorage(parseInt(key, idtrans)); else if (typeof localStorage !== 'undefined' && localStorage) localStorage.setItem(key, parseInt(idtrans)); {/literal}{/if}{literal} ga('ecommerce:send'); })(); {/literal} {/if} {else} var _gaq = _gaq || []; _gaq.push(['_setAccount', '{$ganalytics_id|escape:'htmlall':'UTF-8'}']); // Recommended value by Google doc and has to before the trackPageView _gaq.push(['_setSiteSpeedSampleRate', 5]); _gaq.push(['_trackPageview'{if isset($pageTrack)}, '{$pageTrack|escape:'htmlall':'UTF-8'}'{/if}]); {if $isOrder eq true} {* If it's an order we need more data for stats *} _gaq.push(['_addTrans', '{$trans.id|escape:'htmlall':'UTF-8'}', {* order ID - required *} '{$trans.store|escape:'htmlall':'UTF-8'}', {* affiliation or store name *} '{$trans.total|escape:'htmlall':'UTF-8'}', {* total - required *} '{$trans.tax|escape:'htmlall':'UTF-8'}', {* tax *} '{$trans.shipping|escape:'htmlall':'UTF-8'}', {* shipping *} '{$trans.city|escape:'htmlall':'UTF-8'}', {* city *} '{$trans.state|escape:'htmlall':'UTF-8'}', {* state or province *} '{$trans.country|escape:'htmlall':'UTF-8'}' {* country *} ]); {foreach from=$items item=item} _gaq.push(['_addItem', '{$item.OrderId|escape:'htmlall':'UTF-8'}', {* order ID - required *} '{$item.SKU|escape:'htmlall':'UTF-8'}', {* SKU/code - required *} '{$item.Product|escape:'htmlall':'UTF-8'}', {* product name *} '{$item.Category|escape:'htmlall':'UTF-8'}', {* category or variation *} '{$item.Price|escape:'htmlall':'UTF-8'}', {* unit price - required *} '{$item.Quantity|escape:'htmlall':'UTF-8'}' {* quantity - required *} ]); {/foreach} {* submits transaction to the Analytics servers *} {literal} _gaq.push(['_trackTrans']); {/literal} {/if} {literal} (function() { {/literal}{if $isOrder eq true}{literal} var key = 'ga_trans'; var idtrans = {/literal}{$trans.id|intval}{literal}; if (!!$.prototype.totalStorage) var view_ga_trans = parseInt($.totalStorage(key)); else if (typeof localStorage !== 'undefined' && localStorage) var view_ga_trans = parseInt(localStorage.getItem(key)); if (typeof view_ga_trans !== 'undefined' && view_ga_trans > 0 && idtrans == view_ga_trans ) return false; if (!!$.prototype.totalStorage) $.totalStorage(parseInt(key, idtrans)); else if (typeof localStorage !== 'undefined' && localStorage) localStorage.setItem(key, parseInt(idtrans)); {/literal}{/if}{literal} var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); })(); {/literal} {/if} </script> Good luck, and feel free to come back if it won't work for you. (Details about validation problem here :https://productforums.google.com/forum/#!searchin/analytics/not$20validating|sort:relevance/analytics/_C2M4pZ9sEI/6r68GHifH5EJ) Hello! Not work to me I have Prestashop 1.6.0.9 Version nginx/1.7.1 Version PHP 5.5.9-1ubuntu4.3 File: /modules/ganalytics/views/templates/hook/header.tpl Can anyone help me? Best regards Link to comment Share on other sites More sharing options...
vekia Posted September 7, 2014 Share Posted September 7, 2014 hello jhd you have some visible errors related to this code ? 1 Link to comment Share on other sites More sharing options...
jhd Posted September 7, 2014 Share Posted September 7, 2014 Hello, I see no error. I can not validate the tracking code Thanks! Link to comment Share on other sites More sharing options...
Tuinkoken Posted September 8, 2014 Share Posted September 8, 2014 same problem on my site, also ganalytics is not tracking my sales in the e-commerce tab... 1 Link to comment Share on other sites More sharing options...
jhd Posted September 9, 2014 Share Posted September 9, 2014 (edited) Good morning! I have now pressed the check button, and verified. Enhorabuena. Ha habilitado correctamente los Informes demográficos. Aunque puede acceder a ellos ahora, es posible que transcurran hasta 24 horas antes de que haya datos disponibles en dichos informes. Obtenga más información acerca de los nuevos informes. Congratulations. You have successfully enabled demographic reports. Although you can access them now, it may take up to 24 hours before it becomes available in those reports. Learn more about the new reports. Best regards Edited September 9, 2014 by jhd (see edit history) Link to comment Share on other sites More sharing options...
Tuinkoken Posted September 10, 2014 Share Posted September 10, 2014 I tried to delete and reinstall, but it doesn't help... Can I have some settings wrong in google analytics? Or do you have suggestions for me about what you did? Link to comment Share on other sites More sharing options...
Gipielle Posted October 10, 2014 Author Share Posted October 10, 2014 nine months and no one has yet solved the problem .. Must be a whole ^ _ ^ 1 Link to comment Share on other sites More sharing options...
skechav Posted October 10, 2014 Share Posted October 10, 2014 nine months and no one has yet solved the problem .. Must be a whole ^ _ ^ The problem IS solved. I run two different sites of PS 1.6.8 and 1.6.9 this way and both of them get demographic details. Please, read the post carefully and do not rush.Also, it would be very helpful to add some extra details about the problem you face when saying that it doesn't work, so we could probably help you out. Good luck! Link to comment Share on other sites More sharing options...
skechav Posted October 10, 2014 Share Posted October 10, 2014 Thank you skechav! Dear Nzecheru, I m happy that it helped somehow. I just would like to know if you finally really solved the problem this way by modified the header.tpl code as described and by pressing the "Skip validation" Button on googles' panel. Have a nice day Link to comment Share on other sites More sharing options...
gesdi Posted December 29, 2014 Share Posted December 29, 2014 (edited) Display Analytics PrestaShop Google Analytics v2.0.4 - by PrestaShop PS 1.6.0.9 File: /modules/ganalytics/ganalytics.php Line: 199 add ga(\'require\', \'displayfeatures\'); Example: <script type="text/javascript"> (window.gaDevIds=window.gaDevIds||[]).push(\'d6YPbH\'); (function(i,s,o,g,r,a,m){i[\'GoogleAnalyticsObject\']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,\'script\',\'//www.google-analytics.com/analytics.js\',\'ga\'); ga(\'create\', \''.Tools::safeOutput(Configuration::get('GA_ACCOUNT_ID')).'\', \'auto\'); '.($back_office ? 'ga(\'require\', \'ecommerce\');' : '').' ga(\'require\', \'ec\');ga(\'require\', \'displayfeatures\'); </script>'; Salutacions, Gesdi Barcelona Edited December 29, 2014 by gesdi (see edit history) Link to comment Share on other sites More sharing options...
Smiles Posted March 25, 2015 Share Posted March 25, 2015 Hi, Current code did change a bit it seems. I need to add ga(\'require\', \'displayfeatures\'); for the remarketing (If hits sent to your web property do not include Advertising Features data, you won't be able to use Advertising Features). The current code in 1.6.0.9 ganalytics v2.0.9 File: /modules/ganalytics/ganalytics.php Looks like this: <script type="text/javascript"> (window.gaDevIds=window.gaDevIds||[]).push(\'d6YPbH\'); (function(i,s,o,g,r,a,m){i[\'GoogleAnalyticsObject\']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,\'script\',\'//www.google-analytics.com/analytics.js\',\'ga\'); ga(\'create\', \''.Tools::safeOutput(Configuration::get('GA_ACCOUNT_ID')).'\', \'auto\'); ga(\'require\', \'ec\'); '.($back_office ? 'ga(\'set\', \'nonInteraction\', true);' : '').' </script>'; I changed the code to: <script type="text/javascript"> (window.gaDevIds=window.gaDevIds||[]).push(\'d6YPbH\'); (function(i,s,o,g,r,a,m){i[\'GoogleAnalyticsObject\']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,\'script\',\'//www.google-analytics.com/analytics.js\',\'ga\'); ga(\'create\', \''.Tools::safeOutput(Configuration::get('GA_ACCOUNT_ID')).'\', \'auto\'); ga(\'require\', \'ec\');ga('require', 'displayfeatures'); '.($back_office ? 'ga(\'set\', \'nonInteraction\', true);' : '').' </script>'; } But this gave an error: [PrestaShop] Fatal error in module ganalytics:syntax error, unexpected 'require' (T_REQUIRE) How should i include the code: ga(\'require\', \'displayfeatures\'); to enable remarketing? Link to comment Share on other sites More sharing options...
elvispl Posted March 27, 2015 Share Posted March 27, 2015 You have this error because you have in code: ga('require', 'displayfeatures'); its correct: ga(\'require\', \'displayfeatures\'); 1 Link to comment Share on other sites More sharing options...
Smiles Posted March 27, 2015 Share Posted March 27, 2015 Great that did the trick! Link to comment Share on other sites More sharing options...
doekia Posted March 27, 2015 Share Posted March 27, 2015 nine months and no one has yet solved the problem .. Must be a whole ^ _ ^ I do agree with Gipielle after a year the problem is still existant since not a single person from the team fixed the error upstream. Each new version pushed by the infamous addons, has still the bug burried in. A shame! Link to comment Share on other sites More sharing options...
Smiles Posted March 27, 2015 Share Posted March 27, 2015 We could add it ourself in github? But i dont know github.. Link to comment Share on other sites More sharing options...
st0le Posted July 8, 2015 Share Posted July 8, 2015 Hello, I have the same problem... Imposible to track Analytics. http://dilataciones.com I tried to do by module, developing myself, nothing... nothing to do... put the analytics code omg.. I did it more than 50 times... Someone know what is happening? Omg Cheers, Link to comment Share on other sites More sharing options...
bartek1010 Posted November 17, 2015 Share Posted November 17, 2015 I have had same problem. And solved it. Google analytics module had couple of errors in source code in modules/ganalytics/ganalytics.php and it was generating incorrect code. To fix it edit the file go to line 259 and replace code with this: <script> (function(i,s,o,g,r,a,m){i[\'GoogleAnalyticsObject\']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,\'script\',\'//www.google-analytics.com/analytics.js\',\'ga\'); ga(\'create\', \''.Tools::safeOutput(Configuration::get('GA_ACCOUNT_ID')).'\', \'auto\'); ga(\'send\', \'pageview\');' .(($user_id && !$back_office) ? 'ga(\'set\', \'&uid\', \''.$user_id.'\');': '') .($back_office ? 'ga(\'set\', \'nonInteraction\', true);' : '') .'</script>'; ORIGINALLY IT WAS: <script type="text/javascript"> (window.gaDevIds=window.gaDevIds||[]).push(\'d6YPbH\'); (function(i,s,o,g,r,a,m){i[\'GoogleAnalyticsObject\']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,\'script\',\'//www.google-analytics.com/analytics.js\',\'ga\'); ga(\'create\', \''.Tools::safeOutput(Configuration::get('GA_ACCOUNT_ID')).'\', \'auto\'); ga(\'require\', \'ec\');' .(($user_id && !$back_office) ? 'ga(\'set\', \'&uid\', \''.$user_id.'\');': '') .($back_office ? 'ga(\'set\', \'nonInteraction\', true);' : '') .'</script>'; 1 Link to comment Share on other sites More sharing options...
Recommended Posts