首页 > 解决方案 > 自定义广告系列跟踪跨域谷歌分析

问题描述

我已经使用 Google Analytics 成功实现了跨域跟踪(用户跨域跳转时的 1 个会话,两个域上的相同 _ga cookie 等)但是,当用户跳转到第二个域并完成购买时,电子商务交易不是从第一页归因于 utm 自定义活动。看来您无法跨域传递 utm 自定义活动信息。这是真的?有没有人遇到过这个?

标签: google-analyticscross-domainanalyticsgoogle-tag-manageranalytics.js

解决方案


我发现了我的问题,缓存。我在每次测试之前都进行了硬刷新,但我进入了 Chrome 工具并清除了所有内容。Cookie、缓存,应有尽有。自定义广告系列的跨域跟踪开始工作!以下是两个站点的脚本供参考:

Site 1:

ga('create','UA-xxxxxxx-x'','auto', { 'allowLinker': true });
ga('require', 'linker');
ga('linker:autoLink', ['site2.com']);
ga('require','ecommerce','ecommerce.js');
ga('send','pageview');

Site2:

ga('create', 'UA-xxxxxxx-x', 'auto', { 'name': 'client', 'allowLinker': true });
ga('client.require', 'linker');
ga('client.linker:autoLink', ['site1.com']);
ga('client.require', 'ecommerce', 'ecommerce.js');
ga('client.send', 'pageview');

另外,我将 site1.com 和 site2.com 添加到 GA 的推荐排除列表中,并且站点 1 和站点 2 的 UA 密钥相同。


推荐阅读