Need to Track Cross Domains In Goggle Analytics

Discussion in 'Google Analytics' started by alexford, May 29, 2012.

  1. #1
    Hi Friends
    I am in little trouble regarding Google analytics tracking for cross domains.
    Say i have a domain name www.abc.net but the goal conversion is on other domain say www.xyz.com (means visitor on abc.com has checkout on xyz.com)

    Now i have made some changes in analytics code on both domains but now am not able to see even the no. of visits to abc.com. This is what i did:
    I added the following code in analytics code: _gaq.push(['_setAllowLinker', true]); -- ok
    _gaq.push(['_setDomainName', '.abc.com']); -- ok
    _gaq.push(['_link', http://www.abc.com/]); --(not sure about this)


    So this is how my new code look like:

    <script type="text/javascript">

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-2XXX39-1']);
    _gaq.push(['_setAllowLinker', true]);
    _gaq.push(['_setDomainName', '.abc.com']);
    _gaq.push(['_trackPageview']);
    _gaq.push(['_link', http://www.abc.com/]);


    (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>


    And on the other domain xyz.com when a visitor comes from abc.com. Then the analytics code of view cart page looks like

    <script type="text/javascript">

    var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-26XXX2-3']);
    _gaq.push(['_setAllowLinker', true]);
    _gaq.push(['_setDomainName', 'none']);

    _gaq.push(['_trackPageview']);
    _gaq.push(['_link', http://www.abc.com/buy-abc]);


    (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>

    Otherwise the code on xyz.com is simple(if visitor directly comes to xyz.com) : var _gaq = _gaq || [];
    _gaq.push(['_setAccount', 'UA-26XXX2-3']);

    _gaq.push(['_trackPageview']);

    I have done these changes but now google analytics is showing 0 visits from last three days on abc.com

    Also to my knowledge we need link() method, something like this.
    <a href="http://www.example.com/checkout.html" onclick="_gaq.push(['_link', this.href]);return false;">Checkout Now!</a> (ref.)

    Not sure how to use this.

    Can anyone please help on this, how will i able to track the domains. I need to see by which keywords the visitors are coming on xyz.com from abc.com.
    Earlier i can only see all the traffic as referral. Now i need a solution for this.

    Thanks in advance.
     
    alexford, May 29, 2012 IP
  2. alexford

    alexford Greenhorn

    Messages:
    40
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    Any help friends
     
    alexford, May 30, 2012 IP
  3. casand

    casand Peon

    Messages:
    268
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you can do it but cut , copying and pasting
     
    casand, Jun 1, 2012 IP