Jump to content

Google analytics is not tracking the checkout page.


Jerryp
 Share

Recommended Posts

Hi, 

 

Has anyone experienced the same problem as me. I can track all my pages in analytics but not the checkout page, its not working in analytics. 

I have tested different modules and added code directly in the header.tpl but still analytics cant track my checkout page. 

What could create this problem, ? Anyone had the the same problem, any idea? I need to find a solution for this..

 

/ Jerry

Share this post


Link to post
Share on other sites

  • 1 year later...
  • 3 weeks later...

If you are using a third party checkout page then please check if it is loading the header correctly. Also you can check the console or network section in the developer tool using inspect element.

You can also check if the added code is adding in header or not by viewing page source of checkout page (CTRL+U)

Share this post


Link to post
Share on other sites

On 4/26/2022 at 9:13 AM, Knowband Plugins said:

If you are using a third party checkout page then please check if it is loading the header correctly. Also you can check the console or network section in the developer tool using inspect element.

You can also check if the added code is adding in header or not by viewing page source of checkout page (CTRL+U)

Hi,

Thanks for your response.
The checkout page is the original of Prestashop. The module only adds payment methods.
Does anyone know what could be going wrong?

Thank you!

Share this post


Link to post
Share on other sites

If the issue is related to the payment method, you can check the same by disabling the payment method you are referring and then check the checkout page.

Have you checked if the added code is adding in header of checkout page or not by viewing page source (CTRL+U).

Share this post


Link to post
Share on other sites

  • 3 weeks later...
Posted (edited)

Hi,

Other pages, for example the product page, load GoogleAnalyticEnhancedECommerce properties

 document.addEventListener('DOMContentLoaded', function() {
            if (typeof GoogleAnalyticEnhancedECommerce !== 'undefined') {
                var MBG = GoogleAnalyticEnhancedECommerce;
                MBG.setCurrency('EUR');
                MBG.addProductDetailView(.....

But on the order page  GoogleAnalyticEnhancedECommerce doesn't show up anywhere in the source code.

Thank you!

Edited by etsmes (see edit history)

Share this post


Link to post
Share on other sites

Now I see the problem.
On the order page, the footer has no hooks.
GoogleAnalyticEnhancedECommerce is linked via the displayFooter hook, but the displayFooter hook does not exist on the order page.

I don't know how to fix it because if I add the displayFooter hook on the order page then I get a lot of information that doesn't have to be there.

Share this post


Link to post
Share on other sites

Hi,

in this case you could apply a modification to the analytics module, create and register a new hook in the module which exists on the order confirmation page like the displayOrderConfirmation1 hook, and implement the same functionality of footer hook in this hook .

Have a nice day, Leo.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More