Purser.js: A JS library for preserving user data from first visit to signup
github.com
github.com
One thing that would make this insanely valuable is if you had the option to follow the same rules that google analytics uses to store UTM cookies.
Since the release of analytics.js they no longer allow you to ask the ga object what it thinks the current utm variables are (as they can be overwritten, expire, etc). One might want to do this to track stuff in their own database, etc.
That means one has to attempt to model their algorithm to get it to work, and lets just say thats super annoying:
https://lh3.googleusercontent.com/8EiYEKczs9NLsuKkZjRmeygRZ1...
Currently the library looks for 'utm_source', 'utm_medium', 'utm_name', 'utm_term', 'utm_campaign', and 'utm_content' in URL.
If I understand correctly you would like additional data collected by analytics.js made accessible via the library? I created an issue for your idea here (https://github.com/bilbof/purser/issues/1).
Is having the following data included in the object returned by purser.fetch() what you're after?
"visits_before_conversion": 2,
"subsequent_visits": [
{
"referrer": "news.ycombinator.com",
"utm_source": "hn_post"
}
]
I added this as an issue here https://github.com/bilbof/purser/issues/3