3.2.4, Google Tag Manager practical guide - cross-site tracking

In the actual process, sometimes it requires multiple sites as a site to site to assess traffic conditions, such as between the shell station and the main station of the same product using different domain names for different regions, or, which requires the site to do cross-domain track.

The principle: Each site corresponds to a GTM container, each site in GTM are doing the same configuration, different sites will send data to the same media resource GA, code allowLinker CookieDomain is to identify and solve problems in different sites of the same user , across the user station when the user uniquely identifies the common clientid transmitted to another site, so as to solve the problem of cross-site unique users, the specific configuration illustrated in FIG. 3-44, FIG. 3-45:

 

Figure 3-44 overall principle

 

 

 

Figure 3-45 GTM principles set

 

 

Web-A, Web-B, respectively, and Web-C cross-site required site, GTM-A, GTM-B, respectively, and GTM-C corresponding GTM containers,

Detailed setup process:

1, the constant setting

The track ID is set to a constant, the format ID to track the UA -, select the "variable" ** in the GTM → "New" → "to select the type of a variable to starting" → "constant", - ****** The detailed configuration as shown in Figure 3-46:

 

Figure 3-46 trace ID is set to a constant

 

 

You would need to cross-site domain names separated by commas another constant Cross Domain, a plurality of sites, such as cross-site and the need to select the GTM in the "Variables" → "New" → "to select the type of a variable to begin settings "→" constant ", if the site , require cross station, the specific configuration shown in FIG. 3-47:

 

Figure 3-47 Set Top Level Domain

 

 

As the direct use of similar top-level domain, it will automatically include the two domain names, such as and .

2, code configuration:

设置代码,重点在代码的设置,CookieDomain是生成Cookie在域名的哪个层级下面,默认值是auto,表示在顶级域名下;allowLinker是传递用户唯一标示符。

注意:跟踪器一定要设置跟原来单站不同的,确保跨站传输数据一致。

为了方便演示配置信息,下面采用不使用Google分析设置变量的方式去设置跨站,配置如图3-48所示:

 

图3-48 跨域跟踪代码设置

 

 

跟踪ID用的是前面设置的常量Property,这里的作用是将数据向指定的媒体资源发送。

allowLinker是用户唯一性识别的

CookieDomain是将用户的Cookie生成在顶级域名下面,由于这里用跨域,所以这里是生成在自动链接网域层级下。

自动链接网域是前面设置的常量,这里是虚拟一个顶级域名,

跟踪器名称,这个随意命名就可以,这个的作用是在向多个媒体资源发送发送数据的时候需要用不同的跟踪器,确保不同媒体资源的数据的准确性。

同理将需要跨站的站点每个都如上配置即可。

Guess you like

Origin www.cnblogs.com/ichdata/p/11721295.html