0.0
No commit activity in last 3 years
No release in over 3 years
Track touchpoints.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 4
 Project Readme

A channel is a source of traffic to our application. It could be:

  • direct: users enter our bare URL in their browser. No referrer.
  • organic: users click on a link on a search engine. Referrer is the search engine URL.
  • marketing: users click on a link of an affiliate or paid search result. UTM params are usually set. Referrer is the affiliate URL.
  • campaign: users click on a link of an email/site or enter a URL. UTM params are usually set. Referrer may not.

A touchpoint is a visit from the outside world, to our website or set of websites under the same domain.

Attribution is the process of assigning a channel to a customer, so we can know what channel we'd better put our money on.

Usually, the attributed channel is the first touchpoint found 1 month after the user signed up (or any other event we decide).

bin/rails generate migration CreateTouchpoints user_id:integer utm_params:jsonb referer:string created_at:timestamp

If we have several hosts with same domain operating as a whole, we must share the session cookie between them. In your config/initializers/session_store.rb:

Rails.application.config.session_store :cookie_store, key: '_creditspring_session', domain: ENV.fetch('DOMAIN', 'localhost')

In your ApplicationController:

include Touchpoints::Tracker

Configure the gem, in config/initializers/touchpoints.rb:

Touchpoints.configure do |config|
  config.set :logging, true
  config.set :model_id, :entity_id
  config.set :model_foreign_id, :user_entity_id
end