No commit activity in last 3 years
No release in over 3 years
This Rails gem allows you to persist analytics parameters through redirects. By default its persists utm_campaign, utm_source, utm_term, utm_medium, utm_content and gclid (for Google Adwords). Additional param keys can be configured.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

PersistCampaign

Build Status

Persist campaign parameters - such as utm_campaign, utm_source, etc - on Rails redirect_to.

Installation

Add this line to your application's Gemfile:

gem 'persist_campaign'

And then execute:

$ bundle

Default persisted keys

  • utm_campaign
  • utm_source
  • utm_medium
  • utm_content
  • utm_term
  • gclid (for Google Adwords)

Configure additional keys

You can append to the key array in a configuration block. There is an install generator to create the initializer file.

rails g persist_campaign:install

Edit the initializer to append other keys:

PersistCampaign.configure do |config|
  config.keys += ['foo']
end

Testing

rake

Credits

Thanks to ndp's save-the-campaign gem for providing the solution to patching Rail's redirect_to implemention. His solution is reproduced here under the MIT license.

Contributing

  1. Fork it ( http://github.com/mubi/persist_campaign/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request