1.0.10 • Published 4 years ago

channel-grouping v1.0.10

Weekly downloads
87
License
MIT
Repository
github
Last release
4 years ago

channel-grouping

channel-grouping is a marketing channel attribution and referrer parsing (UTM) client-side library written in Javascript. It uses Google Analytics Default Channel Definitions to attribute traffic on your site to specific channels.

How To Use

Install

npm

npm install --save channel-grouping

Yarn

yarn add -s channel-grouping

Channel Groups

Email

When Landing Page UTM Medium matches Regex /^email$/i

Affiliates

When Landing Page UTM Medium matches Regex /^affiliate$/i

Referral

When Landing Page UTM Medium matches Regex /^referral$/i

Organic Search

When Landing Page UTM Medium matches Regex /^(organic|search)$/i

Paid Search

When Landing Page UTM Medium matches Regex /^(cpc|ppc|paidsearch)$/i

Other Advertising

When Landing Page UTM Medium matches Regex /^(cpv|cpa|cpp)$/i

Display

When Landing Page UTM Medium matches Regex /^(display|cpm|banner)$/i

Social

When Landing Page UTM Medium matches Regex /^(social|social-network|social-media|sm|social network|social media)$/i

Direct

When Landing Page or Referrer has no UTM Source

Internal

When Landing Page Hostname and Referrer Hostname are the same

Other

All other cases, while UTM Medium does not equal (none)

Examples

Here is a simple example of usage:

import { Attribution } from "channel-grouping";

const ChannelGroup = Attribution.analyze(document.referrer, window.location.href);

console.log(ChannelGroup);

Log output:

{
    campaign: ""
    channelGroup: "Direct"
    content: ""
    landingPageDomain: "http://localhost:3001"
    medium: "(none)"
    referrerDomain: "",
    source: "(direct)",
    term: ""
}
1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.5

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago