Pass.js

Very simple parameter passing.

Pass.js is a way to send or pass url parameters to form fields. In nerd terms, it captures values from url parameters and saves them as cookies. Pass.js then inserts those cookies into the appropriate input fields. It’s a wonderful way to track where your conversion traffic is coming from. And super light weight – at less than 3kb.

So, how’s it work again?

Let’s say you need to track the utm_source, utm_medium and utm_campaign parameters. These are some common params for Google Analytics campaigns. Your site visitors access your website from a URL like the one below. Please take note of the text following the question mark.

http://garybunofsky.github.io/pass.js?utm_source=oh&utm_medium=my&utm_campaign=goodness

See those url params to the right of the question mark? They track how the visitor got to your website. That’s great, but if the visitor doesn’t convert on the first page the parameters are not tracked. It’d be splendid if every visitor converted on the first page they visit, but this is rarely the case. To ensure we capture those valuable values Pass.js saves them as cookies for 30 days. The cookies are then inserted if the visitor converts before the the cookies expire.

I’m still kind of confused. Can you show me?

Sure, but keep your eye on the fields below. You’ll notice the values from browser’s search bar are inserted into the fields. Watch closely now.

Click here to see pass in action or clear your cookies and try again.

Voilà!

The values are set as cookies for 30 days. They’ll remain persistent on your revisit unless you clear your cookies. Anyways, feel free to download Pass.js. If you’d like to contribute, just submit a pull request.