Nocturnal Prancing Mosquito

    @livechat/store-metrics

    1.0.0 • Public • Published

    @livechat/store-metrics

    Reads and stores various marketing parameters in Accounts Client Store. Super Important Thing for Marketing Team™. Only 3.1kB gzipped.

    Installation

    npm install --save @livechat/store-metrics

    Usage

    Apps

    Library exposes only one function that saves source attribution and Partner Program affiliation params 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();

    Websites

    For websites without module bundler/resolver you can use self-executing version of store-metrics. You can load it directly from our CDN:

    <script src="https://cdn.livechat-static.com/metrics/store-metrics.min.js" async></script>

    And that's it.

    Development

    npm install
    npm run test:watch

    Build

    npm run build

    Changelog

    1.0.0 — 2021-05-25

    Changed

    • Storage mechanism changed from cookies to cross-domain localStorage, to support multi-product Global Accounts
    • Because there is no 'session' concpet in localStorage, default TTL is set to 2 weeks

    Removed

    • IE no longer supported
    • URL API polyfill

    0.4.0 [YANKED]

    0.3.0 — 2020-06-17

    Added

    0.2.1 - 2018-10-19

    Added

    0.2.0 - 2018-02-13

    Added

    • Return params which were saved while executing

    0.1.4 - 2017-12-12

    Fixed

    • Referrer for internal redirects is no longer stored

    0.1.3 - 2017-12-08

    Added

    • Self-executing version for browsers
    • CDN deployment and website usage docs

    Fixed

    • URL is not a constructor error

    0.1.2 - 2017-12-05

    Fixed

    • Cookie domain for origins not starting with www.

    0.1.1 [YANKED]

    0.1.0 - 2017-11-28

    Initial release

    Keywords

    none

    Install

    npm i @livechat/store-metrics

    DownloadsWeekly Downloads

    420

    Version

    1.0.0

    License

    ISC

    Unpacked Size

    18.9 kB

    Total Files

    5

    Last publish

    Collaborators

    • m.teczynski
    • misterkuka
    • jakubpyzio
    • rkawka
    • bolchowka
    • lukiq
    • f.jaskolski
    • litwinow-lc
    • msypko
    • kamilmateusiak
    • bamboo-livechat
    • olek_livechat
    • skix
    • s.graczyk.livechat
    • michalpaszczakowski
    • afedyk
    • andarist
    • konradk
    • t.burzlc
    • dmgawel
    • jedrek
    • k.zajac
    • dobrochna.przybylek
    • lkrolak
    • hstaniszewski
    • chatbot-com
    • jakubsikora
    • norbertprocak
    • walaszczykm
    • dominikslawkowski
    • klarzynskik
    • ale-kacperczyk
    • gogolix
    • sambor
    • macpankiewicz
    • mreszke
    • k-kozak
    • voyy
    • bbartek
    • mdebski
    • shwarcu
    • jfedyczak
    • killavus
    • paulinag
    • morus12
    • tomaszratajczyk
    • julitanadolska
    • janowsiany
    • kogierman
    • dzabrzenski
    • bartoszgamza
    • wouga
    • ttrzcinski
    • jelonidas777
    • mzielonka
    • alithanar
    • msawickilc
    • jawinski
    • gh-actions-livechat
    • ewaryst
    • oliwiapolec
    • przemuh
    • arturfracala
    • panr
    • vbezpalko