Google Tag Manager Practical Guide:Subdomain Tracking | BCS Google Tag Manager Practical Guide:Subdomain Tracking | BCSBCS

Google Tag Manager Practical Guide:Subdomain Tracking

Google Tag Manager BCS 5 years ago (2019-11-02) 3031 Views 1 Comments

If you use the universal tracking code——analytics.js, which has include subdomain tracking turned on by default, you can use the tracking code directly, but you also need to configure something in Google Analytics, The following picture is the universal  tracking code:

Google Tag Manager Practical Guide:Subdomain Tracking

The auto inside means that the cookie is automatically generated under the top-level domain, that is, the two sub-domains will share the cookies in the same top-level domain. For example, if your website address is blog.bbbccss.com,  analytics.js will set the cookie domain to bbccss.com,another website is new.bbccss.com, analytics .js will set the cookie domain to .bbccss.com, So if different subdomains deploy the same piece of tracking code, they use the same cookie, allows hits from all subdomains to share the same first-party cookie,

 

If you use the recommended JavaScript snippet that Google Analytics provides you, this is already set for you,We don’t need to make changes to the Google Analytics tracking code to use it directly:

Google Tag Manager Practical Guide:Subdomain Tracking

If you are in Google Tag Manager, you need to do some configuration:

Google Tag Manager Practical Guide:Subdomain Tracking

 

You can also use Google Analytics settings, which are enabled by default:

Google Tag Manager Practical Guide:Subdomain Tracking

 

We  still  need to do some configuration in Google Analytics,In Google Analytics,Select “Admin” → “Tracking Info” → “Exclude Referral List” → “Add Referral List” ,and ensure that all domains added to the Exclude Referral List.

Google Tag Manager Practical Guide:Subdomain Tracking

 

When a user jumps from one domain name to another, it will send a referral to Google Analytics. If it is different from its own website, it will generate a new session. The Exclude Referral List is to prevent the creation of a new session. After this setting, the user will not generate a new session when jumping in a different subdomain. What happens if there is no setting?

Take a look at the following example:

CookieDomain (Which means is set as auto)and referral traffic are not set: 2 users, 3 sessions will be recorded
If the cookie domain is set but the referral traffic is not set,:1 user, 3 sessions will be recorded.
If the cookie domain and referral traffic are both set,:1 user, 1 session will be recorded.

Therefore, subdomain configuration must be configured to exclude referral lists.

 


If you don't understand, You can leave a comment below.
Like (2)
Post my comment
Cancel comment
Expression Bold Strikethrough Center Italic

Hi, you need to fill in your nickname and email!

  • Nickname (required)
  • Email (required)
  • Website
(1) friends in the comments
  1. H
    h2019-11-02 18:28 Reply Mac OS X | Safari浏览器 604.1