Skip to content

Commit

Permalink
nullify incumbent ga code
Browse files Browse the repository at this point in the history
  • Loading branch information
moikaturns committed Nov 16, 2024
1 parent c1c63d4 commit b707618
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
17 changes: 17 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,22 @@

<!-- Controllers -->
<script src="scripts/controllers/ColorGeneratorCtrl.js"></script>

<!-- Google Analytics snippet. -->
<!--
<script>
(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', '//www.google-analytics.com/analytics.js', 'ga');
</script>
-->
</body>
</html>
7 changes: 4 additions & 3 deletions scripts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,14 +63,15 @@ mcgApp.config(function ($routeProvider, $mdThemingProvider, $sceDelegateProvider
).run(function($rootScope, $location, $window, $mdTheming)
{
// initialise google analytics
$window.ga('create', 'UA-62237624-1', 'auto');
// $window.ga('create', 'UA-62237624-1', 'auto');

// track index view
$window.ga('send', 'pageview', 'mcg_index');
// $window.ga('send', 'pageview', 'mcg_index');

// track pageview on state change
$rootScope.$on('$stateChangeSuccess', function (event) {
$window.ga('send', 'pageview', $location.path());
console.log(`'pageview' ${$location.path()}`);
// $window.ga('send', 'pageview', $location.path());
});

$mdTheming.generateTheme('default');
Expand Down

0 comments on commit b707618

Please sign in to comment.