Skip to content

Instantly share code, notes, and snippets.

@benjohnson77
Created October 15, 2012 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save benjohnson77/3893806 to your computer and use it in GitHub Desktop.
Save benjohnson77/3893806 to your computer and use it in GitHub Desktop.
ga for multiple domain landing pages
This should go at the top of the landing page!!!
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-648272-12']);
_gaq.push(['_setDomainName', 'investingchannel.com']);
_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>
this is how a link should look.
<a style="color: #000000; text-decoration: none;"
onclick="_gaq.push(['_link', this.href ]);return false;"
href="http://marketplace.investingchannel.com/marketplace/add/36?redirect_to=http%3A%2F%2Fmarketplace.investingchannel.com%2Fmarketplace%2Fstart_checkout%3Fclient_id%3DZyE1khdRPgkJAa4xYbVLIA%26code%3D%26source%3D%26f14dt_COP_A000000031aff_id%3D0">
Join Us Now... (for the next two weeks - FREE)
</a>
The important part is the onClick function
<a href="http://www.3rdpartycheckout.com/checkout.html" onclick="_gaq.push(['_link', this.href]);return false;">Checkout Now!</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment