Johnny86
Johnny86

Reputation: 67

Google Analytics cross domain tracking

I am trying to set up Cros domain tracking from

www.able-labels.co.uk to ablelabels.netprintmanager.com

Someone has set up this code for it to work but I think there maybe some incorrect syntax in the link code as when I implement it I get duplicate " and it becomes broken.

<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js'type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-xxxxxx-x");
pageTracker._trackPageview();
} catch(err) {}
</script>
3. Amend all the links between domains. Here is an example: 
<a href="http://www.yoursite.co.uk"onclick="pageTracker._link(http://www.yoursite.co.uk);return false;">Link Here</a>

If anyone can see any stupid mistakes and help me out that would be great.

Many thanks

EDIT

Just realised that the copy and paste changed the " to a different one.

Waiting for GA to update to see if it is tracking

Upvotes: 0

Views: 246

Answers (1)

Open SEO
Open SEO

Reputation: 1712

Try Link Here It would be a good start (have a space before onclick, put the URL between quotes or refer the actual url of the link)

Upvotes: 0

Related Questions