Kaynağa Gözat

Merge pull request #6418 from overleaf/ta-ga-optimize-remove

Cleanup Google Optimize

GitOrigin-RevId: d8cf8008179ad2c355c09f06d947fb2b89cf5a3c
Jakob Ackermann 4 yıl önce
ebeveyn
işleme
b2e18c92a6

+ 0 - 3
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,
       })
     }
   }

+ 0 - 1
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()
   })
 

+ 0 - 17
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) };

+ 0 - 17
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) };

+ 0 - 1
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),