michaelbaldry/rack-track — Issue #5: [Feature idea] "Cookie switch"
Author: jhilden
Created: 2011-12-15 18:18:41+00:00
State: open

That's a really nice gem, for a very common, real and annoying use case.

Have you considered including a DSL for something like a "cookie switch"? Because we often have the use case, that certain tracking pixels from affiliate partners should only be loaded if the user came through a certain campaign (and has a corresponding cookie, e.g. utm_source).

Something like:

cookie_segment :from_affiliate_a, {:utm_source => "affiliate_a"}

pixel "Affiliate pixel", :on => :all_pages, :segment => :from_affiliate_a, :owner => "Anna Lyst" do

Also, do you know any other gems that do something similar to rack-track?