In this post you will get complete information about how to install Google Analytics through Google Tag Manager.
To install Google Analytics through Google Tag Manager please follow the steps mentioned below:
Step:1–Login Google tag manager
Go to tagmanager.google.com, Login to your account. Click on container. Workspace page opens.
Step:2-Create user-define variable
Click on Variables. This opens a page showing two types of variables. First is pre-defined variable and second is user-defined variable.
For Google Analytics we have to create user-defined variable. For this we will be requiring tracking ID of Google Analytics. For this we will follow the steps:
- Go to analytics.google.com and login
- Click on Admin.
- Admin page opens.
- In Property section click on Tracking info.
- Select tracking code.
- Tracking ID appears on the same page on right side.
- Copy the tracking ID.
Go back to Google Tag Manager page. Click on New icon in User-defined variables box. Untitled variables box opens. Edit the name of variable. It is always advisable to give meaningful name to variable for hassle-free continuation of process. Paste the Tracking ID in place of Untitled variables and save it.
For this we will follow the steps:
- Click on Variable Configuration. Choose Variable type box opens.
- Select variable type. (Here we select Google Analytics settings as we need it for Google Analytics).
- In Variable Configuration paste the Tracking ID .
- Click on save. Now user-defined variable will show on workspace column on Tag Manager place.
Step:3-Create tag in Google tag manager
Now we will select tag. Tag tab opens. For this we will follow the steps:
- Click on New tag.
- Untitled tag opens. Edit the same with meaningful title.
- Click on Tag configuration.
- Choose Tag type box opens. Here we select Google Analytics / Universal analytics.
- Select Track type.Select Google Analytics settings. (Select the variable that we recently created).
- Now to fire the tag we will come down to Triggering section. Google analytics code is present on all pages so,In triggering section select All Pages.
- Save the page. In this way tag is created.
Step:4-Publish Version for Google analytics code
Click on Submit on Tag Manager page. After submission the tag becomes live. Submit changes box opens.
- Fill in the version name. (Notes of your recent action.)
- Fill in version description. (You can describe your recent action. It is optional.)
- Click on publish icon.
- Everything has become live now.
Step:5-Check Google analytics is working or Not
Now refresh the website. Go to Analytics page. Select Real time. Google Analytics Home opens and graph appears on it. (This shows that the Google Analytics has started working.)
There is another way of tracking the activation of Google Analytics through Google Tag Assistant. Install Chrome. Click on the Google Assistant icon that appears on the website page. Drop down box will open which will show the active tags.
In this way you can easily install Google Analytics through Google Tag Manager.