문제

I have a webshop where users come from many different other sites and newsletters. To track where the people came from, we use campaigns in Google Analytics. Now we are implementing our own external payment site.

After a user places an order, they will be redirected to our payment site. After a succesfull payment, they should be redirected back to the original site. On the original site the ecommerce values will be fired into Google Analytics.

When I do this like I described above, I lost the campaign when insterting the ecommerce data. How do I make sure this information isn't lost?

[edit]
I found adding 'utm_nooverride' should to the trick. However, I can't find it clearly in the Google Analytics documentation

도움이 되었습니까?

해결책

To solve the above:

On both sites (yes, the payment site should have a GA too), you need to set _setAllowLinker to true, and the _setDomainName to 'none'.

IE:

<script type="text/javascript">

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

    _gaq.push(['_setAllowLinker', true]);
    _gaq.push(['_setDomainName', 'none']);

    (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>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top