How to Implement Google Analytics With Google Tag Manager

Do you want expert help in setting up/fixing GA4 and GTM?

If you are not sure whether your GA4 property is setup correctly or you want expert help migrating to GA4 then contact us. We can fix your website tracking issues.

To implement Google Analytics on your website via Google Tag Manager (GTM) follow the steps below:

Step-1: Login to your Google Analytics account and then open your reporting view.

Step-2: Click on the wheel icon at the bottom left of your screen in order to access the GA admin area:

google analytics admin

Step-3: Click on ‘Tracking Code’ link (under Property column > Tracking Info):

tracking code

Step-4: Take a note of the tracking ID. You would need this ID later when you set up Google Analytics via GTM:

tracking id

Step-5: Login to your GTM account and then click on the link ‘Add a new tag’:

add a new tag

Step-6: Name your tag ‘Google Analytics Tracking – All Pages’:

enter tag name

Step-7: Click on ‘Choose a tag type to begin setup…’ button:

choose a tag type

Step-8: Select ‘Google Analytics Universal Analytics’ from the list of featured tags:

choose tag type

Step-9: Click on the checkbox ‘Enable overriding settings in this tag‘ and then enter the tracking ID of your Google Analytics property in the ‘Tracking ID’ text box:

ga tag configuration

Note: Do not enter the tracking ID you see in the screenshot. Otherwise, your Google Analytics tracking won’t work. Enter the tracking ID of your Google Analytics property.

Step-10: Scroll down and then click on ‘Choose a trigger to make this tag fire…

Choose a trigger to make this tag fire

Step-11: Click on ‘All Pages’ trigger as we want the Google Analytics tracking code to fire on all the web pages of our website:

all pages trigger

Your entire tag configuration should now look like the one below:

ga tag configuration2

Step-12: Click on the ‘Save’ button to complete the process of creating a new tag. You will now see your new tag listed under the ‘Tags’ section:

workspace changes

Step-13: Click on the ‘preview’ button on the top left hand side to test the tag on your website:

preview button

Once you have clicked on the ‘preview’ button, you will see a message box like the one below:

now previewing workspace

Step-14: Now visit your website, scroll down to the bottom of the window and look for a debugging window, like the one below:

google analytics tracking firing

This debugging window is telling you, that if you publish your Google Analytics tag on the live website, it should fire/execute.

Note: Make sure that, not only the tag is firing but it is also not breaking the website design and/or functionality in any way.

Step-15: Once you have tested your new tag, head back to GTM and click on the ‘Leave Preview Mode’ link :

leave preview mode

Step-16: Click on the ‘Submit’ button in the top navigation:

submit button

Step-17: Enter your version name and version description (like the one below) and then click on the ‘Publish’ button:

submit changes

This action will install Google analytics on your website via Google Tag Manager.

Step-18: Now remove the hardcoded Google Analytics tracking code from all of the web pages on your website. If the Google Analytics tracking code is not hardcoded on your website then you can skip this step.

That’s how you can implement Google Analytics on your website via Google Tag Manager.

Related Articles

My best selling books on Digital Analytics and Conversion Optimization

Maths and Stats for Web Analytics and Conversion Optimization
This expert guide will teach you how to leverage the knowledge of maths and statistics in order to accurately interpret data and take actions, which can quickly improve the bottom-line of your online business.

Master the Essentials of Email Marketing Analytics
This book focuses solely on the ‘analytics’ that power your email marketing optimization program and will help you dramatically reduce your cost per acquisition and increase marketing ROI by tracking the performance of the various KPIs and metrics used for email marketing.

Attribution Modelling in Google Analytics and BeyondSECOND EDITION OUT NOW!
Attribution modelling is the process of determining the most effective marketing channels for investment. This book has been written to help you implement attribution modelling. It will teach you how to leverage the knowledge of attribution modelling in order to allocate marketing budget and understand buying behaviour.

Attribution Modelling in Google Ads and Facebook
This book has been written to help you implement attribution modelling in Google Ads (Google AdWords) and Facebook. It will teach you, how to leverage the knowledge of attribution modelling in order to understand the customer purchasing journey and determine the most effective marketing channels for investment.

About the Author

Himanshu Sharma

  • Founder, OptimizeSmart.com
  • Over 15 years of experience in digital analytics and marketing
  • Author of four best-selling books on digital analytics and conversion optimization
  • Nominated for Digital Analytics Association Awards for Excellence
  • Runs one of the most popular blogs in the world on digital analytics
  • Consultant to countless small and big businesses over the decade