Fetch Track
Simple method to fire analytics events using window.fetch. Highly customizable, lightweight, no dependencies.
If window.fetch does not exist (e.g. old browser), this library does nothing.
Installation
NPM: npm install --save fetch-track
Yarn: yarn add fetch-track
Usage
;
Configuration
Fetch Options
These options customize how the actual fetch call is made.
track;
Data Options
These options append properties to every track call.
// These are all the possible config options, only pass what you needtrack;
Mocking Mode
The mock
option does console.log
instead of doing the actual fetch. Very useful for Dev and QA environments.
track;