How to install Google Analytics on your website

In this article, I will show you how to install Google Analytics (both Google Analytics 4 and Universal Analytics) on your website at the same time. Here I have assumed that you do not have a Google Analytics account

If you already have a Google Analytics account with Universal Analytics property then check out this article How to upgrade to GA4 (Google Analytics 4) to tag for both Universal Analytics and Google Analytics 4

Follow the steps below to install Google Analytics on your website (both Google Analytics 4 and Universal Analytics)

Step-1: Navigate to https://analytics.google.com/

Step-2: Sign in with your Google username and password.

Step-3: Click on the ‘Start Measuring’ button:

Install Google Analytics

62 point checklist 
Get the E-Book (50 Pages)
Google Analytics 4 thumb 
Get the FREE E-Book (50+ Pages)

Step-4: Enter your account name (it is generally your company name):

account name


Step-5: Select all the Account data sharing settings (or the one you want) and then click on the ‘Next’ button:

account data settings


Step-6: Enter the name of your Google Analytics Property (it is generally your website name):

property name


Step-7: Set your reporting timezone and currency:

timezone


Step-8: Click on the ‘Show advanced options‘ link:

advanced options


Step-9: Switch on the toggle button next to ‘Create a Universal Analytics property‘:

universal analytics toggle


Step-10: Enter your domain name and then click on the ‘Next’ button:

website url


Note: Here we are going to create both Google Analytics 4 and Universal Analytics property at the same time. If you want to create only the universal analytics property then select the option ‘Create a Universal Analytics property only‘:

univeral analytics property


Step-11: Select your industry category and business size:

business analytics


Step-12: Specify how you intend to use Google Analytics with your business. Check all the boxes that are applicable to you and then click on the ‘create‘ button:

ga intentions


Step-13: Select your country from the drop-down menu, go through ‘Google Analytics Terms of Service’, go through ‘Data Processing Terms‘ and then click on the checkbox ‘I also accept the Data Processing Terms as required by GDPR‘:

terms of service


Step-14: Scroll down, go through ‘Google Measurement Controller-Controller Data Protection Terms‘, click on the checkbox ‘I accept the Measurement Controller-Controller Data Protection Terms for the data that I share with Google.‘ and then click on the ‘I Accept‘ button:

data protection terms


You should now see a screen like the one below:

web stream details


Step-15: Click on the ‘Copy’ button to copy your measurement ID:

measurement id


Step-16: Login to your Google Tag Manager account and then click on the ‘New Tag’ button:

gtm new tag


Note: Make sure that the Google Tag Manager code is installed on all the pages of your website.  Check out this article for more detail: How to Install Google Tag Manager on your website

Step-17: Name your new tag ‘GA4 Configuration Tag‘:

ga4 configuration tag


Step-18: Click on the ‘Choose a tag type’ button:

choose tag type


Step-19: Click on ‘Google Analytics: GA4 Configuration‘:

tag type


Step-20: Enter the measurement ID you copied earlier in the ‘Measurement ID‘ text box:

enter measurement id


Step-21: Click on the ‘Choose a trigger’ button:

triggering


Step-22: Click on ‘All pages’:

trigger all pages


Step-23: Click on the ‘Save’ button to save your tag:

save tag


Step-24: Click on the ‘Preview’ button at the top right-hand side:

preview


The tag manager preview mode window would open in a new browser tab. If it doesn’t then it means your browser is blocking the window.

Step-25: Enter your website URL and then click on the ‘Start‘ button:

website url 1


Once you clicked on the ‘Start’ button, one new tab will open up in your browser window which shows your website.

Step-26: Switch back to the browser tab which shows your tag manager preview mode window and then click on the ‘Continue‘ button:

continue


Step-27: If you see the tag G4 Configuration Tag under the Tags Fired section then it means your tag is firing correctly:

tags fired

Step-28: Navigate back to your GTM account and then click on the ‘Submit’ button:

submit


