This is a simple script to track events in your Google Analytics account.
If you want to track a buttons clicks, give the button a class ga-event and add the following attributes:
- data-event-category = “Website Leads”
- data-event-label = “Book A Demo”
NOTE: Change Website Leads and Book A Demo to whatever you want to call these. Create different names for however you want to segment the events.
You must be using Google Analytics script for this to work - so the integrations page should look like this
And finally, paste the below piece of code in the footer code of your site settings.
You can track as many buttons as you like. The results will appear in your Google Analytics dashboard under Behaviour > Events and also under Real Time > Events