目前有 100 位成員在線上
目前有 100 位成員在線上
GA提供許多進階設定幫助您進一步瞭解數據,您可以在這裏提問並且得到專家分析
使用指南
star_border
回覆

【转帖】用Google Tag Manager来管理Google Analytics的跨域跟踪

[ 已編輯 ]
專家 ✭ ✭ ✭
# 1
專家 ✭ ✭ ✭

看到一篇文章,对于对Google Analytics的安装执行不太熟悉的人(比如我)来说是一个非常棒的关于跨域跟踪教程,分享给大家(比较长,暂没时间翻译...):

原文地址:http://www.lunametrics.com/blog/2013/12/24/cross-domain-tracking-tag-manager

 

Cross-domain tracking has been the bane of any analyst’s experience for, oh, just about ever. It is probably the hardest thing to get right in a Google Analytics implementation, and in our experience, more people ask us for help with this one issue than any other.

Over the years we’ve dealt with this problem in different ways. jQuery made it easy to drop in a couple lines of code to track behavior across domains, but even then it wasn’t exactlyautomatic.

Then along came Universal Analytics and Google Tag Manager – the perfect 1-2 punch combo to knock out cross domain tracking once and for all. We held a webinar to show people step-by-step how to implement cross-domain tracking in Google Tag Manager. Below is a recording of the webinar, along with the written step-by-step instructions.


*NOTE: Since the webinar, there have been some updates to Google Tag Manager and Universal Analytics that make cross domain tracking even easier and more intuitive. If you follow the directions in the webinar, it will still work. But the written instructions below are up to date with the newest features.

 

Step-By-Step Instructions – Universal Analytics

The following instructions will guide you to setting up cross-domain tracking through Google Tag Manager with Universal Analytics.

Create the following macros

1. uaid

uaid

* For the value, replace the Xs and Yx above with your UA number.

2. cross domains

cross domains macro

3. element url (if you don’t already have it)

element url

 

Tagging cross-domain links

Create a tag for your Universal Analtyics tracker (I recommend naming it Google Analytics – Universal). The Track Type for this tag should be Page View. If you already have a tag for Universal Analytics, modify it to match the following settings:

1. For Tracking ID, use your uaid macro

tracking id

2. Under More Settings > Cookie Configuration, set the value of Cookie Domain to auto.

auto cookie domain

3. Under More Settings > Cross Domain Tracking, set the value of Auto Link Domains to your cross domains macro, and set the Allow Linker drop down menu to True.

auto link domains

* This step has changed since the webinar was recorded. You used to have to go into Fields to Set, and add a Field Name of allowLink with a value of true. Now you can just use the drop down menu pictured above.

 

4. Set the firing rule for this tag to All pages.

all pages

 

 

Tagging cross-domain forms

1. Create tag – name it Form Submit

form submit

 

2. Create tag – name it Cross-Domain – Forms

A. Create a copy of your Google Analytics – Universal tag. To do this, click on your Google Analytics – Universal tag and scroll to the bottom. In the lower right corner, click on the Copy this tag button.

B. Name your new copy Cross-Domain – Forms.

C. Change the Track Type to Decorate Form.

decorate form

 

D. Remove the All pages rule and add the following 2 rules (which you will need to create):

i. On Form Submit to siteA.com

form submit rule 1

ii. On Form Submit to siteB.com

form submit rule 2

 

Update web property settings

Go into your Google Analytics Admin settings. Under Property Settings, Tracking Info > Referral Exclusion List, add both sites (if not already added).

referral exclusions

1 專家回覆verified_user

回應: 【转帖】用Google Tag Manager来管理Google Analytics的跨域跟踪

解答王
# 2
解答王
溫習一下
參與該主題的專家
Fay_Lo