Step-29: Give your version a name and then click on the ‘Publish’ button:

publish


Step-30: Navigate back to your website and visit a couple of pages.

Step-31: Navigate back to your GA4 property and then click on the cross button next to ‘Web stream details‘:

web stream measurement id


Step-32: Click on the ‘Real-time’ icon to open the real-time report:

real time


You should now be able to see new data flowing in your real-time report:

real time2


Congratulations! You have successfully set up tracking for your GA4 property. 

But you still need to set up tracking for Universal Analytics property. 

Step-33: Click on the drop-down menu at the top:

site drop down


Step-34: Click on your Universal Analytics property (the universal analytics property ID starts with ‘UA’ for example UA-193355119-1):

universal analytics properties


Step-35: Click on ‘All Web Site Data’:

all website data


You should now see a screen like the one below:

try mobile app


Step-36: Click on the ‘Dismiss‘ button at the bottom right-hand side of your screen:

try mobile app dismiss


Step-37: Click on the ‘Admin‘ link at the bottom left hand-side of your screen:

admin link


Step-38: Click on the ‘Tracking Info‘ link under the ‘Property’ column:

tracking info


Step-39: Click on ‘Tracking Code‘:

tracking code


Step-40: Copy the tracking ID:

tracking id


Step-41: Navigate to your Google Tag Manager account and then click on the ‘Variables‘ link:

gtm new tag2


Step-42: Click on the ‘New‘ button under ‘User-Defined Variables‘:

user defined variables


Step-43: Name the new variable ‘GA Default Settings‘ and then set the variable type to ‘Google Analytics Settings‘:

ga default settings


Step-44: Enter the tracking ID you copied earlier in the ‘Tracking ID‘ text box and then click on the ‘Save’ button:

ga default settings save


Step-45: Click on the ‘Overview’ link:

overview


Step-46: Click on the ‘New Tag’ button:

gtm new tag2 1


Step-47: Set up your new tag like the one below and then click on the ‘Save’ button:

tracking code save


Step-48: Click on the ‘Preview’ button at the top right-hand side:

preview 1


Step-49: Enter your website URL and then click on the ‘Start’ button:

website url 2


Once you clicked on the ‘Start’ button, one new tab will open up in your browser window which shows your website.

Step-50: Switch back to the browser tab which shows your tag manager preview mode window and then click on the ‘Continue‘ button:

connected


Step-51: If you see the tag GA Tracking Code Main property under the Tags Fired section then it means your tag is firing correctly:

tags fired2


Step-52: Navigate back to your GTM account and then click on the ‘Submit’ button:

submit 1


Step-53: Give your version a name and then click on the ‘Publish’ button:

publish2


Step-54: Navigate back to your Universal Analytics property and then click on the ‘Send test traffic‘ button:

send test traffic


When you click on the ‘Send test traffic’ button, your website will open in a new window. Once your website has fully loaded into this new window then close the window. 

You should now see a message like the one below: 1 active users right now (including 1 from test traffic). See details in real-time traffic reports:

test traffic status

Congratulations! You have successfully set up tracking for your Universal Analytics property. 

You now have set up tracking both for your Google Analytics 4 property and the Universal Analytics property.

Related Article: How to install Google Tag Manager on your WordPress Website

Register for the FREE TRAINING...

"How to use Digital Analytics to generate floods of new Sales and Customers without spending years figuring everything out on your own."



Here’s what we’re going to cover in this training…

#1 Why digital analytics is the key to online business success.

​#2 The number 1 reason why most marketers are not able to scale their advertising and maximize sales.

#3 Why Google and Facebook ads don’t work for most businesses & how to make them work.

#4 ​Why you won’t get any competitive advantage in the marketplace just by knowing Google Analytics.

#5 The number 1 reason why conversion optimization is not working for your business.

#6 How to advertise on any marketing platform for FREE with an unlimited budget.

​#7 How to learn and master digital analytics and conversion optimization in record time.



   

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
error: Alert: Content is protected !!