diff --git a/services/web/app/src/Features/Subscription/SubscriptionController.js b/services/web/app/src/Features/Subscription/SubscriptionController.js index 713dac081e..1b3318bb9c 100644 --- a/services/web/app/src/Features/Subscription/SubscriptionController.js +++ b/services/web/app/src/Features/Subscription/SubscriptionController.js @@ -57,8 +57,6 @@ async function plansPage(req, res) { res.render('subscriptions/plans-marketing', { title: 'plans_and_pricing', plans, - gaExperiments: Settings.gaExperiments.plansPage, - gaOptimize: true, itm_content: req.query && req.query.itm_content, recomendedCurrency: recommendedCurrency, recommendedCurrency, @@ -116,7 +114,6 @@ async function paymentPage(req, res) { }), showCouponField: !!req.query.scf, showVatField: !!req.query.svf, - gaOptimize: true, }) } } diff --git a/services/web/app/src/infrastructure/ExpressLocals.js b/services/web/app/src/infrastructure/ExpressLocals.js index 6fd52ad6c4..412d14f84d 100644 --- a/services/web/app/src/infrastructure/ExpressLocals.js +++ b/services/web/app/src/infrastructure/ExpressLocals.js @@ -284,7 +284,6 @@ module.exports = function (webRouter, privateApiRouter, publicApiRouter) { Settings.analytics && Settings.analytics.ga && Settings.analytics.ga.tokenV4 - res.locals.gaOptimizeId = _.get(Settings, ['analytics', 'gaOptimize', 'id']) next() }) diff --git a/services/web/app/views/layout-marketing.pug b/services/web/app/views/layout-marketing.pug index 3a02e83a9f..6f16868f8f 100644 --- a/services/web/app/views/layout-marketing.pug +++ b/services/web/app/views/layout-marketing.pug @@ -13,9 +13,6 @@ html( head include ./_metadata.pug - if (typeof(gaExperiments) != "undefined") - |!{gaExperiments} - //- Stylesheet link(rel='stylesheet', href=buildCssPath(getCssThemeModifier(userSettings, brandVariation)), id="main-stylesheet") block css @@ -53,20 +50,6 @@ html( }) } } catch (e) {} - if gaOptimize === true && typeof(gaOptimizeId) != "undefined" - //- Anti-flicker snippet - style(type='text/css') .async-hide { opacity: 0 !important} - script(type="text/javascript", nonce=scriptNonce). - if (!ga.isBlocked) { - ga('require', '#{gaOptimizeId}'); - ga('send', 'event', 'pageview', document.title.substring(0, 499), window.location.href.substring(0, 499)); - (function(a,s,y,n,c,h,i,d,e){s.className+=' '+y;h.start=1*new Date; - h.end=i=function(){s.className=s.className.replace(RegExp(' ?'+y),'')}; - (a[n]=a[n]||[]).hide=h;setTimeout(function(){i();h.end=null},c);h.timeout=c; - })(window,document.documentElement,'async-hide','dataLayer',4000, - {'#{gaOptimizeId}':true}); - } - else script(type="text/javascript", nonce=scriptNonce). window.ga = function() { console.log("would send to GA", arguments) }; diff --git a/services/web/app/views/layout.pug b/services/web/app/views/layout.pug index cffd0b58e7..99137db290 100644 --- a/services/web/app/views/layout.pug +++ b/services/web/app/views/layout.pug @@ -10,9 +10,6 @@ html( head include ./_metadata.pug - if (typeof(gaExperiments) != "undefined") - |!{gaExperiments} - //- Stylesheet link(rel='stylesheet', href=buildCssPath(getCssThemeModifier(userSettings, brandVariation)), id="main-stylesheet") block css @@ -50,20 +47,6 @@ html( }) } } catch (e) {} - if gaOptimize === true && typeof(gaOptimizeId) != "undefined" - //- Anti-flicker snippet - style(type='text/css') .async-hide { opacity: 0 !important} - script(type="text/javascript", nonce=scriptNonce). - if (!ga.isBlocked) { - ga('require', '#{gaOptimizeId}'); - ga('send', 'event', 'pageview', document.title.substring(0, 499), window.location.href.substring(0, 499)); - (function(a,s,y,n,c,h,i,d,e){s.className+=' '+y;h.start=1*new Date; - h.end=i=function(){s.className=s.className.replace(RegExp(' ?'+y),'')}; - (a[n]=a[n]||[]).hide=h;setTimeout(function(){i();h.end=null},c);h.timeout=c; - })(window,document.documentElement,'async-hide','dataLayer',4000, - {'#{gaOptimizeId}':true}); - } - else script(type="text/javascript", nonce=scriptNonce). window.ga = function() { console.log("would send to GA", arguments) }; diff --git a/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js b/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js index 3f98cc2f92..0e60bbeb88 100644 --- a/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js +++ b/services/web/test/unit/src/Subscription/SubscriptionControllerTests.js @@ -116,7 +116,6 @@ describe('SubscriptionController', function () { }, }, siteUrl: 'http://de.sharelatex.dev:3000', - gaExperiments: {}, } this.GeoIpLookup = { isValidCurrencyParam: sinon.stub().returns(true),