Class: GAEvent

Defined in: vendor/assets/javascripts/plinth/plugins/tbg-ga-events.js.coffee

Overview

GAEVENT CLASS DEFINITION

Examples:

How to use with Haml

%a{ :href => '/some/link', :class => 'btn', :data => { :gaevent => 'category|action|opt_label|opt_value|opt_noninteraction' } }
# See: https://developers.google.com/analytics/devguides/collection/gajs/eventTrackerGuide

How to ensure plugin self initialises on element

<form data-gaevent-load="true"> ... </form>

Instance Method Summary

Constructor Details

- (void) constructor(element, eventcontent)

Construct a GAEvent instance - split the event content string and pass to sendEvent

Parameters:

  • element (Object) HTMLElement
  • eventcontent (String) Pipe delimited string of event content

Instance Method Details

- (void) sendEvent(data)

Send the event to Google Analytics

Parameters:

  • data (Array) If Google Analytics _gaq array defined then push data array after inserting '_trackEvent' string at beginning of data array