@livechat/store-metrics
Reads and stores various marketing parameters as cookies. Super Important Thing for Marketing Team™.
Installation
npm install --save @livechat/store-metrics
Usage
Apps
Library exposes only one function that creates subdomain scoped cookies (*.example.com
) based on document.location
and document.referrer
. Make sure to fire it as early as possible, before redirects etc.
import storeMetrics from "@livechat/store-metrics";
storeMetrics();
NOTE: store-metrics
makes use of URL API. Polyfill for older browser is highly encouraged. We do not bundle any, as your app may already use some polyfill. However, we recommend inexorabletash/polyfill:
npm install --save js-polyfills
import "js-polyfills/url";
Websites
<script src="TBA/store-metrics.min.js"></script>
Development
npm install
npm test:watch
Build
npm run build