: Google Analytics track url hash fragment identifier 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
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 example.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?
More posts by @Cofer257
1 Comments
Sorted by latest first Latest Oldest Best
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.