Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using onclick="parent.location='#'" to make a table into a link, but will Google Analytics see this as a link or will it cause mayhem in the reports?

share|improve this question

migrated from stackoverflow.com Nov 7 '11 at 10:20

This question came from our site for professional and enthusiast programmers.

If the link is internal to your site, yes Google will track it, because the target page should contain the tracking script as well.

If the link is external, then no. You need to call:

pageTracker._trackPageview('...your url...');

then direct the user to the new page.

share|improve this answer

From the server's perspective there is no difference between an actual link being clicked and a request sent by JavaScript. Both are HTTP requests. I'd assume that Google Analytics counts them.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.