0.1.2 • Published 6 years ago

last-click v0.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Last Click - Save the last external website your visitors clicked

Software License Build Status Coverage Status Quality Score

The name 'last click' comes from marketing terms where the last click refers to the last external website a user clicked before arriving on your website.

That external website is what we try to figure out and save in this library.

Installation

$ npm install last-click

Usage

// these are the default settings used in the library
// you can add more sources if you want
const defaultSettings = {
    sources: [
        {referrer: 'google'},
        {referrer: 'yahoo'},
        {referrer: 'bing'},
        {queryParameter: 'gclid', 'value': 'adwords'},
        {queryParameter: 'utm_source'}
    ],
    cookie: {
        name: 'last_click',
        expires: 30 * 24 * 60 * 60 // 30 days in seconds
    }
};

const lastClick = require('last-click')(defaultSettings);
console.log(lastClick.getLastClick());

Test

$ npm test
0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago