The Arcive of vBulletin Modifications Site. | 
    |
| 
		 
			 
			#1  
			
			
			
			
			
		 
		
	 | 
||||
		
		
  | 
||||
| 
		
	
		
		
			
			 
			
			Hi! How to insert the code Universal Analytics? 
		
		
		
		
		
		
		
		
	
	Привет! Как вставить код Universal Analytics? Code: 
	<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
  ga('create', 'UA-32257551-1', 'auto');
  ga('send', 'pageview');
</script>
Реализация PHP Создайте файл analyticstracking.php с приведенным выше кодом и добавьте его с помощью директивы include во все шаблоны страниц PHP. Затем добавьте следующую строку на каждый шаблон страницы непосредственно после открывающего тега <body>: <?php include_once("analyticstracking.php") ?>  | 
| 
		 
			 
			#2  
			
			
			
			
			
		 
		
	 | 
||||
		
		
  | 
||||
| 
		
	
		
		
			
			 
			
			Add it to your headincludes at the bottom.
		 
		
		
		
		
		
		
		
		
	
	 | 
| 
		 
			 
			#3  
			
			
			
			
			
		 
		
	 | 
||||
		
		
  | 
||||
| 
		
	
		
		
			
			 
			
			How to add analyticstracking.php file using the include directive to all page templates PHP? 
		
		
		
		
		
		
		
		
	
	Как добавить файл analyticstracking.php с помощью директивы include во все шаблоны страниц PHP?  | 
| 
		 
			 
			#4  
			
			
			
			
			
		 
		
	 | 
||||
		
		
  | 
||||
| 
		
	
		
		
			
			 
			
			The code you supplied in the OP is javascript and not php, so does not need to be in a php file.
		 
		
		
		
		
		
		
		
		
	
	 | 
| 
		 
			 
			#5  
			
			
			
			
			
		 
		
	 | 
||||
		
		
  | 
||||
| 
		
	
		
		
			
			 Quote: 
	
 Не понял. Google пишет добавить код в PHP файл.  | 
| 
		 
			 
			#6  
			
			
			
			
			
		 
		
	 | 
||||
		
		
  | 
||||
| 
		
	
		
		
			
			 
			
			All you have to do is paste the code into your headincludes. You do not need the php file. The headinclude will include it in all your templates.
		 
		
		
		
		
		
		
		
		
	
	 | 
| 
		 
			 
			#7  
			
			
			
			
			
		 
		
	 | 
||||
		
		
  | 
||||
| 
		
	
		
		
			
			 Quote: 
	
 Я боюсь, что с помощью такого метода скорость загрузки страниц будет больше.  | 
| 
		 
			 
			#8  
			
			
			
			
			
		 
		
	 | 
||||
		
		
  | 
||||
| 
		
	
		
		
			
			 
			
			Actually if you are that worried about it the code will also work in the footer but most suggest the headincludes. I do not see how adding the code directly to the file is going to be slower than having it called.
		 
		
		
		
		
		
		
		
		
	
	 | 
| Благодарность от: | ||
| MarkFL | ||
![]()  | 
	
	
		
  | 
	
		
  | 
| X vBulletin 3.8.12 by vBS Debug Information | |
|---|---|
						
  | 
				|
  More Information | 
				|
| 
						 Template Usage: 
						
 Phrase Groups Available: 
						
  | 
					
						 Included Files: 
						
 Hooks Called: 
						
  |