This module will receive `document.referrer` and some query params to determine where access come from.
npm install access-data-parserThis module will receive document.referrer and some query params to determine where access come from.
``bash`
pnpm add access-data-parser
`js
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'
}
*/
``
- source
- medium
- campaign
- content
- term
- referrer
- fbclid
- gclid
- direct
- organic
- social
- paid
- display
- referral
PRs accepted.
MIT © ANDRÉ VAN DAL
Thanks goes to these wonderful people (emoji key):
André Van Dal 🚇 🚧 ⚠️ 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!