Added -DNOGA=1 flag to disable Google Analytics
This commit is contained in:
		
							parent
							
								
									712fec11d5
								
							
						
					
					
						commit
						662f1cfa9d
					
				
					 2 changed files with 19 additions and 0 deletions
				
			
		
							
								
								
									
										14
									
								
								lsp/analytics.js
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								lsp/analytics.js
									
										
									
									
									
										Normal file
									
								
							| 
						 | 
				
			
			@ -0,0 +1,14 @@
 | 
			
		|||
 | 
			
		||||
//Google analytics. Can be fully disabled on request (or, if compiling yourself, add the NOGA=1 cmake flag).
 | 
			
		||||
//Is also disabled if the browser has the do not track flag setting turned on.
 | 
			
		||||
var oldTab = UI.showTab;
 | 
			
		||||
UI.showTab = function(){
 | 
			
		||||
  var r = oldTab.apply(this,arguments);
 | 
			
		||||
  if ((!navigator.doNotTrack) && (mist.user.loggedin)) {
 | 
			
		||||
    UI.elements.main.append(
 | 
			
		||||
      $("<img>").attr("src","https://www.google-analytics.com/collect?v=1&tid=UA-32426932-1&cid="+mist.data.config.iid+"&t=pageview&dp="+encodeURIComponent("/MI/"+arguments[0])+"&dh=MI."+(mist.data.LTS ? "Pro" : "OS")).css({width:"1px",height:"1px","min-width":"1px",opacity:0.1,position:"absolute",left:"-1000px"})
 | 
			
		||||
    );
 | 
			
		||||
  }
 | 
			
		||||
  return r;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue