From 67d3abcc9d0205db0b5e11ee2c34c71dcc2eeed2 Mon Sep 17 00:00:00 2001 From: LP B Date: Thu, 15 Dec 2022 17:48:59 +0100 Subject: [PATCH] fix(app/analytics): exclude login page in analytics (#8172) --- app/angulartics.matomo/index.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/angulartics.matomo/index.js b/app/angulartics.matomo/index.js index 2ba89f610..6b7019ef4 100644 --- a/app/angulartics.matomo/index.js +++ b/app/angulartics.matomo/index.js @@ -2,6 +2,8 @@ import angular from 'angular'; import { setPortainerStatus, setUserRole, clearUserRole, setUserEndpointRole, clearUserEndpointRole, push, trackEvent } from './analytics-services'; const basePath = 'http://portainer-ce.app'; +const excludedPaths = ['/auth']; + // forked from https://github.com/angulartics/angulartics-piwik/blob/master/src/angulartics-piwik.js /** @@ -72,6 +74,10 @@ function config($analyticsProvider, $windowProvider) { // locationObj is the angular $location object $analyticsProvider.registerPageTrack(function (path) { + if (excludedPaths.includes(path)) { + return; + } + push('setDocumentTitle', $window.document.title); push('setReferrerUrl', ''); push('setCustomUrl', basePath + path);