An OUCampus gadget that allows content authors to insert a link with a Google event attached to it.
The final code that is inserted into the page looks like this:
<a href="http://www.google.com" onclick="ga('send', {hitType: 'event',
eventCategory: 'link',
eventAction: 'click',
eventLabel: 'google'
});">Google!</a>
Code is based off of analytics.js tracking. More information on Google's Event Tracking here. If you are running an older version of Google Analytics, this gadget will not work.
To test if the Google event fires, publish out the page and click on the link. Next in Google Analytics, navigate to the “Real-Time”/”Events” and see if the Event Category and Action happened.
Uisng OmniUpdate's Instructions, when asked for the URL please use: https://jessgusclark.github.io/gadget-event-tracking/build/
Make sure npm, Bower, and Gulp are installed on your machine.
npm install
bower install
gulp build
Yes! Fork and put in a pull request. Report issues in the issues tab.