UTM

Used to dry up UTM link generation.

DEPENDENCIES

ruby-1.9.2, bundler, addressable, minitest, jeweler, reek, rake, reek, rdoc

INSTALL

gem install bundler
bundle install

USAGE

RAKE TASKS

Mostly used rake tasks

rake rdoc                # Build RDoc HTML files
rake reek                # Check for code smells
rake test                # Run tests

Not so used rake tasks

rake install             # Build and install gem using `gem install`
rake build               # Build gem into pkg/
rake clobber_rdoc        # Remove RDoc HTML files
rake console[script]     # Start IRB with all runtime dependencies loaded
rake gemcutter:release   # Release gem to Gemcutter
rake gemspec             # Generate and validate gemspec
rake gemspec:debug       # Display the gemspec for debugging purposes, as jeweler knows it (not from the filesystem)
rake gemspec:generate    # Regenerate the gemspec on the filesystem
rake gemspec:release     # Regenerate and validate gemspec, and then commits and pushes to git
rake gemspec:validate    # Validates the gemspec on the filesystem
rake git:release         # Tag and push release to git.
rake release             # Release gem
rake rerdoc              # Rebuild RDoc HTML files
rake version             # Displays the current version
rake version:bump:major  # Bump the major version by 1
rake version:bump:minor  # Bump the a minor version by 1
rake version:bump:patch  # Bump the patch version by 1
rake version:write       # Writes out an explicit version.

EXAMPLE USAGE

# == Campaign Source (utm_source)
# Required. Use utm_source to identify a search engine, newsletter
# name, or other source.
# * Example: utm_source=google
#
# == Campaign Medium (utm_medium)
# Required. Use utm_medium to identify a medium such as email or
# cost-per- click.
# * Example: utm_medium=cpc
#
# Campaign Term (utm_term)
# Used for paid search. Use utm_term to note the keywords for this ad.
# * Example: utm_term=running+shoes

# Campaign Content (utm_content)
# Used for A/B testing and content-targeted ads. Use utm_content to
# differentiate ads or links that point to the same URL.
# * Examples: utm_content=logolink or utm_content=textlink

# Campaign Name (utm_campaign)
# Used for keyword analysis. Use utm_campaign to identify a specific
# product promotion or strategic campaign.
# * Example: utm_campaign=spring_sale

UTM.configure do |conf|
  conf.utm_source   = "google"
  conf.utm_medium   = "cpc"
  conf.utm_content  = "variation_1"
  conf.utm_campaign = "autofire"
end

params = UTM.build_params({utm_term: "fixies"})
params = UTM.build_params({utm_term: "ponies"})

HELP OUT

  • Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet

  • Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it

  • Fork the project

  • Start a feature/bugfix branch

  • Commit and push until you are happy with your contribution

  • Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

Copyright © 2012 Joel Larsson. See LICENSE.txt for further details.