cancel
Showing results for 
Search instead for 
Did you mean: 

Installing Google Analytics' Global Site Tag (gtag.js) & enable eCommerce tracking in Magento 1

Installing Google Analytics' Global Site Tag (gtag.js) & enable eCommerce tracking in Magento 1

Good day. Could someone please help on this. I am not finding documentation on installing the new Global Site Tag from Google Analytics and making sure the eCommerce tracking is working in Magento 1.

 

Here is the new Global Site Tag format:

 

<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-xxx-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-xxx-1');
</script>

 

The Google API section on Magento 1 does not seem to support this. 

 

 

 

How does the below tie into the new GA tag?

- The type only shows GA and Universal.

magento1 google api.JPG

This is the only way to add the new GA tag?

magento1 google api design.JPG

 

 

 

14 REPLIES 14

Re: Installing Google Analytics' Global Site Tag (gtag.js) &amp; enable eCommerce tracking in Ma

Hi there, any recommendations on this query?

 

Even if you do not have a solution, are you experiencing the problem?

Re: Installing Google Analytics' Global Site Tag (gtag.js) &amp; enable eCommerce tracking in Ma

Hello,

 

you need to add script code into Scripts section.

 

If you are adding all thing like GA number in that section.

 

Then disabled google API section.

 

Hope it will work for you.

 

If it will work then Mark as Solution.


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Installing Google Analytics' Global Site Tag (gtag.js) &amp; enable eCommerce tracking in Ma

Hi, thank you for the reply.

 

We have tried this solution. But then what happens is that the eCommerce transactions are not showing in Google Analytics. So we are currently enabling both for the transactions to show in GA.

Not the solution Smiley Sad

Re: Installing Google Analytics' Global Site Tag (gtag.js) &amp; enable eCommerce tracking in Ma

Hello @rooki4life

 

Please add google analytics code as well into the script.

 

Hope it will help you.


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Installing Google Analytics' Global Site Tag (gtag.js) &amp; enable eCommerce tracking in Ma

Hi @Sunil Patel.

 

What script? the only script GA supplied is this. The new Global tag.new ga globacl.JPG

 

 

Re: Installing Google Analytics' Global Site Tag (gtag.js) &amp; enable eCommerce tracking in Ma

Hi @Sunil Patel.

 

What script? the only script GA supplied is this. The new Global tag. new ga globacl.JPG

 

Re: Installing Google Analytics' Global Site Tag (gtag.js) &amp; enable eCommerce tracking in Ma

Hello 

 

@rooki4life

 

<script type="text/rocketscript">
//<![CDATA[
    (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-your-code', 'auto');
ga('send', 'pageview');
    
//]]>
</script>

please check and edit your code and paste it.

 

Then check it.

 

If it will work then Mark as a solution.


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Installing Google Analytics' Global Site Tag (gtag.js) &amp; enable eCommerce tracking in Ma

What script is that?

 

Is it part of the new Global GA tag? We require the Global GA tag so allow for Google AdWords tagging.

If I add the new Global GA tag plus your code it will be tracking twice?

Re: Installing Google Analytics' Global Site Tag (gtag.js) &amp; enable eCommerce tracking in Ma

Hello @rooki4life

 

please add both code and check it.

 

 

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer