Forráskód Böngészése

Moved analytics code to separate file

Taddeus Kroes 11 éve
szülő
commit
74fab0e696
3 módosított fájl, 10 hozzáadás és 16 törlés
  1. 8 0
      analytics.php
  2. 1 8
      index.php
  3. 1 8
      settings.php

+ 8 - 0
analytics.php

@@ -0,0 +1,8 @@
+<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-13215444-2', 'tkroes.nl');
+    ga('send', 'pageview');
+</script>

+ 1 - 8
index.php

@@ -127,13 +127,6 @@ function getwday($day) {
         <script src="channels.js" type="text/javascript"></script>
         <script src="guide.js" type="text/javascript"></script>
 
-        <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-13215444-2', 'tkroes.nl');
-            ga('send', 'pageview');
-        </script>
+        <?php include_once 'analytics.php'; ?>
     </body>
 </html>

+ 1 - 8
settings.php

@@ -47,13 +47,6 @@ function getwday($day) {
         <script src="channels.js" type="text/javascript"></script>
         <script src="settings.js" type="text/javascript"></script>
 
-        <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-13215444-2', 'tkroes.nl');
-            ga('send', 'pageview');
-        </script>
+        <?php include_once 'analytics.php'; ?>
     </body>
 </html>