Jump to content

Google Analytics Module Not Tracking ECommerce Data on Prestashop 1.6.9


nabeez

Recommended Posts

Hi everyone,

 

I've been struggling with this issue for a while now and I hope someone can help. 

 

Since I upgraded my site from 1.4 to 1.6 ( cooleather.com )  Google Analytics module stopped tracking ECommerce Data so now I'm shooting in the dark with conversion tracking etc.. 

 

Evern after I upgraded the GAnalytics module to the latest one .. still not tracking any ecomm conversion data. 

 

Anyone ha any idea? 

 

Much appreciate your help

 

Nabil

  • Like 1
Link to comment
Share on other sites

Hi everyone,

 

I have/had the same problems. If i check the source code the header.tpl is not used anymore and there is no transaction code on the confirmation page

So i checked whether the module was hooked to the displayTop position, it wasn't cause it used to use the header.tpl

Now at least i see transaction code on the confirmation page, now just waiting for incoming data

 

* To track transactions
*/
public function hookTop()
{
// Add Google Analytics order - Only on Order's confirmation page
Link to comment
Share on other sites

Hi studio16,

 

Did that work? I look forward to hear the results. 

 

Thanks,

Nabil

 

 

Hi everyone,

 

I have/had the same problems. If i check the source code the header.tpl is not used anymore and there is no transaction code on the confirmation page

So i checked whether the module was hooked to the displayTop position, it wasn't cause it used to use the header.tpl

Now at least i see transaction code on the confirmation page, now just waiting for incoming data

 

* To track transactions
*/
public function hookTop()
{
// Add Google Analytics order - Only on Order's confirmation page

 

Link to comment
Share on other sites

I did that multiple time with cash flush and doesn't help! 

 

I did some testing .. placed an order on COD. Here is what I saw in the order confirmation page, data seems to be added properly to Javascript but I see nothing in Google Analytics:

 

<script type="text/javascript">/* <![CDATA[ */;var CUSTOMIZE_TEXTFIELD=1;var FancyboxI18nClose='Close';var FancyboxI18nNext='Next';var FancyboxI18nPrev='Previous';var added_to_wishlist='Added to your wishlist.';var ajax_allowed=true;var ajaxsearch=true;var baseDir='https://cooleather.com/';var baseUri='https://cooleather.com/';var blocksearch_type='top';var contentOnly=false;var customizationIdMessage='Customization #';var delete_txt='Delete';var displayList=false;var freeProductTranslation='Free!';var freeShippingTranslation='Free shipping!';var generated_date=1420121640;var google_conversion_color='ffffff';var google_conversion_currency='USD';var google_conversion_format=3;var google_conversion_id=1064642489;var google_conversion_label='1iMXCJv94QMQuc_U-wM';var google_conversion_language='en';var google_conversion_value=139;var google_remarketing_only=false;var id_lang=1;var img_dir='https://cooleather.com/themes/default-bootstrap/img/';var instantsearch=true;var isGuest=0;var isLogged=1;var loggin_required='You must be logged in to manage your wishlist.';var mywishlist_url='https://cooleather.com/module/blockwishlist/mywishlist';var page_name='order-confirmation';var placeholder_blocknewsletter='Enter your e-mail';var priceDisplayMethod=0;var priceDisplayPrecision=2;var quickView=false;var removingLinkText='remove this product from my cart';var roundMode=2;var search_url='https://cooleather.com/search';var static_token='803d143c769d0b7556a75673c7dc6901';var token='64072b106095389d7efa2b87ce1633ea';var usingSecureMode=true;var wishlistProductsIds=false;/* ]]> */</script><script type="text/javascript" src="https://cooleather.com/themes/default-bootstrap/cache/v_109_3836839901de119894c93769bcb7ddc2.js"></script> <script type="text/javascript" src="https://www.googleadservices.com/pagead/conversion.js"></script> <script type="text/javascript">/* <![CDATA[ */;var yotpoAppkey=sH3eOi45K1csLY2UUczD3rG1Jt3n4QiAcyhaG5O4";function inIframe(){try{return window.self!==window.top;}catch(e){return true;[spam-filter]   var inIframe=inIframe();if(inIframe){window['yotpo_testimonials_active]=true;}   if(document.addEventListener){document.addEventListener('DOMContentLoaded',function(){var e=document.createElement("script");e.type="text/javascript",e.async=true,e.src="//staticw2.yotpo.com/"+yotpoAppkey+"/widget.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)});}   else if(document.attachEvent){document.attachEvent('DOMContentLoaded',function(){var e=document.createElement("script");e.type="text/javascript",e.async=true,e.src="//staticw2.yotpo.com/"+yotpoAppkey+"/widget.js";var t=document.getElementsByTagName("script")[0];t.parentNode.insertBefore(e,t)});};;(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','UA-30706855-4','auto');ga('require','ec');;(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src='//www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);})(window,document,'script','dataLayer','GTM-K48H3J');;jQuery(document).ready(function(){var MBG=GoogleAnalyticEnhancedECommerce;MBG.setCurrency('USD');MBG.add({"id":null,"name":null,"category":null,"brand":"","variant":null,"type":"typical","position":"0","quantity":"1","list":"orderconfirmation","url":"","price":"0.00"});

MBG.addTransaction({"orderid":"OYNWSDFOY","affiliation":"Cooleather.com",

"revenue":"139.00","shipping":"19.00","tax":0,

"url":"https:\/\/cooleather.com\/module\/ganalytics\/ajax"});ga('send','pageview');});;jQuery(document).ready(function()

{var MBG=GoogleAnalyticEnhancedECommerce;MBG.setCurrency('USD');ga('send','pageview');});/* ]]> */</script></body></html>

 

