Purser

Purser is a JavaScript library for preserving user data from first website visit to signup.

This enables you to associate signups to marketing campaigns, referrers, and more.

How it works

The library stores data such as utm_medium, landing_page and referrer in a localStorage object, and makes the object available via a handy API with the following methods:

Purser.create() // automatically called on first website visit
Purser.fetch() // returns the object
Purser.convert(obj) // returns the object updated with conversion data
Purser.update(obj) // lets you add additional parameters to the object
Purser.destroy() // removes the object from localStorage

Usage

Add the library to every page on your website. When a visitor creates an account, call purser.convert() and add the user to your CRM/ChartMogul with attributes returned.

  1. Install the library
  2. When a visitor creates an account, call purser.convert(obj) to get the visitor's marketing attributes
  3. Add the user's marketing attributes to them in your CRM or app
View the Github repository

Demo

Enter your name and click the 'Demo Create Account' button to see an example of how Purser works.