Skip to content

thebarty/utm-parameters-toolset

Repository files navigation

Utm Parameter to cookies

Read utm parameters from the url and store them in a cookie.

So that you can read them on a different subdomain....

Have fun!

Install

  npm install utm-parameters-toolset --save
  OR
  yarn add utm-parameters-toolset

Use

  import { Utm } from 'utm-parameters-toolset'
  // create utm instance (set domain for allowed domains / subdomain)
  const utm = new Utm({
    domain: '.yourdomain.com',  // support subdomain
    expires: 365,
  })
  utm.store()  // simply store everything from window.location to cookies
  utm.get()    // get everything from cookies as object
  utm.clear()  // clear storage

License

MIT

Inspired by https://github.com/szymansd/utm-params/blob/master/index.js

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published