Is it possible to track hash links like pages with google analytics?

tracking anchor links in google analytics
google analytics fragment tracking
google analytics page title
google analytics default tracking
google analytics page type
google analytics active page
google analytics page views
google analytics change page url

Is it possible to track hash links like pages with google analytics?

For example, I want index.php/#1, index.php/#2, and index.php/#3 to all show up as individual page hits with individual time spent on page.

If there is no simple way of doing this, how can I add a track event to an onclick event with jquery? Can I still receive accurate time on "page" information this way?

Is it possible to track hash links like pages with google analytics , Generically, your code could look like this _gaq.push(['_trackPageview',location.​pathname + location.search + location.hash]);. You could  Before you can track Facebook likes and Unlikes in Google Analytics, you first need to capture them. You can capture these events by using a method called FB.Event.subscribe(). This method is used to subscribe to a Facebook event (like liking a page) and to define callback function:

Looks like this might be useful too: https://developers.google.com/analytics/devguides/collection/analyticsjs/single-page-applications

Very helpful with clear 'What to do' and 'What not to do'

javascript - track hash links like pages with google analytics, The hash is actually sent to Google Analytics (check the note). However it will not show up in your dashboard. To manually send a hash to  Creating each link with only one subdirectory like /blue-link and /pink-link and /red-button means you would have to search for each of those URLs manually -- boorrrrrring. Step 4 (OPTIONAL): Create a filter to exclude your new pageviews from your regular profile.

Google Analytics allows you to track custom events, for example AJAX page loads.

(The usual caveats apply when doing this - hopefully there are non-javascript ways to access the same data :)

How to track a URL which looks like xywz.com , I'm trying to figure out how I can track certain pages within a website, which open on click within a page with URL https://xywz.com/ and look like Is there a way to track them? If using Universal analytics.js, then from this: {'page': location.​pathname + location.search + location.hash}); Link to post. According to Google's Documentation on Page Tracking with Analytics.js, the send pageview command will magically read and track the new location given by pushState, as it will, in the moment the send pageview command is called, use the following values by default (though you can specify them):

Good question. To track the hash link, you must track an event or a pageview, for every link to this hash. For the pageView, a sample code is below

onclick="_gaq.push(['_trackPageview','/page/hashLink1']);"

Note: This method create a virtual page view that is summing up to the count of the pages of your site. If your site is a big html files with anchors (maybe there is a slider to this page), this method gives you an estimated of the interaction of the user with your "content"

Can google analytics track # (URL fragment) in url?, In Google Analytics, fragment changes are not tracked by default, and the URL The link above has some useful tips as to how to get fragment tracking working. Things like eBook downloads, contact form submissions, newsletter registrations, or purchases are all things that you can also track with Google Analytics. Every website is going to have different goals when it comes to conversions.

For new universal tracking this doesn't work anymore. You will have to go to https://developers.google.com/analytics/devguides/collection/analyticsjs/events and update to something like

ga('send', 'event', 'category', 'action', {'page': '/my-new-page'});

Is it possible to track hash links like pages with google analytics?, Is it possible to track hash links like pages with google analytics? For example, I want index.php/#1, index.php/#2, and index.php/#3 to all show up as individual  Originally published May 1st, 2017. Google Analytics can track link clicks but not without a little customization, first. Let us show you how. To track link clicks in Google Analytics you’ll need to set up custom events. There are a few ways though: Event tracking simply applies a hot element on the page and whenever a user clicks on that

Page Views | Analytics for Web (analytics.js), Modifying page URLs; Tracking virtual pageviews Note: if the anchor portion of the URL contains campaign parameters, those parameters get Note that as with all send commands, the fields passed in the convenience In some cases the URL you want to send to Google Analytics is different from the  By adding in the following code, we are telling Google Analytics to track the entire URL including the anchor tag and we can link users directly via an anchor and it will be added the the statistics. This however does not solve the issue of users clicking on the menu links that scrolls through various other content on the page.

#GTMtips: Track URL Fragments As Pageviews, Typically, they are used for anchor links, where following a link keeps you on In Google Analytics, fragment changes are not tracked by default, and can then send to Google Analytics as the page path of the URL fragment. Google Analytics does not track it by default, from what I understand, although I can't find actual GA documentation confirming this. In Google Analytics, fragment changes are not tracked by default, and the URL paths that are passed to GA with your Pageview hits are stripped of these fragments.

How To Track # Anchor Tags as URLs, If you have a one-page site or long-form content that needs anchor links like us to help with your site's tracking, Google Analytics or want to  Google Analytics lets you measure your advertising ROI as well as track your Flash, video, and social networking sites and applications. Google Analytics One account.

Comments
  • Are you building entire websites in a single page too? It's super user friendly and quick, I just love it!
  • @Dave i wouldn't exactly call it "super user friendly"...im using it on my website just because there is no other way with the way my website works
  • I thought Dave was being sarcastic, until I realized he asked the question :)
  • perfect! ... as long as it works (which it should). I'll give you my pick here in a couple hours when I see hits coming in. I actually have a slide event happen on hash changes so I slapped it in there without any plugins.
  • You can see how it sends to your account live in Chrome with this great Extension. It's made by the Google Analytics team. chrome.google.com/extensions/detail/…
  • Do you guys know how to do this with google analytics universal code?
  • @Yahel - Thanks for your reply! I am sorry, I should have explained more. Google universal analytics is currently plugged into GTM. Do you know how I can adjust this using Google Tag Manager?
  • This answer didn't make it clear if this was a "hack" or not, and the original way uses a bunch of underscore-prefixed stuff that's often a sign of unintentional use. But at least in the case of the new "Universal Analytics" snippet this is documented by Google: developers.google.com/analytics/devguides/collection/…
  • This is not what Custom Events are for. They are for non-page actions. If your site uses hash changes to do what normal page loads do, you should use virtual page views. Custom Events are for tracking things that don't fit the traditional pageview paradigm.