added event tracking to subscription cretion/cancelation

This commit is contained in:
Henry Oswald 2014-03-09 09:56:58 +00:00
parent e7602321e9
commit 3d0bd34b50
2 changed files with 15 additions and 2 deletions

View file

@ -58,7 +58,7 @@ block content
p Your subscription has been canceled and will terminate on <strong>#{subscription.nextPaymentDueAt}</strong>. No further payments will be taken. p Your subscription has been canceled and will terminate on <strong>#{subscription.nextPaymentDueAt}</strong>. No further payments will be taken.
form(action="/user/subscription/reactivate",method="post") form(action="/user/subscription/reactivate",method="post")
input(type="hidden", name="_csrf", value=csrfToken) input(type="hidden", name="_csrf", value=csrfToken)
input(type="submit",value="Reactivate your subscription").btn.btn-success input(type="submit",value="Reactivate your subscription").btn.btn-success#cancelSubscription
when "expired" when "expired"
p Your subscription has expired. p Your subscription has expired.
a(href="/user/subscription/plans") Create New Subscription a(href="/user/subscription/plans") Create New Subscription
@ -80,4 +80,11 @@ block content
mixin printPlans(plans.individualAnnualPlans) mixin printPlans(plans.individualAnnualPlans)
script(type="text/javascript")
$('#cancelSubscription').on("click", function() {
ga('send', 'event', 'subscription-funnel', 'cancelation')
})

View file

@ -14,7 +14,13 @@ block content
script(type="text/javascript") script(type="text/javascript")
Recurly.config(!{recurlyConfig}) Recurly.config(!{recurlyConfig})
Recurly.buildSubscriptionForm(!{subscriptionFormOptions}); var recurlySubscriptionFormConfig = !{subscriptionFormOptions}
recurlySubscriptionFormConfig.successHandler = function(){
ga('send', 'event', 'subscription-funnel', 'created')
}
Recurly.buildSubscriptionForm();
include ../general/small-footer include ../general/small-footer