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 have a few pages on a website where some sections use a JavaScript slider to display content and I was wondering if it's possible for Google Analytics to track those sections?

For now when a section is clicked on the URL changes to www.mysite.com/example.html#/example-section

I'm trying to figure out a way I can track those sections with Analytics as well as have Google properly crawl them, any suggestions?

share|improve this question
add comment

1 Answer 1

Since the sections are revealed by JavaScript, you can use the pageTracker in Google Analytics to manually log a hit. For example:

// Log this usage in Google Analytics.
pageTracker._trackPageview('/slider-page/part1');

Add that to the JavaScript which triggers the change in the page. The parameter given to the trackPageview method will be used as the path of the page in the content lists in Google Analytics, so be sure to use a different one for each section.

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.