You can try to reset the module, cause it was not hooked to the new position by default.

 

Edited by nabeez (see edit history)
Link to comment
Share on other sites

cedricfontaine send me a version of the GA Module today and it seems working fine and tracking ecommerce data. I'm going to test it for few day and confirm it. 

 

@cedricfontaine if your fixes are confirmed to be working, can you apply your fixes on the module so everyone can update it through Prestashop and benefit fro it? 

 

Still wondering why this post is not getting the traffic it needs. Im sure someone can give some better insight on this issue. Analytics is the heartbeat of any e-commerce site and this is not a small issue.

Link to comment
Share on other sites

Nothing to do with the Google Analytics module. This module is fine.

Just make sure that the Property Settings for your PS store are pointing to the correct URL in Google Analytics.

I had mine configured to look for an http site whereas my site is https. So it did not record any stats until I updated the Property settings to the proper URL. It's working fine now.

Link to comment
Share on other sites

Hi, analyzing the behavior of the module ganalytics I noticed that some erroneous transactions stem from the fact that when the customer enters orderHistory inserts a new record in the table ps_ganalitycs . Now as to the inclusion in the database is only in the method hookOrderConfirmation , probably there is a bug in the call of hookOrderConfirmation

Link to comment
Share on other sites

Hi,

 

Also tried this module but on a old prestashop 1.4, because my conversions stop working.

Get a fatal error with:

Notice: Undefined property: ShopBackwardModule::$name in /...../modules/ganalytics/ganalytics.php on line 255

Does anyone have an idea ?

 

Happen with latest ganalycs v2.0.6

Link to comment
Share on other sites

Hi,

 

Also tried this module but on a old prestashop 1.4, because my conversions stop working.

Get a fatal error with:

Notice: Undefined property: ShopBackwardModule::$name in /...../modules/ganalytics/ganalytics.php on line 255

Does anyone have an idea ?

 

Happen with latest ganalycs v2.0.6

 

Hello,

 

Do you have the module Backward Compatibility ?

Link to comment
Share on other sites

Tried the below and still I get not analytics data.

 

In analytics under tracking info I get "Status: Tracking Not Installed"

 

Even though it is installed.

 

Prestashop 1.6.011 New install, and Ganalytics module 2.0.6

 

If you want to pm me I can let you have full access to the site should you want a site to troubleshoot on.

 

Hello,

 

You can try to change the line

'affiliation' => $this->context->shop->name

by

'affiliation' => Configuration::get('PS_SHOP_NAME')

on line 255 of ganalytics.php

Link to comment
Share on other sites

I updated to v 2.0.6 last Friday and since then I've no analytics data :( . I'm on Prestashop 1.4.3. 

Same here, but I am on PS 1.6.0.9. When I install GA 2.0.6 there is no data at all. When I install 1.8.2 it works but doesn't track orders.

 

I wann go back to an older (working) version. Anyone have got an older version for download?

  • Like 1
Link to comment
Share on other sites

I'm not surprised. The latest versions of modules usually don't care about older PrestaShop versions.

 

Simply try to uninstall the module and install again. It sometime helps.

Thanks for suggestion, tried that and it still doesn't work. 

Link to comment
Share on other sites

Hi there, 

I'm using GA but instead GA tracking code, I'm using it as a tag in GTM. It tracks ok visits but it doen't track neither paypal or payplug transactions. 

I'm trying to track ths data as tags in enhanced ecommerce with GTM, but I need to declare data in the Data Layer... Does anybody know how to do this? 

Thank you.

Link to comment
Share on other sites

Please ignore my previous post as the GA 2.0.7 does not track anything at all! It was probably cookies from older (working) version.

 

The GA is hooked to the following modules:

 

displayAdminOrder

displayBackOfficeHeader

displayFooter

displayFooterProduct

displayHeader

displayHome

displayOrderConfirmation

 

Am I missing something?

Link to comment
Share on other sites

×
×
  • Create New...