From 6c3f0f2de54012e0677d368b879a0dea448a2e0a Mon Sep 17 00:00:00 2001 From: Vladimir-Ayrikh Date: Tue, 21 Jan 2025 18:24:58 +0300 Subject: [PATCH] TILES-7179 Removed Google Analytics --- config.main.json | 2 -- src/DGCore/src/DGCore.js | 28 ---------------------- src/DGCustomization/src/DGCustomization.js | 25 ------------------- src/DGGeoclicker/src/Controller.js | 8 ------- src/DGGeoclicker/src/DGGeoclicker.js | 7 ------ src/DGPopup/src/DGPopup.js | 7 ------ 6 files changed, 77 deletions(-) diff --git a/config.main.json b/config.main.json index 0db72c91c..44597ef74 100644 --- a/config.main.json +++ b/config.main.json @@ -26,8 +26,6 @@ "projectLeaveMaxZoom": 16, "flampUrl": "http://flamp.ru/r/", "flampGoogleAnalytics": "utm_source=api2gis&utm_medium=api&utm_campaign=geoclicker", - "gaCode": "UA-38243181-2", - "gaName": "mapsapi2gis", "protocol": "http:", diff --git a/src/DGCore/src/DGCore.js b/src/DGCore/src/DGCore.js index 3660ca281..f94858824 100644 --- a/src/DGCore/src/DGCore.js +++ b/src/DGCore/src/DGCore.js @@ -25,34 +25,6 @@ window.__dgApi__ = window.__dgApi__ || {}; DG.version = window.__dgApi__.version; DG.Icon.Default.imagePath = '../img/vendors/leaflet'; -DG.Map.addInitHook((function() { - var inited = false; - - // Analytics inited once - return function() { - if (!inited) { - /*eslint-disable */ - (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ - (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), - m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) - })(window,document,'script',DG.config.googleAnalytics,'ga'); - /*eslint-enable */ - - inited = true; - } - - /*eslint-disable */ - ga('create', DG.config.gaCode, { - storage: 'none', // don't store and use cookies thanks GDPR - name: DG.config.gaName, - sampleRate: 50 - }); - ga(DG.config.gaName + '.set', 'anonymizeIp', true); - ga(DG.config.gaName + '.send', 'pageview'); - /*eslint-enable */ - }; -})()); - // Improve IHandler DG.Map.include({ addHandler: function(name, HandlerClass) { diff --git a/src/DGCustomization/src/DGCustomization.js b/src/DGCustomization/src/DGCustomization.js index 99b3d9930..7a6158966 100644 --- a/src/DGCustomization/src/DGCustomization.js +++ b/src/DGCustomization/src/DGCustomization.js @@ -104,34 +104,9 @@ L.Canvas.include({ // TODO: remove after successful research if (DG.Path) { var pathInitialize = DG.Path.prototype.onAdd; - var loggedGeometryTypes = {}; DG.Path.include({ onAdd: function(map) { - var type = 'Unknown'; - - if (DG.Rectangle && this instanceof DG.Rectangle) { - type = 'Rectangle'; - } else if (DG.Circle && this instanceof DG.Circle) { - type = 'Circle'; - } else if (DG.CircleMarker && this instanceof DG.CircleMarker) { - type = 'CircleMarker' - } else if (DG.Polygon && this instanceof DG.Polygon) { - type = 'Polygon'; - } else if (DG.Polyline && this instanceof DG.Polyline) { - type = 'Polyline'; - } - - // Don't send event twice for same type - if (!loggedGeometryTypes[type]) { - loggedGeometryTypes[type] = true; - - if (typeof ga !== undefined) { - // eslint-disable-next-line no-undef - ga(DG.config.gaName + '.send', 'event', 'Geometry', 'Use', type); - } - } - return pathInitialize.call(this, map); }, }); diff --git a/src/DGGeoclicker/src/Controller.js b/src/DGGeoclicker/src/Controller.js index 9eef89c03..4ca406ee3 100644 --- a/src/DGGeoclicker/src/Controller.js +++ b/src/DGGeoclicker/src/Controller.js @@ -48,14 +48,6 @@ DG.Geoclicker.Controller = DG.Class.extend({ var self = this, args = Array.prototype.slice.call(arguments, 0); - - // Monitor geoclicker user usage statistics - // TODO: remove after successful research - if (typeof ga !== undefined) { - // eslint-disable-next-line no-undef - ga(DG.config.gaName + '.send', 'event', 'Geoclicker', 'Use'); - } - function beforeRequest() { var loader = self._view.initLoader(); self._view._popup.clear(); diff --git a/src/DGGeoclicker/src/DGGeoclicker.js b/src/DGGeoclicker/src/DGGeoclicker.js index 73fc49a65..b94398b7a 100644 --- a/src/DGGeoclicker/src/DGGeoclicker.js +++ b/src/DGGeoclicker/src/DGGeoclicker.js @@ -15,13 +15,6 @@ DG.Geoclicker = DG.Handler.extend({ addHooks: function() { this._toggleEvents(true); - // Monitor geoclicker usage statistics - // TODO: remove after successful research - if (typeof ga !== undefined) { - // eslint-disable-next-line no-undef - ga(DG.config.gaName + '.send', 'event', 'Geoclicker', 'Enable'); - } - this._map .on('rulerstart', this._pause, this) .on('rulerend', this._unpause, this); diff --git a/src/DGPopup/src/DGPopup.js b/src/DGPopup/src/DGPopup.js index c9debbdfe..c802fc528 100644 --- a/src/DGPopup/src/DGPopup.js +++ b/src/DGPopup/src/DGPopup.js @@ -75,13 +75,6 @@ require('../../../vendors/baron'); }, this); originalOnAdd.call(this, map); this._animateOpening(); - - // Monitor popups usage - // TODO: remove after successful research - if (typeof ga !== undefined) { - // eslint-disable-next-line no-undef - ga(DG.config.gaName + '.send', 'event', 'Popup', 'Use'); - } }, onRemove: function(map) { // (Map)