access-data-parser
TypeScript icon, indicating that this package has built-in type declarations

1.5.1 • Public • Published

Access Data Parser

GitHub issues GitHub stars All Contributors npm version npm downloads renovate enabled Travis (.org) branch Requirements Status GitHub license FOSSA Status

This module will receive document.referrer and some query params to determine where access come from.

Install

pnpm add access-data-parser

Usage

import AccessData from 'access-data-parser'

const queriesFromBrowser = {
  utm_source: "",
  utm_medium: "",
  utm_campaign: "",
  utm_content: "",
  utm_term: "",
  referrer: "https://google.com/"
};

console.log(new AccessData(queriesFromBrowser));
/* expected:
 {
   source: 'google',
   medium: 'organic',
   referrer: 'https://google.com/',
   channel: 'organic'
 }
*/

Params Supported

  • source
  • medium
  • campaign
  • content
  • term
  • referrer
  • fbclid
  • gclid

Default Channels

  • direct
  • organic
  • social
  • paid
  • display
  • referral

Contributing

PRs accepted.

License

MIT © ANDRÉ VAN DAL

Contributors

Thanks goes to these wonderful people (emoji key):

André Van Dal
André Van Dal

🚇 🚧 ⚠️ 💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Package Sidebar

Install

npm i access-data-parser

Weekly Downloads

621

Version

1.5.1

License

MIT

Unpacked Size

18.7 kB

Total Files

15

Last publish

Collaborators

  • andrevandal