1.0.1 • Published 8 years ago

utmify v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

utmify Build Status

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