Great community. Great ideas.

Welcome to SEOChat, a community dedicated to helping beginners and professionals alike in improving their Search Engine Optimization knowledge.  Sign up today to gain access to the combined insight of tens of thousands of members.

Thread: Need to Track Cross Domains In Goggle Analytics

Results 1 to 10 of 10
Share This Thread →
  1. #1
    alexford is offline Contributing User SEO Chat Explorer (0 - 99 posts)
    Join Date
    May 2011
    Posts
    47
    Rep Power
    3

    Need to Track Cross Domains In Goggle Analytics

    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.

  2. #2
    alexford is offline Contributing User SEO Chat Explorer (0 - 99 posts)
    Join Date
    May 2011
    Posts
    47
    Rep Power
    3

    re

    Any help friends..!! please

  3. #3
    alexford is offline Contributing User SEO Chat Explorer (0 - 99 posts)
    Join Date
    May 2011
    Posts
    47
    Rep Power
    3

    re

    Hi guys

    Any help on this issue.

  4. #4
    SD_Analytics is offline Registered User SEO Chat Explorer (0 - 99 posts)
    Join Date
    May 2012
    Posts
    3
    Rep Power
    0
    Hi Alex,

    I can help with your cross domain tracking issues. Couple of things I notice off the bat:

    1) you have the right idea, but the order the variables are called is incorrect. It should look like this:

    _gaq.push(['_setAccount', 'UA-XXXXXX-1']);
    _gaq.push(['_setDomainName', 'none']);
    _gaq.push(['_setAllowLinker', true]);
    _gaq.push(['_trackPageview']);

    If _setDomainName isn't called first, there is no information to be passed through _setAllowLinker. Also, since you are tracking totally different domains, you want to have the parameter set to "none" in most cases.

    2) You do not need the line of script that reads (['_link', (exampleURL)]), as the _link or _linkbypost method is to be used in URLs that reference the second domain.

    3) Your code on the second domain should be the same as the code on your abc.com domain in this case, so once you update that code, it can be blanketed across all pages of both domains.

    4)Not sure how your site works, but if a visitor can go from xyz.com to abc.com (*backwards, essentially) you should also have the _setDomainName and _setAllowLinker variables as well. You want all of the cookie data to be transferred between both, regardless of which domain they went to first.

    5) The _link (or _linkbypost if you use a form) is to be used in URLs between the domains, and you have the right idea listed in your post. Just make sure you include the onclick="_gaq.push(['_link', '(example URL)]); return false;" in all of your URLs to the second domain.

    This should get you off to a good start. I'm happy to check back and see how it turns out if you'll post an update!

    SC

  5. #5
    alexford is offline Contributing User SEO Chat Explorer (0 - 99 posts)
    Join Date
    May 2011
    Posts
    47
    Rep Power
    3

    re

    Hi SC

    Thanks a lot for this, definitely i will try and implement the codes with these changes and hope will resolve the problem.
    Will get back to you after the test.

    Many thanks for this

  6. #6
    alexford is offline Contributing User SEO Chat Explorer (0 - 99 posts)
    Join Date
    May 2011
    Posts
    47
    Rep Power
    3

    re

    Hi SC
    hope you doing well, i setup the codes as discussed but still not able to see any results.

    Actually i put the codes on new test pages to check if it works because previously my few days data did not appeared in analytics due to faulty codes(to avoid this i created test pages on both sites)

    1.) i blocked these test pages in robots and put no index. Is this the problem? (i don't think it will be. google can show the results of blocked pages too in anlytics) -

    2.) Somebody in google forums mentioned that you have to put same UA on both domains - This i could not able to understand. (http : // productforums.google{dot}com/forum/#!topic/analytics/FBs2CrRzJAM)

    3.) On click from one site to other am seeing something like this in url ""utma=1.277307450.1293964347.1295598925.129560144 9.36&__utmb=1.2.10.1295601449&__utmc=1&__utmx=-&__utmz=1.1295340219.2"" -- Which is fine i guess and it is via google.


    Also lastly after this will be fine then i need to set advance filter in analytics. Need little help on this too- on what parameter should i set advance filter.

    """"
    FOR ADVANCE FILTER :---
    To see the domain names in your reports, create an Advanced filter for your profile with the following settings:

    Filter Type : Custom filter > Advanced
    Field A : Hostname Extract A : (.*)
    Field B : Request URI
    Extract B : (.*)
    Output To : Request URI
    Constructor : $A1$B1
    """""""

    Thanks in advance -
    WILL BE HIGHLY THANKUFUL

    Alex

  7. #7
    SD_Analytics is offline Registered User SEO Chat Explorer (0 - 99 posts)
    Join Date
    May 2012
    Posts
    3
    Rep Power
    0
    Hi Alex.

    To answer your questions...
    1) no that is not a problem, google analytics will still track the pages, they simply will not be indexed when your site is crawled.

    2) Yes, if you want to track the two domains as one you will need to use the same UA number on both sites--which i recommend doing. *there are filters and profiles you can use to separate them in the interface if you so choose

    3) This is GREAT! that means that the cookies are being passed between the domains. the utma, utmb, etc are all google analytics cookies.

    4) your advanced filter is necessary if you are using the same UA codes on both sites and want to append the domain name to your pages in the analytics interface.
    example:
    abc.com/productid instead of just /productid

    also, you can literally just copy that filter *which i assume you got from the GA help forums/conversion university* and it will take care of appending the domain names for you.


    Since you arent seeing any results, yet are still seeing the cookies passed between domains, I'm curious if you could expand a bit more about how its "not working"?

    Still happy to help!

    SC

  8. #8
    alexford is offline Contributing User SEO Chat Explorer (0 - 99 posts)
    Join Date
    May 2011
    Posts
    47
    Rep Power
    3

    Stucked Again

    Hi SD
    It been great for all your support but still am not able to track.

    This is my dummy page on domain 1 - http://bit.ly/MpaQcr

    And the domiain 2 url is on "BUY NOW" button
    Seeing the utma utmb (google analytics cookies).

    This is all about the analytics codes, i kept domain2 UA common for both domains.

    Next i set advance filter on domain 2 as:
    Field A -> Extract A Hostname - .domain2
    Field B-> Request Url - .domain1
    Output constructor - request url - $A1$B1

    And check "yes" to other radio buttons in GA

    Did you find some error?

    Will be great to see your support.
    Thanks In advance

  9. #9
    alexford is offline Contributing User SEO Chat Explorer (0 - 99 posts)
    Join Date
    May 2011
    Posts
    47
    Rep Power
    3

    re

    Hey

    Looking forward. any suggestions please.

  10. #10
    SD_Analytics is offline Registered User SEO Chat Explorer (0 - 99 posts)
    Join Date
    May 2012
    Posts
    3
    Rep Power
    0

    Code looks good

    Hi Alex,

    I'm not sure what you're looking for assistance with now, as your main post was regarding cross domain tracking and the cookies are passing (utma etc when you click buy now.) Can you be specific as to what you're not seeing? Everything i read here/see on your site indicates the code is performing.

    Also, the filter you have mentioned is only for the interface, it helps you differentiate between the different domains' pages. As i mentioned, you can copy the filter you have already.

    If you go to Google's Conversion University, there is a presentation that explains this filter as well under "Domains and Subdomains"

    Please be specific about what you need and i will be happy to help.

    SC

Share This Thread →

Become Part of This Conversation

Join NowFor Free!

Similar Threads

  1. Google Analytics and two domains
    By furma in forum Analytics Analysis
    Replies: 2
    Last Post: Feb 13th, 2011, 09:30 AM
  2. Google Analytics and two domains
    By furma in forum Google Optimization
    Replies: 0
    Last Post: Sep 30th, 2006, 09:09 AM
  3. Video-Game Analytics Track Players' Behavior (TechWeb)
    By RSS_News_User in forum Technology News
    Replies: 0
    Last Post: Sep 11th, 2006, 03:04 AM
  4. Video-Game Analytics Track Players' Behavior (TechWeb)
    By RSS_News_User in forum Technology News
    Replies: 0
    Last Post: Sep 9th, 2006, 03:03 AM
  5. Google Analytics
    By jason_sot in forum Google Optimization
    Replies: 2
    Last Post: Nov 15th, 2005, 03:03 PM

SEO Chat Advertisers and Affiliates