Tracking the Hash URL:
Just update your universal analytics code, replace by following code:
ga(‘create’, ‘UA-22584058-1’, ‘auto’);
ga(‘send’, ‘pageview’);
to
ga(‘create’, ‘UA-22584058-1’, {‘allowAnchor’: true});
ga(‘send’, ‘pageview’, { ‘page’: location.pathname + location.search + location.hash});
After setup this code you can easily track the hash URL in your analytics Like this:
Track the PDF Down load:
For track the any event like PDF download Just add event click code in at hyperlink:
<a href=”http://Your_link” onclick =”ga(‘send’, ‘event’, ‘PDF’, ‘Download’, ‘Event_name’);” >Download </a>
After ad this code you can check in real time about how much user has download the PDFs.
Track the tabs (see Virtual Page-views)
Sometimes we see that some single page websites does not create any hash URL in situation you can track the tab navigation by using following code.
onclick=”ga(‘send’, ‘pageview’, { ‘page’: ‘/page-name/’});
Add above code with your tab URL Like this:
<a href=”url ” onclick=”ga(‘send’, ‘pageview’, { ‘page’: ‘/page-name/’});” >Tab 1</a>
After setup you can see real time navigation status very easily.