lib/nexmo_developer/app/controllers/static_controller.rb in station-0.0.128 vs lib/nexmo_developer/app/controllers/static_controller.rb in station-0.0.129
- old
+ new
@@ -147,25 +147,20 @@
block
end
end
def blog_cookie
- # This is the first touch time so we only want to set it if it's not already set
- set_utm_cookie('ft', Time.now.getutc.to_i) unless cookies[:ft]
-
- # Clear out old values that might not be set
- cookies.delete('utm_campaign', domain: :all)
- cookies.delete('utm_term', domain: :all)
- cookies.delete('utm_content', domain: :all)
-
# These are the things we'll be tracking through the customer dashboard
- set_utm_cookie('utm_medium', 'dev_education')
- set_utm_cookie('utm_source', 'blog')
- set_utm_cookie('utm_campaign', params['c']) if params['c']
- set_utm_cookie('utm_content', params['ct']) if params['ct']
- set_utm_cookie('utm_term', params['t']) if params['t']
+ utm_params = {
+ 'utm_medium' => 'dev_education',
+ 'utm_source' => 'blog',
+ }
- redirect_to 'https://dashboard.nexmo.com/sign-up'
+ utm_params.merge!('utm_campaign' => params['c']) if params['c']
+ utm_params.merge!('utm_content' => params['ct']) if params['ct']
+ utm_params.merge!('utm_term' => params['t']) if params['t']
+
+ redirect_to "https://dashboard.nexmo.com/sign-up?#{utm_params.to_query}"
end
private
def canonical_redirect