Forum Moderators: DixonJones

Message Too Old, No Replies

Cross Domain Tracking

         

Gemini23

12:08 pm on Feb 17, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi, I read with interest various posts on this but cannot seem to see a solution apart from users being sent to a GA page which shows various codes and no one being specific.

I am looking for cross domain tracking (one to a sub-domain)

ie.

website 1 www.abc.com (landing pages)
website 2 www.abc.sales.co.uk (sales completion page is on here)

Any suggestions greatly appreciated as to exactly which code to use.. and also which profile to use as I have a separate profile set up for each of the above and they have a separate code number.

Thanks in anticipation... has anyone resolved this?

still

1:40 am on Feb 18, 2011 (gmt 0)



Assuming users can move back between website1 and website2...

Website1 tracker:

<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-3026#*$!-1']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);

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

any link pointing to website2 should look like this...
<a href="http://www.abc.sales.co.uk/"
onclick="_gaq.push(['_link', 'http://www.abc.sales.co.uk/']);">click me</a>

Website2 tracker:

<script type="text/javascript">

var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-3026#*$!-1']);
_gaq.push(['_setDomainName', 'none']);
_gaq.push(['_setAllowLinker', true]);
_gaq.push(['_trackPageview']);

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

any link pointing to website1 should look like this...
<a href="http://www.abc.com/"
onclick="_gaq.push(['_link', 'http://www.abc.com/']);">click me</a>

Lastly, set up the following filter to insert domain within the URI otherwise you can't distinguish between www.abc.com/help.html and www.abc.sales.co.uk/help.html in Analytics...

"In the Profile Settings page, click the Add Filter link.Choose Add New Filter and provide the filter a name.Choose Custom Filter and select Advanced on the Filter type settings.Under Advanced settings: FieldA should be set to HostnameFieldB should be set to Request URI Set the values for both Field A and Field B to (.*), which is an expression that captures all characters.Set the Output To --> Constructor option to Request URI and provide $A1$B1 as the value for that choice.to be able to attach the domain mane to your URIs" (pasted from [google.com...] )

still

1:42 am on Feb 18, 2011 (gmt 0)



the setAccount should be the same with your main UA number.