Google Event tracking in Google Analytics is a useful ways for tracking what users do and how they engage with features on your website. For example, in a recent project our client needed a way to track the amount of people who were pressing the subscribe button on their email subscription form but not following through with the subscription by confirming it in their email. To track this we set up an event on the submit button of the form. When users click on the button it registers as a goal. Now to see how many users are not following through with the subscribe confirmation they can take the difference between how many users actually signed up and how many time the goal was completed. Here is how we set up the event.</p>
1. First we created the Goal in the Google Analytics account. Check out our earlier post on creating goals here.
onClick="_gaq.push(['_trackEvent', 'Subscribe', 'Click', 'Subscribe Click']);"
There are two different ways to implement this based on the type of analytics you run on your site. Google has either Universal Analytics or Classic. The way above is for Classic Analytics but Universal works the same way just with different syntax. You can read more about that here. In the snippet above Subscribe correlates to the Category as defined in GA when you create a new goal while “Click” is the Action and “Subscribe Click” is the label.
When you set up your event code events will start registering under Reporting –> Conversions –> Goals –> Overview.
That’s it! Please feel free to comment below if you have any questions.