tracks visits from different email templates

This commit is contained in:
rgarcia
2015-10-20 16:40:30 +02:00
parent 87aa44de5a
commit c71bf4c876
7 changed files with 73 additions and 1 deletions

View File

@@ -11,6 +11,7 @@ class ApplicationController < ActionController::Base
before_action :ensure_signup_complete
before_action :set_locale
before_action :track_email_campaign
check_authorization unless: :devise_controller?
self.responder = ApplicationResponder
@@ -107,4 +108,11 @@ class ApplicationController < ActionController::Base
redirect_to(account_path, notice: t('verification.redirect_notices.already_verified'))
end
end
def track_email_campaign
if params[:track_id]
campaign = Campaign.where(track_id: params[:track_id]).first
ahoy.track campaign.name if campaign.present?
end
end
end