diff --git a/public/assets/js/app.js b/public/assets/js/app.js index 93b16ee..6650b12 100644 --- a/public/assets/js/app.js +++ b/public/assets/js/app.js @@ -81,6 +81,10 @@ for (var key in hashData) { if ($scope.data[key] !== undefined && typeof $scope.data[key] === typeof hashData[key]) { $scope.data[key] = hashData[key]; + gtag('event', 'data_from_hash', { + event_label: key, + event_value: hashData[key], + }); } } }; @@ -91,7 +95,6 @@ } var changedData = {}; - for (var key in $scope.data) { if (!angular.equals($scope.data[key], data[key])) { changedData[key] = $scope.data[key]; @@ -107,6 +110,13 @@ $scope.reset = function() { $scope.data = angular.copy(data); + gtag('event', 'reset'); + }; + + $scope.clipboardSuccess = function(key) { + gtag('event', 'clipboard', { + event_label: key, + }); }; @@ -114,10 +124,19 @@ ////////////////// // SCOPE EVENTS // ////////////////// - $scope.$watch('data', function() { + $scope.$watch('data', function(newValue, oldValue) { $scope.refreshHighlighting(); $scope.updateHash(); + for (var key in $scope.data) { + if (!angular.equals(newValue[key], oldValue[key])) { + gtag('event', 'data_changed', { + event_label: key, + event_value: $scope.data[key], + }); + } + } + if (!$scope.dataInit) { $scope.dataInit = true; } diff --git a/public/index.html b/public/index.html index 04a08f3..654320f 100644 --- a/public/index.html +++ b/public/index.html @@ -24,7 +24,7 @@
-
Copy to clipboard
+
Copy to clipboard
@@ -203,19 +203,19 @@
- +
- +
- +
- +
@@ -224,7 +224,7 @@
/etc/nginx/nginx.conf -
@@ -233,7 +233,7 @@
/etc/nginx/sites-enabled/{{ data.domain }}.conf -
@@ -242,7 +242,7 @@
/etc/nginx/_ssl.conf -
@@ -251,7 +251,7 @@
/etc/nginx/_letsencrypt.conf -
@@ -260,7 +260,7 @@
/etc/nginx/_general.conf -
@@ -269,7 +269,7 @@
/etc/nginx/_php.conf -
@@ -278,7 +278,7 @@
/etc/nginx/_php_fastcgi.conf -
@@ -287,7 +287,7 @@
/etc/nginx/_wordpress.conf -