Google Analytics tracks custom properties

How to track a custom property for each page of my site? For example, to track page views, bounce rate, etc. For this page, I also want to track a custom property (in particular, the number of times that someone clicks on a specific link on a specific page).

Below is the layout of what I want to see (in the Google Analytics toolbar or through the GAPI):

enter image description here

+4
source share
1 answer

You can do this with event tracking. See the Google manual for more information: https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide

Example:

<head> ... <script> var _gaq=[['_setAccount','UA-XXXX-X'],['_setDomainName', 'example.com'],['_trackPageview']]; ... </head> <body> ... <a href="#" onClick="_gaq.push(['_trackEvent', 'Custom Clicks Category', 'Custom Link Clicks Action', 'Custom Label', 1]);">Click me</a> ... <script> (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0]; g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js'; s.parentNode.insertBefore(g,s)}(document,'script')); </script> 

The last parameter that I have not used is the non-interaction parameter, and its use depends on your specific case and how you would like to get the bounce rate. Read about it at https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide#non-interaction

+3
source

All Articles