mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +02:00
fix(app/analytics): exclude login page in analytics (#8172)
This commit is contained in:
parent
90b0cb84f4
commit
67d3abcc9d
1 changed files with 6 additions and 0 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue