Browse Source

NEW Mise à jour du code Universal Analytics et nouveau marqueur Google

julien.legrand 8 years ago
parent
commit
b1c1b11c5f
2 changed files with 11 additions and 34 deletions
  1. 0 16
      Web/CG67.FicheCollege.Web/Default.aspx
  2. 11 18
      Web/CG67.FicheCollege.Web/FicheCollege.aspx

+ 0 - 16
Web/CG67.FicheCollege.Web/Default.aspx

@@ -9,22 +9,6 @@
     <title>Fiche de synthèse collège</title>
     <link href="css/fichecollege.css" rel="stylesheet" type="text/css" />    
     <link href="css/Print.css" rel="stylesheet" type="text/css" />
-    
-    <script type="text/javascript">
-
-  var _gaq = _gaq || [];
-  _gaq.push(['_setAccount', 'UA-6108365-9']);
-  _gaq.push(['_setDomainName', '.cg67.fr']);
-  _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>
-
 </head>
 <body id="Default">
     <form id="form1" runat="server">

+ 11 - 18
Web/CG67.FicheCollege.Web/FicheCollege.aspx

@@ -9,24 +9,18 @@
     <title>Fiche collège</title>
     <link href="css/fichecollege.css" rel="stylesheet" type="text/css" />
     <link href="css/Print.css" rel="stylesheet" type="text/css" />
-    <script type="text/javascript">
-        var _gaq = _gaq || [];
-        _gaq.push(['_setAccount', 'UA-6108365-9']);
-        _gaq.push(['_setDomainName', '.cg67.fr']);
-        _gaq.push(['_trackPageview']);
+    
+    <!-- Appel à Universal Analytics -->
+    <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','https://www.google-analytics.com/analytics.js','ga');
 
-        _gaq.push(['_setCustomVar',
-      1,                   // This custom var is set to slot #1.  Required parameter.
-      'Visitor',     // The name acts as a kind of category for the user activity.  Required parameter.
-      '<%=user%>',               // This value of the custom variable.  Required parameter.
-      2                    // Sets the scope to session-level.  Optional parameter.
-        ]);
-
-        (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);
-        })();
+      ga('create', 'UA-6108365-40', 'auto');
+      ga('send', 'pageview', {
+          'Visitor': '<%=user%>'
+      });
     </script>
 
     <style media="print">
@@ -43,7 +37,6 @@
     </asp:GridView>
     <asp:XmlDataSource ID="xmlDataSourceExcel" runat="server" TransformFile="~/xslt/FicheCollege.xslt">
     </asp:XmlDataSource>
-    <WebPartPages:AllowFraming run="server" />
     </form>
 </body>
 </html>