Move Metabase tracking code.

This commit is contained in:
Paulo Reis 2016-10-27 12:22:58 +01:00
parent 5dddbec5b2
commit ad33aa1bb8
2 changed files with 14 additions and 13 deletions

View file

@ -467,17 +467,7 @@ define [
$scope.startFreeTrial = (source) ->
ga?('send', 'event', 'subscription-funnel', 'compile-timeout', source)
switch source
when "dropbox"
sixpack.participate 'teaser-dropbox-text', ['default', 'dropbox-focused'], (variant) ->
event_tracking.sendMB "subscription-start-trial", { source, variant }
when "history"
sixpack.participate 'teaser-history', ['default', 'focused'], (variant) ->
event_tracking.sendMB "subscription-start-trial", { source, variant }
else
event_tracking.sendMB "subscription-start-trial", { source }
event_tracking.sendMB "subscription-start-trial", { source }
window.open("/user/subscription/new?planCode=student_free_trial_7_days")
$scope.startedFreeTrial = true

View file

@ -6,9 +6,20 @@ define [
$scope.buttonClass = "btn-primary"
$scope.startFreeTrial = (source, couponCode) ->
event_tracking.sendMB "subscription-start-trial", { source }
w = window.open()
switch source
when "dropbox"
sixpack.participate 'teaser-dropbox-text', ['default', 'dropbox-focused'], (variant) ->
event_tracking.sendMB "subscription-start-trial", { source, variant }
when "history"
sixpack.participate 'teaser-history', ['default', 'focused'], (variant) ->
event_tracking.sendMB "subscription-start-trial", { source, variant }
else
event_tracking.sendMB "subscription-start-trial", { source }
sixpack.convert "track-changes-discount", ->
sixpack.participate 'in-editor-free-trial-plan', ['student', 'collaborator'], (planName, rawResponse)->
ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source)