Created
April 26, 2015 15:07
-
-
Save oleglukashev/c4a123ba41f8f1a13bb6 to your computer and use it in GitHub Desktop.
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
module SendAnalyticsEvents | |
extend ActiveSupport::Concern | |
def send_registration_event | |
registration_event = MixpanelService.new({ | |
user_id: self.id | |
}).registration | |
end | |
def send_make_guide_event | |
MixpanelService.new({ | |
user_id: self.id, | |
event: { | |
message: I18n.t('analytics.messages.user_be_guide') | |
} | |
}).send_event | |
end | |
def send_active_status_tour_event | |
active_status_tour_event = MixpanelService.new({ | |
user_id: self.guide.id, | |
event: { | |
message: I18n.t('analytics.messages.moderated_tour'), | |
params: { | |
id: self.id, | |
name: self.name, | |
city: self.city.name | |
} | |
} | |
}).send_event | |
end | |
def send_create_tour_event | |
MixpanelService.new({ | |
user_id: self.guide.id, | |
event: { | |
message: I18n.t('analytics.messages.create_tour'), | |
params: { | |
id: self.id, | |
name: self.name, | |
city: self.city.name | |
} | |
} | |
}).send_event | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Концерн по работе с аналитикой