Jump to content

Google analytics is not tracking the checkout page.


Jerryp

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

Link to comment
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)

Link to comment
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!

Link to comment
Share on other sites

  • 3 weeks later...

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)
Link to comment
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.

Link to comment
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.

Link to comment
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
×
×
  • Create New...