Rank: Guest
Groups: Guest
Joined: 9/17/2008(UTC) Posts: 66
|
Sometimes you would like to track outbound clicks on a website. This is called tracking events. To track events we need to add additional code in the outgoing <a href>. But first we need to add some additional Google script to our <head> section (under the normal tracking code). Paste this code under the main GA tracking code: Code:<script type="text/javascript">
function trackOutboundLink(link, category, action) {
try {
_gaq.push(['_trackEvent', category , action]);
} catch(err){}
setTimeout(function() {
document.location.href = link.href;
}, 100);
}
</script>
Then add in each outbound link you want to track the next onclick function. Code:<a href="www.test.com" onClick="trackOutboundLink(this, '{Category}', '{Title}'); return false;">test</a>
For category you can use terms like outbound click or something; the title describes de link for example the name of the url you are going to link to. In Google Analytics you will see the outbound links in the 'Events' report.
|
|
|
|
Rank: Guest
Groups: Guest
Joined: 9/17/2008(UTC) Posts: 66
|
if this function doesn't work: Code:<a href="www.test.com" onClick="trackOutboundLink(this, '{Category}', '{Title}'); return false;">test</a>
you might try Code:<a href="www.test.com" onClick="recordOutboundLink(this, '{Category}', '{Title}'); return false;">test</a>
|
|
|
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.
Important Information:
The Sienn Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close