Switch redirectToOLFreeTrialUrl to calculate trial url

Sending unnecessary query params to OL seems like a footgun, so switch to
compromise that is more explicit but doesn't send unnecessary query params
This commit is contained in:
Alasdair Smith 2017-12-14 17:09:11 +00:00
parent 7322522323
commit da2c0b3fea
2 changed files with 8 additions and 8 deletions

View file

@ -98,10 +98,7 @@ html(itemscope, itemtype='http://schema.org/Product')
- if (settings.overleaf && settings.overleaf.host)
script.
window.freeTrialBaseUrl = '!{settings.overleaf.host}/users/trial'
- else
script.
window.freeTrialBaseUrl = '/user/subscription/new'
window.redirectToOLFreeTrialUrl = '!{settings.overleaf.host}/users/trial'
body
if(settings.recaptcha)

View file

@ -11,7 +11,10 @@ define [
w = window.open()
go = () ->
ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source)
url = "#{window.freeTrialBaseUrl}?planCode=#{plan}&ssp=true"
if window.redirectToOLFreeTrialUrl?
url = window.redirectToOLFreeTrialUrl
else
url = "/user/subscription/new?planCode=#{plan}&ssp=true"
if couponCode?
url = "#{url}&cc=#{couponCode}"
$scope.startedFreeTrial = true