mirror of https://github.com/portainer/portainer
				
				
				
			fix(app/analytics): exclude login page in analytics (#8172)
							parent
							
								
									90b0cb84f4
								
							
						
					
					
						commit
						67d3abcc9d
					
				| 
						 | 
					@ -2,6 +2,8 @@ import angular from 'angular';
 | 
				
			||||||
import { setPortainerStatus, setUserRole, clearUserRole, setUserEndpointRole, clearUserEndpointRole, push, trackEvent } from './analytics-services';
 | 
					import { setPortainerStatus, setUserRole, clearUserRole, setUserEndpointRole, clearUserEndpointRole, push, trackEvent } from './analytics-services';
 | 
				
			||||||
const basePath = 'http://portainer-ce.app';
 | 
					const basePath = 'http://portainer-ce.app';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const excludedPaths = ['/auth'];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// forked from https://github.com/angulartics/angulartics-piwik/blob/master/src/angulartics-piwik.js
 | 
					// 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
 | 
					  // locationObj is the angular $location object
 | 
				
			||||||
  $analyticsProvider.registerPageTrack(function (path) {
 | 
					  $analyticsProvider.registerPageTrack(function (path) {
 | 
				
			||||||
 | 
					    if (excludedPaths.includes(path)) {
 | 
				
			||||||
 | 
					      return;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    push('setDocumentTitle', $window.document.title);
 | 
					    push('setDocumentTitle', $window.document.title);
 | 
				
			||||||
    push('setReferrerUrl', '');
 | 
					    push('setReferrerUrl', '');
 | 
				
			||||||
    push('setCustomUrl', basePath + path);
 | 
					    push('setCustomUrl', basePath + path);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue