@justeat/f-trak

Analytics module that provides a consistent interface for reporting analytics

Usage no npm install needed!

<script type="module">
  import justeatFTrak from 'https://cdn.skypack.dev/@justeat/f-trak';
</script>

README

f-trak

Fozzie Bear

Analytics module that provides a consistent interface for reporting analytics.


f-trak :bear:

npm version Build Status Coverage Status

Setup

Add f-trak to your project:

yarn add @justeat/f-trak

Then, inside your script import the module such that:

import Trak from '@justeat/f-trak';

Usage

Event Throttling

Throttles events by a given timeout (in seconds) using the event action as a key.

For example

<!-- Set event throttling to 1 minute -->
<button
  data-trak='{
    "trakEvent": "click",
    "category": "My test category",
    "action": "My test action",
    "label": "My test label"
    "throttle": 60
}'
>
  My Test Button
</button>