google-analytics - 自定义广告系列跟踪跨域谷歌分析
问题描述
我已经使用 Google Analytics 成功实现了跨域跟踪(用户跨域跳转时的 1 个会话,两个域上的相同 _ga cookie 等)但是,当用户跳转到第二个域并完成购买时,电子商务交易不是从第一页归因于 utm 自定义活动。看来您无法跨域传递 utm 自定义活动信息。这是真的?有没有人遇到过这个?
解决方案
我发现了我的问题,缓存。我在每次测试之前都进行了硬刷新,但我进入了 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 密钥相同。
推荐阅读
- node.js - 嵌套邮政路由快递
- laravel - Laravel:重置密码无需验证即可获得 6 位数字
- php - mysqli_real_escape_string 是否可以进行 SQL 注入?
- javascript - 修改后保持原值
- ios - swift4:如何检查用户是否在点击标签栏项目之前登录
- group-policy - 计算机中的标准用户
- javascript - Html web worker 没有按预期工作
- angular - FormData 未进入 API 控制器的 Post 方法
- php - 带 GPS 路线的数据库
- google-app-maker - 在 Appmaker 中显示数据源总页数的最佳方式