Skip to content

Instantly share code, notes, and snippets.

@oleglukashev
Created April 26, 2015 15:07
Show Gist options
  • Save oleglukashev/c4a123ba41f8f1a13bb6 to your computer and use it in GitHub Desktop.
Save oleglukashev/c4a123ba41f8f1a13bb6 to your computer and use it in GitHub Desktop.
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
@oleglukashev
Copy link
Author

Концерн по работе с аналитикой

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment