Skip to content

tsukurite/event-tracker.js

Repository files navigation

event-tracker.js

track event

Installation

$ npm install tsukurite/event-tracker.js

Usage

via require()

var eventTracker = require('event-tracker');

via <script>

<script src="event-tracker.min.js"></script>

Example

see examples.

Functions

getDataAttributes(element)

  • element
    • Element - element
  • return
    • Object - upper camel cased data-* attributes

track(eventType, selector[, data[, callback]])

  • eventType
    • String - event name
  • selector
    • String - selector for target elements
  • [data]
    • Function|Object - tracking data
  • [callback]
    • Function - callback function

License

The MIT license. Please see LICENSE file.