Google Site Optimizer not tracking cross-domain conversions

柔情痞子 提交于 2019-12-13 07:17:27

问题


I've set up three GWO multivariate tests across two domains. I've got the landing page set up correctly, and it's tracking visitors for all three tests, but conversions aren't being recorded for any of them. I've followed the instructions Google provides for cross-domain tracking, but still no dice.

Here's the landing page snippet (IDs removed):

<script>
    // Allows for multiple-domain tracking
    _udn = "none";
</script>
<!-- Google Website Optimizer Control Script -->
<script>
    function utmx_section(){}function utmx(){}
    (function(){var k='xxxxxxxxxx',d=document,l=d.location,c=d.cookie;function f(n){
    if(c){var i=c.indexOf(n+'=');if(i>-1){var j=c.indexOf(';',i);return escape(c.substring(i+n.
    length+1,j<0?c.length:j))}}}var x=f('__utmx'),xx=f('__utmxx'),h=l.hash;
    d.write('<sc'+'ript src="'+
    'http'+(l.protocol=='https:'?'s://ssl':'://www')+'.google-analytics.com'
    +'/siteopt.js?v=1&utmxkey='+k+'&utmx='+(x?x:'')+'&utmxx='+(xx?xx:'')+'&utmxtime='
    +new Date().valueOf()+(h?'&utmxhash='+escape(h.substr(1)):'')+
    '" type="text/javascript" charset="utf-8"></sc'+'ript>')})();
</script>
<!-- End of Google Website Optimizer Control Script -->
<!-- Google Website Optimizer Tracking Script -->
<script>
    var _gaq = _gaq || [];
    _gaq.push(['gwo._setAccount', 'UA-xxxxxxxx-x']);
    _gaq.push(['gwo._setDomainName', 'none']);
    _gaq.push(['gwo._setAllowLinker', 'true']);
    _gaq.push(['gwo._trackPageview', '/xxxxxxxxxx/test']);
    (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
</script>
<!-- End of Google Website Optimizer Tracking Script -->

And here's the conversion page snippet:

<!-- Google Website Optimizer Conversion Script -->
<script>
    var _gaq = _gaq || [];
    _gaq.push(['gwo._setAccount', 'UA-xxxxxxxx-x']);
    _gaq.push(['gwo._setDomainName', 'none']);
    _gaq.push(['gwo._setAllowLinker', true]);
    _gaq.push(['gwo._trackPageview', '/xxxxxxxxxx/goal']);
    (function() {
        var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
        ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
        var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
    })();
</script>
<!-- end of Google Website Optimizer Conversion Script -->

A few gotchas:

  • The conversion script snippet is in the footer, before the closing </body> tag. This is due to the way the site is built.
  • The URL of the conversion page is variable, depending on how a visitor proceeds through the funnel that precedes it.
  • Both the landing page & the conversion page have the Google Analytics snippet inserted after the GWO snippet (though in one case, there is no Analytics snippet on the conversion page).

回答1:


From reading the code of the siteopt.js code GWO loads to assign test combinations to users, it seems the _udn variable doesn't support 'none', but only the actual value the cookie domain should be scoped to. Try setting it to whatever the domain used by the page that has the GWO code on it instead (i e 'my.domain.com' instead of 'none').




回答2:


In your landing page snippet you have: _gaq.push(['gwo._setAllowLinker', 'true']);

If you take a look at Google documentation you will find out that the correct way to enable the linker is: _gaq.push(['gwo._setAllowLinker', true]); // TRUE is not eclosed in apostrophes

Hope this helps.



来源:https://stackoverflow.com/questions/9587030/google-site-optimizer-not-tracking-cross-domain-conversions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!