Mobile app version of vmapp.org
Login or Join
Sent6035632

: Google Analytics: How to keep word after # in URL? ex: /brands#my-brandname I'm having an issue where the Active Pages section only shows the path and not the term that appears after the #

@Sent6035632

Posted in: #GoogleAnalytics

I'm having an issue where the Active Pages section only shows the path and not the term that appears after the # (ex: mysite.com/brands#my-brandname shows up as mysite.com/brands). Is there a setting in the javascript for GA to log the # and everything after it?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Sent6035632

1 Comments

Sorted by latest first Latest Oldest Best

 

@Megan663

You would have to include the hash portion in your pageviews like this:

_gaq.push(['_trackPageview', location.pathname + location.search + location.hash]);


if you are using classic GA, or like this if you are using Universal Analytics:

ga('send', 'pageview', {'page': location.pathname + location.search + location.hash});

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme