@justeat/f-trak
v1.0.0
Published
Analytics module that provides a consistent interface for reporting analytics
Downloads
86
Maintainers
Keywords
Readme
f-trak
:bear:
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>
Contribution notes
If you use Volta, compatible node and yarn versions will be automatically used. If not, please install the versions found in the volta config in package.json
.
For testing with other applications, I found [email protected]
to work. The latest version of yalc gave "primordials is not defined" when it ran the prepare script.