Skip to content

An OUCampus Gadget that allows users to insert links that are tracked with Google Analytics' events.

Notifications You must be signed in to change notification settings

jessgusclark/gadget-event-tracking

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

An OUCampus gadget that allows content authors to insert a link with a Google event attached to it.

Gadget Preview

Preview of the Event Tracking Gadget

Google Code:

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.

Test the link

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.

Install

Install via GitHub pages

Uisng OmniUpdate's Instructions, when asked for the URL please use: https://jessgusclark.github.io/gadget-event-tracking/build/

Clone the repo and host locally

Make sure npm, Bower, and Gulp are installed on your machine.

npm install

bower install

gulp build

Contributing

Yes! Fork and put in a pull request. Report issues in the issues tab.

About

An OUCampus Gadget that allows users to insert links that are tracked with Google Analytics' events.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published