Browse Source

Updated gtag.

Mr.doob 2 years ago
parent
commit
c91a3f40be
5 changed files with 32 additions and 60 deletions
  1. 8 13
      docs/index.html
  2. 6 11
      editor/index.html
  3. 6 11
      examples/index.html
  4. 6 14
      index.html
  5. 6 11
      manual/index.html

+ 8 - 13
docs/index.html

@@ -11,18 +11,13 @@
 		<script src="../build/three.min.js" async defer></script>
 	</head>
 	<body>
-		<script type="text/javascript">
-
-			var _gaq = _gaq || [];
-			_gaq.push(['_setAccount', 'UA-86951-15']);
-			_gaq.push(['_trackPageview']);
-
-			(function() {
-				var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
-				ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-				var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
-			})();
 
+		<script async src="https://www.googletagmanager.com/gtag/js?id=G-JPPX9MZGZ4"></script>
+		<script>
+			window.dataLayer = window.dataLayer || [];
+			function gtag(){dataLayer.push(arguments);}
+			gtag('js', new Date());
+			gtag('config', 'G-JPPX9MZGZ4');
 		</script>
 
 		<div id="panel">
@@ -509,11 +504,11 @@
 			if ( currentProperties ) {
 
 				return currentProperties.pageURL + splitPageName[ 1 ];
-		
+
 			} else {
 
 				return null;
-		
+
 			}
 
 		}

+ 6 - 11
editor/index.html

@@ -10,18 +10,13 @@
 		<link rel="shortcut icon" href="../files/favicon.ico" media="(prefers-color-scheme: light)" />
 	</head>
 	<body>
-		<script type="text/javascript">
-
-		  var _gaq = _gaq || [];
-		  _gaq.push(['_setAccount', 'UA-86951-15']);
-		  _gaq.push(['_trackPageview']);
-
-		  (function() {
-		    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
-		    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-		    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
-		  })();
 
+		<script async src="https://www.googletagmanager.com/gtag/js?id=G-JPPX9MZGZ4"></script>
+		<script>
+			window.dataLayer = window.dataLayer || [];
+			function gtag(){dataLayer.push(arguments);}
+			gtag('js', new Date());
+			gtag('config', 'G-JPPX9MZGZ4');
 		</script>
 
 		<link rel="stylesheet" href="css/main.css">

+ 6 - 11
examples/index.html

@@ -9,18 +9,13 @@
 		<link rel="stylesheet" type="text/css" href="../files/main.css">
 	</head>
 	<body>
-		<script type="text/javascript">
-
-			var _gaq = _gaq || [];
-			_gaq.push(['_setAccount', 'UA-86951-15']);
-			_gaq.push(['_trackPageview']);
-
-			(function() {
-				var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
-				ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-				var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
-			})();
 
+		<script async src="https://www.googletagmanager.com/gtag/js?id=G-JPPX9MZGZ4"></script>
+		<script>
+			window.dataLayer = window.dataLayer || [];
+			function gtag(){dataLayer.push(arguments);}
+			gtag('js', new Date());
+			gtag('config', 'G-JPPX9MZGZ4');
 		</script>
 
 		<div id="panel">

+ 6 - 14
index.html

@@ -14,20 +14,12 @@
 	</head>
 	<body class="home">
 
-		<!-- <script src="//cdn.webglstats.com/stat.js" defer="defer" async="async"></script> -->
-
-		<script type="text/javascript">
-
-		  var _gaq = _gaq || [];
-		  _gaq.push(['_setAccount', 'UA-86951-15']);
-		  _gaq.push(['_trackPageview']);
-
-		  (function() {
-		    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
-		    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-		    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
-		  })();
-
+		<script async src="https://www.googletagmanager.com/gtag/js?id=G-JPPX9MZGZ4"></script>
+		<script>
+			window.dataLayer = window.dataLayer || [];
+			function gtag(){dataLayer.push(arguments);}
+			gtag('js', new Date());
+			gtag('config', 'G-JPPX9MZGZ4');
 		</script>
 
 		<div id="panel">

+ 6 - 11
manual/index.html

@@ -11,18 +11,13 @@
 		<script src="../build/three.min.js" async defer></script>
 	</head>
 	<body>
-		<script type="text/javascript">
-
-			var _gaq = _gaq || [];
-			_gaq.push(['_setAccount', 'UA-86951-15']);
-			_gaq.push(['_trackPageview']);
-
-			(function() {
-				var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
-				ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
-				var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
-			})();
 
+		<script async src="https://www.googletagmanager.com/gtag/js?id=G-JPPX9MZGZ4"></script>
+		<script>
+			window.dataLayer = window.dataLayer || [];
+			function gtag(){dataLayer.push(arguments);}
+			gtag('js', new Date());
+			gtag('config', 'G-JPPX9MZGZ4');
 		</script>
 
 		<div id="panel">