utmify
v1.0.1
Published
Generate a UTM parameter object from individual properties (e.g. campaign)
Downloads
4
Readme
utmify
Generate a UTM parameter object from individual properties (e.g. campaign)
Install
$ npm install --save utmify
Usage
var utmify = require('utmify')
utmify({campaign: 'foo', content: 'bar'})
//=> {utm_campaign: foo, utm_content: 'bar'}
API
utmify(params)
-> object
params
Required
Type: object
A list of UTM parameters. Allowed keys are:
- campaign
- source
- medium
- content
- term
These keys will be prefixed with utm_
. Any other keys will be stripped from the output. Falsy values will also be stripped.
License
MIT © Ben Drucker