Skip to content

Commit

Permalink
TILES-7179 Removed Google Analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladimir-Ayrikh committed Jan 21, 2025
1 parent 2c7dbbb commit 6c3f0f2
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 77 deletions.
2 changes: 0 additions & 2 deletions config.main.json
Original file line number Diff line number Diff line change
Expand Up @@ -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:",

Expand Down
28 changes: 0 additions & 28 deletions src/DGCore/src/DGCore.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
25 changes: 0 additions & 25 deletions src/DGCustomization/src/DGCustomization.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
},
});
Expand Down
8 changes: 0 additions & 8 deletions src/DGGeoclicker/src/Controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
7 changes: 0 additions & 7 deletions src/DGGeoclicker/src/DGGeoclicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
7 changes: 0 additions & 7 deletions src/DGPopup/src/DGPopup.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 6c3f0f2

Please sign in to comment.