fix(app/analytics): exclude login page in analytics (#8172)

pull/8207/head
LP B 2 years ago committed by GitHub
parent 90b0cb84f4
commit 67d3abcc9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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);

Loading…
Cancel
Save