diff --git a/services/web/app/views/layout.pug b/services/web/app/views/layout.pug index dd93b0b0fa..14ebc3c576 100644 --- a/services/web/app/views/layout.pug +++ b/services/web/app/views/layout.pug @@ -98,11 +98,8 @@ 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) script(src="https://www.google.com/recaptcha/api.js?render=explicit") diff --git a/services/web/public/coffee/main/account-upgrade.coffee b/services/web/public/coffee/main/account-upgrade.coffee index 8356458ef9..0cabc224a0 100644 --- a/services/web/public/coffee/main/account-upgrade.coffee +++ b/services/web/public/coffee/main/account-upgrade.coffee @@ -11,9 +11,12 @@ define [ w = window.open() go = () -> ga?('send', 'event', 'subscription-funnel', 'upgraded-free-trial', source) - url = "#{window.freeTrialBaseUrl}?planCode=#{plan}&ssp=true" - if couponCode? - url = "#{url}&cc=#{couponCode}" + if window.redirectToOLFreeTrialUrl? + url = window.redirectToOLFreeTrialUrl + else + url = "/user/subscription/new?planCode=#{plan}&ssp=true" + if couponCode? + url = "#{url}&cc=#{couponCode}" $scope.startedFreeTrial = true switch source