cancel
Showing results for 
Search instead for 
Did you mean: 

Google Analytics Broke After M2 Upgrade

Google Analytics Broke After M2 Upgrade

https://shop.andersonprocess.com/

 

We recently upgraded our site from M1 to M2, but lost our Google Analytics functionality in the process. Please take a look at my source code - Any feedback would be greatly appreciated. Going on our 3rd week live and still haven't had analytics record any data. I've tried implementing Google Tag Manager as well, but all we are looking for is the basic built-in google analytics functionality.

 

Thanks,

Brandon

 

https://shop.andersonprocess.com/

2 REPLIES 2

Re: Google Analytics Broke After M2 Upgrade

Hi @AP_broman 

Kindly refer below link for setup Google Analytic with Magento 2:

https://www.fastcomet.com/tutorials/magento2/google-analytics

 

If issue resolve, please click on 'Kudos' & Accept as Solution!
Thank you.

 

Problem solved? Click Accept as Solution!

Re: Google Analytics Broke After M2 Upgrade

@Bhanu Periwal - Appreciate the comment, but I already had that configured and am still yet to receive any analytic data. Do you see anything wrong here? Not sure if this is your expertise or not...

 

}</style> <!-- Global site tag (gtag.js) - Google Analytics -->
<script></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());

gtag('config', 'UA-89557459-1');
</script> <!-- Google Tag Manager -->
<script>(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=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-N43Q8GL');</script>
<!-- End Google Tag Manager -->
<!-- BEGIN GOOGLE ANALYTICS CODE -->
<script type="text/x-magento-init">
{
"*": {
"Magento_GoogleAnalytics/js/google-analytics": {
"isCookieRestrictionModeEnabled": 0,
"currentWebsite": 1,
"cookieName": "user_allowed_save_cookie",
"ordersTrackingData": [],
"pageTrackingData": {"optPageUrl":"","isAnonymizedIpActive":false,"accountId":"UA-89557459-1"} }
}
}
</script>
<!-- END GOOGLE ANALYTICS CODE -->
<!-- BEGIN GOOGLE VERIFICATION TAG -->
<!-- END GOOGLE VERIFICATION TAG -->
<!-- BEGIN GTAG GLOBAL TAG -->
<!-- END GTAG GLOBAL TAG -->