Skip to content
This module will receive `document.referrer` and some query params to determine where access come from.
JavaScript
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github/ISSUE_TEMPLATE
src
tests
.all-contributorsrc
.editorconfig
.eslintrc
.gitignore
.travis.yml
LICENSE
README.md
jest.config.js
package.json
renovate.json
yarn.lock

README.md

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

yarn add access-data-parser

Usage

const AccessData = require("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!

You can’t perform that action at this time.