* adding chris as a devuser
This commit is contained in:
parent
a18f8ef8a2
commit
562b93ff4b
|
|
@ -0,0 +1,34 @@
|
|||
require 'rest_client'
|
||||
|
||||
class GoogleAnalyticsTracker
|
||||
|
||||
attr_accessor :enabled
|
||||
attr_accessor :tracking_code
|
||||
|
||||
def initialize(enabled, tracking_code=nil)
|
||||
if enabled && tracking_code.nil?
|
||||
raise "misconfigured application; a tracking code must be specified if tracking is enabled"
|
||||
end
|
||||
end
|
||||
|
||||
def event(category, action, client_id = nil)
|
||||
return unless enabled
|
||||
|
||||
params = {
|
||||
v: GOOGLE_ANALYTICS_SETTINGS[:version],
|
||||
tid: GOOGLE_ANALYTICS_SETTINGS[:tracking_code],
|
||||
cid: client_id
|
||||
t: "event",
|
||||
ec: category,
|
||||
ea: action
|
||||
}
|
||||
|
||||
begin
|
||||
RestClient.get(GOOGLE_ANALYTICS_SETTINGS[:endpoint], params: params, timeout: 4, open_timeout: 4)
|
||||
return true
|
||||
rescue RestClient::Exception => rex
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -11,6 +11,7 @@ if Rails.env == "development" && Rails.application.config.bootstrap_dev_users
|
|||
User.create_dev_user("Oswald", "Becca", "os@jamkazam.com", "jam123", "Austin", "TX", "US", nil, nil)
|
||||
User.create_dev_user("Anthony", "Davis", "anthony@jamkazam.com", "jam123", "Austin", "TX", "US", nil, nil)
|
||||
User.create_dev_user("George", "Currie", "george@jamkazam.com", "jam123", "Austin", "TX", "US", nil, nil)
|
||||
User.create_dev_user("Chris", "Doughty", "chris@jamkazam.com", "jam123", "Austin", "TX", "US", nil, nil)
|
||||
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue