谷歌网站优化器和子域跟踪
我正在使用 Google 的网站优化器设置 A/B 测试。
我有一个页面:
wwww.example.com/landingpage
和一些变化:
www.example.com/landingpage0
www.example.com/landingpage1
www.example.com/landingpage2
转换页面位于:
www.subdomain.example.com/goal
网站优化器的向导界面上,不接受目标页面,因为它位于“不同的域”上,显然无法继续下一步。 但是,如果我“伪造”该过程并指定
wwww.example.com/fakeGoalPage
向导将允许我继续设置。
接下来我要做的就是将目标页面代码放入我的真实目标页面中,并希望测试能够成功。 我的问题是这种做法是否正确,或者您是否可以建议我更好的方法来解决这个问题。
谢谢
I am setting up an A/B test with Google's website optimizer.
I have a page:
wwww.example.com/landingpage
and some variations:
www.example.com/landingpage0
www.example.com/landingpage1
www.example.com/landingpage2
the conversion page is on:
www.subdomain.example.com/goal
Website Optimizer's wizard interface, is not accepting the goal page because it's on "a different domain" and apparently there's no way to proceed with the next step.
However, if I "fake" the procedure, and specify
wwww.example.com/fakeGoalPage
the wizard will allow me to continue the set-up.
What I do next is to put the goal-page code in my real goal page, and hope that the test will work.
My question is if this practice is correct or if you can suggest me a better way to solve this problem..
Thank you
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
默认情况下,Google 网站优化工具在当前域 (
document.domain
) 上设置 cookie。因此,来自www.example.com
的 Cookie 在subdomain.example.com
上转换时将不可用。解决方案是按照此帮助中心的说明进行操作:自定义适用于多个子域的 Google 网站优化工具代码?基本上:
首先,在控制脚本之前添加以下行:
然后更改跟踪和转换脚本以允许跨域 cookie。
假设您使用异步语法,这意味着它位于
gwo._trackPageview
之前。(另一种方法是将您的目标设置为
example.com
上的 URL,创建该页面,然后将转换脚本放置为该页面上的唯一内容,并将其作为 iframe 包含在转换中页。)By default, Google Website Optimizer sets its cookies on the current domain (
document.domain
). So, the cookies fromwww.example.com
won't be available when they convert onsubdomain.example.com
. The solution to that is to follow the instructions from this help center: Customizing Google Website Optimizer code for multiple subdomains?Basically:
First, you add the following line just before your control script:
Then you change your tracking and conversion scripts to allow for cross domain cookies.
Assuming you're using the async syntax, that means this goes before the
gwo._trackPageview
.(An alternative is to set your goal as a URL on
example.com
, create that page, and then place the conversion script as the only thing on that page, and include it as an iframe on the conversion page.)