Mobile app version of vmapp.org
Login or Join
Cofer257

: 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

@Cofer257

Posted in: #GoogleAnalytics #GoogleSearchConsole #Hash

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Cofer257

1 Comments

Sorted by latest first Latest Oldest Best

 

@Martha676

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme