External link tracking when opening the link in a new window in Google Analytics?

Posted by evanmcd on Pro Webmasters See other posts from Pro Webmasters or by evanmcd
Published on 2011-01-13T22:14:53Z Indexed on 2011/01/13 22:58 UTC
Read the original article Hit count: 163

Filed under:

OK, so this seems like a really simply problem, but I have yet to find a solution that accomplishes the following:

  1. Opens the link in a new window
  2. Tracks the event in GA (obviously)
  3. Doesn't trigger pop-up blockers (uses target="_blank" instead of window.open)

Most of the code I've seen, including Google's, doesn't take into account the case of opening in a new window - they just window location.href.

Even GAAddons (http://gaaddons.com/), which charges for commercial use, doesn't seem to work for me.

Perhaps, I'm missing something simple - I'd be relieved if so and would thank profusely whoever points it out to me!

If no one is able to provide an example, I'll post some of the test cases I've created to illustrate the problem.

Thanks.

© Pro Webmasters or respective owner

Related posts about google-analytics