views:

36

answers:

1

Hi Guys,

I'm using event tracking to monitor external links, but I'm wondering if the tracking will be done before the link is fired. I'm using the onclick:

 onclick="_gaq.push(['_trackEvent', 'Banners', 'Clicks', 'Banner Name (ID: 101)']);"

Any ideas, or better ones if that's a bad way?! Thanks!

Darren.

+2  A: 

Your implementation is fine, and it's exactly how Google recommends.

but I'm wondering if the tracking will be done before the link is fired. I'm using the onclick

the event won't be tracked until the user clicks the link, once they do that it's a race between the event tracking and next page load starting. Usually your event will be tracked, but sometimes it is not. There are two mostly similar methods to avoid the race condition:

  1. Google's recommendation.
  2. My recommendation.

Both help articles don't really address the async option, but it doesn't take much changing.

Erik Vold
Decided to just port it over to Google DFP.
dazhall