cancel
Showing results for 
Search instead for 
Did you mean: 

Google Analytics Basics

Google Analytics Basics

I've seen many answers, but need a clear and straight solution to implementing Google Analytics for my site.

 

For the Stores->Configuration->Sales->Google API entry under Account Number:, is it looking for my:

  • Property ID or
  • Measurement ID or
  • Stream ID?

 

I've got the .js code in the Content->Configuration->Global (for the active Theme)->Footer->Miscellaneous HTML box as follows (obfuscated for privacy, and includes an old Google Ads code):

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

  gtag('config', 'AW-MY_AD_CODE');
  gtag('config', ‘G-MY_MEASUREMENT_ID’);
</script>
<script>
  gtag('config', 'AW-MY_AD_CODE/SOME_OTHER_ID', {
    'phone_conversion_number': '(800) 555-1212'
  });
</script>

So a few questions:

  1. Do I need the code in the Footer HTML? It seems to not work when I remove it
  2. Which ID is need in the Google API section?
  3. When I put just the Footer HTML code in, Analytics doesn't seem to be tracking all the way to an actual sale. How do I get end-to-end Analytics tracking?
  4. Is there a single set of steps I can follow in 2.3.5 (and for another separate site in 2.4 that I have) to implement Analytics? There seem to be many and conflicting instructions that don't specify the right (exact) ID to place in the Stores->Configuration->Sales->Google API section and whether that's really all I need for it to work. 
  5. When I only put the ID in the Sales->Google API section, it doesn't seem to connect to Analytics at all.

Thanks in advance!


Thank you,
Mike.
1 REPLY 1

Re: Google Analytics Basics

Thanks - I appreciate the response.

 

Already been through the Analytics Basics course and been using it for a while, but it doesn't help with the specifics of configuring Magento 2 and getting the responses for sales. We've had months of data, but it's not tracking through to sales...

 

Those are the answers I really need.


Thank you,
Mike.