In this article I will show you how to deploy and tune Google Analytics through Google Tag Manager. In fact, deploying Google Analytics requires some tuning settings, not just the deployment of tracking code to the website.
1、GTM creates a container
Log in to the GTM from this page:https://marketingplatform.google.com/about/tag-manager/,creates a container,Click on the small dot to the right of the account and click on “Create Container”:
Then see the setting interface of the Create Container:
Container Name:Custom container name, usually fill in the domain name.
Target Platform:According to the actual situation, choose web here.
Finally click Create to create a new container.
2、Deploy the GTM code to the website
Next is the code to deploy GTM, click on the container to enter the container’s settings interface:
Click”Admin”——”Install Google Tag Manager”,See the code that needs to be deployed:
The code has two paragraphs, one that needs to be deployed to the header, and one that needs to be deployed to the body.
If you don’t have server permissions, you need to let the development colleagues handle it.
After deployment, you can test it through Ghostery. Open the website on chrome and open the plugin Ghostery on Chrome.:
You can see that Google Tag Manager here means that the deployment is successful.
3、Configuring the GA tracking code in GTM
Create a Property in Google analytics and get the Tracking ID.,we got Tracking Id is UA-69988360-20, then go to the GTM settings.
First, create a constant to store the TrackingID. Click “Variables”——”New”——”Choose a variable type to begin set-up…”——”constant”:
The name is named Tracking ID, then copy the Tracking ID to value and save it。
The second step is to create a Google Analytics settings,Click “Variables”——”New”——”Choose a variable type to begin set-up…”——” Google Analytics settings”:
The name is named Google Analytics Settings ——Basic
Tracking ID: Click the icon on the right to select the variable you created earlier.
In the Field to set you need to do some necessary settings:
- forceSSL: If your website is http, then this must be configured. If your website is https, you don’t need it. The role of this is because Google’s servers are both https. http will send a 307 jump to https. , data may be lost, after setting, it will be forced to send to https before sending.
- SampleRate: If the website traffic is relatively large, then GA will sample the data collection, this role is set to not collect data collection.
- siteSpeedSampleRate: The page load time report is by default different sampling scales depending on the order of magnitude, here is set to not sample.
- Enable Display Advertising Features:Check this to get the data report of the user attribute, and also set it with the Property Setting.Will be used in the fourth step.
The final step is to create a tag,Click “Tags”——”New”——”Choose a tag type to begin set-up…”——” Google Analytics: Universal Analytics”:
- Named Basic Tracking.
- Track Type choose PageView
- Google Analytics setting choose Select the Google Analytics Settings created in the previous step – Google Analytics Settings ——Basic
- Triggers choose All Pages
Finally save the publish, you must click the publish in the upper right corner to save it.
4、Configure Google Analytics
We need to do some configuration in Google Analytics:
Property Settings
Industry Category: Select the corresponding industry category. There is a Benchmarking in Google Analytics based on this.
Advanced Settings: UTM will override the parameters of Adwords when it is turned on.
User Analysis:Provide the accuracy of Users.
View Settings
- Default Page: Automatically convert all home pages to index.html, avoiding the occurrence of / and index.html.
- Bot Filtering:Exclude all hits from known bots and spiders
Filters:
Even if the Bot Filtering is turned on, there will still be machine traffic, and we need to use filters to filters out your own traffic so you can remove machine traffic:
Only the host name is yours will enter this property, and others will be filtered out.
5、Test
In Google Analytics ,click “Admin”——”Tracking Info”——”Tracking code”——” send test traffic”:
Then return to the real-time report:
Seeing analytics_test indicates that the deployment was successful.