Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

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
add comment

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

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

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

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