Last active
April 24, 2016 19:27
-
-
Save jordangraft/2e6e224795f15f402ff1a30f5cb6384e to your computer and use it in GitHub Desktop.
Controller action for receiving a ga_id from the client side
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ApplicationController < ActionController::Base | |
## | |
# Set the Google Analytics CID as passed via query params | |
# and then saved onto an order if they convert | |
def set_ga_id | |
session[:ga_id] ||= params[:ga_id] | |
render nothing: true | |
end | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
post '/set_ga_id', to: "application#set_ga_id" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment