【问题标题】:Split A/B Testing拆分 A/B 测试
【发布时间】:2013-04-11 03:28:18
【问题描述】:

我有一个由 Weebly.com 托管的网站,但无法设置它以使用谷歌分析进行拆分测试。有3个附件:

 Shown in the attachment is my error notice.
 The second email shows how I input HTML into Weebly.
 The 3rd image is an email from Weebly telling me that this can be done but it is challenging. 
4th image is the Weebly editor where I can make html changes

如果有人能指导我如何让这个工作,我将非常感激!

【问题讨论】:

    标签: html google-analytics ab-testing


    【解决方案1】:

    我强烈建议您改用在您的 GA 代码上使用 prefix。理想情况下,Weebly 应该使用这个前缀,因为他们是供应商,但在这种情况下他们不是。

    就目前而言,您发生了以下情况:

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-28626443-1']);
    _gaq.push(['_trackPageview']);
    

    随后在页面上,Weebly 的 GA 代码被插入到页面上..

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-7870337-1']);
    _gaq.push(['_setDomainName', 'none']);
    _gaq.push(['_setAllowLinker', true]);
    _gaq.push(['_trackPageview']);
    

    您可以看到这将覆盖您的跟踪器并更改域名(从自动更改为无)。我建议用以下代码替换您的代码:

    var _gaq = _gaq || [];
    _gaq.push(['my._setAccount', 'UA-28626443-1']);
    _gaq.push(['my._trackPageview']);
    

    【讨论】:

      【解决方案2】:

      除此之外,还有两个(可能)必要的更改 b/c Weebly 会在您的页面上插入其自己的 GA 跟踪器。

      [1] 在您的 分析跟踪器代码中,您需要添加一个自定义域(在这种情况下,连同前缀一起)。所以就在之后你的

      _gaq.push(['my._setAccount', 'UA-12345678-0']); 
      

      添加以下内容: _gaq.push(['my._setDomainName', 'your-domain-name-whatever-it-is']);

      所以现在您的 GA 跟踪器代码应该以如下内容开头: 变种 _gaq = _gaq || []; _gaq.push(['my._setAccount', 'UA-12345678-0']); _gaq.push(['my._setDomainName', 'your-domain-name-whatever-it-is']); _gaq.push(['my._trackPageview']);

      注意:如果您告诉 Google 您实际上是在跟踪一个子域,那么 _setDomainName 就是 Google 会默认告诉您执行的操作。在这种情况下,您的 Weebly 网站(很可能)是 weebly.com 的子域,例如我的域名.weebly.com

      [2] 在您的内容实验 (CE) 代码中,您必须告诉 Google 使用这个“其他”域。否则,它使用默认域(似乎是 Weebly 的域)。

      为此,请查看您的 CE 代码。它的开头可能是这样的: 函数 utmx_section(){}函数 utmx(){}(function(){var k='12345678-0',d=文档,l=d.location,c=d.cookie; if(l.search.indexOf('utm_expid='+k)>0)return; 呸呸呸呸

      在注释之后和函数之前插入以下行: _udn = "你的域名-不管它是什么"

      所以现在您的 CE 代码如下所示:

      <!-- Google Analytics Content Experiment code -->
      <script>_udn = "your-domain-name-whatever-it-is"</script>
      <script>function utmx_section(){}function utmx(){}(function(){var
      k='12345678-0',d=document,l=d.location,c=d.cookie;
      if(l.search.indexOf('utm_expid='+k)>0)return;
      blah-blah-blah
      

      最后一点。 CE 代码仅出现在 AB 测试页面的“主要”或“A”版本上。通过转到 Weebly 的“A”版本 AB 测试页面的“高级设置”,将此代码放在页面的“标题”中。

      但是,CE 代码必须出现在您的分析跟踪器代码之前 Weebly 的跟踪器代码(为此很有帮助)位于每个页面的页脚中。因此,Weebly 的跟踪器代码不会干扰您的 AB 测试代码。但是,如果您使用站点设置将您的分析跟踪器代码放置到您的 Weebly 站点的每个页面上,那么您可能希望使用站点设置 FOOTER(为强调而大写)而不是标题。 Weebly 似乎将站点设置标题放在页面特定标题上方(前面)。内容实验会对此感到窒息。如果您真的希望您的 Analytics 跟踪器代码出现在每个页面的标题中(并且有一些原因与计算跳出次数等有关),那么您可能需要使用高级设置手动将跟踪器代码粘贴到每个页面标题上。当您进入 AB 测试页面的“A”版本时,只需记住在 CE 代码之后粘贴您的跟踪器代码。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2016-08-26
        • 1970-01-01
        • 1970-01-01
        • 2011-11-16
        • 2012-11-11
        • 2019-11-06
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多