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.
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