I have google analytics on my site. One page has a button which when pressed executes some javascript. It would be nice to monitor the number of hits the button receives when people come to this page. Can anybody suggest the easiest way to achieve this with google analytics ? Are there any best practices to do this ?
thanks
Updated Answer
Here is the new method for Google Analytics event tracking:
<button onClick="ga('send', 'event', 'Category', 'Action', 'Label');" >Button text</button>
More info here: https://developers.google.com/analytics/devguides/collection/analyticsjs/events
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With