Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r58126 - website/public_html/beta/doc
From: daniel_james_at_[hidden]
Date: 2009-12-03 15:16:25


Author: danieljames
Date: 2009-12-03 15:16:22 EST (Thu, 03 Dec 2009)
New Revision: 58126
URL: http://svn.boost.org/trac/boost/changeset/58126

Log:
Use asynchronous google analytics.
Text files modified:
   website/public_html/beta/doc/display_build.php | 35 +++++++++++++++++++++++------------
   website/public_html/beta/doc/display_jam.php | 20 +++++++++++++-------
   2 files changed, 36 insertions(+), 19 deletions(-)

Modified: website/public_html/beta/doc/display_build.php
==============================================================================
--- website/public_html/beta/doc/display_build.php (original)
+++ website/public_html/beta/doc/display_build.php 2009-12-03 15:16:22 EST (Thu, 03 Dec 2009)
@@ -3,16 +3,22 @@
 
 function add_boost_build_analytics($content) {
     $analytics = <<<EOS
-<script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
-</script>
 <script type="text/javascript">
-_uacct = "UA-2917240-2";
-urchinTracker();
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-2917240-2']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script');
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ ga.setAttribute('async', 'true');
+ document.documentElement.firstChild.appendChild(ga);
+ })();
 </script>
 EOS;
 
     return stripos($content, '_uacct = "UA-2917240-2"') !== FALSE ? $content :
- str_ireplace('</body>', $analytics.'</body>', $content);
+ str_ireplace('</head>', $analytics.'</head>', $content);
 }
 $_file = new boost_archive('@^[/]([^/]+)[/](.*)$@',$_SERVER["PATH_INFO"],array(
   //~ array(version-regex,path-regex,raw|simple|text|cpp|boost_book_html|boost_libs_html,mime-type[,preprocess hook]),
@@ -42,7 +48,18 @@
 }
   /*]]>*/
   </style>
-
+<script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-2917240-2']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script');
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ ga.setAttribute('async', 'true');
+ document.documentElement.firstChild.appendChild(ga);
+ })();
+</script>
 </head><!-- <?php print $_file->file_; ?> -->
 
 <body>
@@ -85,11 +102,5 @@
 
     <div class="clear"></div>
   </div>
- <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
- </script>
- <script type="text/javascript">
- _uacct = "UA-2917240-2";
- urchinTracker();
- </script>
 </body>
 </html><?php } ?>
\ No newline at end of file

Modified: website/public_html/beta/doc/display_jam.php
==============================================================================
--- website/public_html/beta/doc/display_jam.php (original)
+++ website/public_html/beta/doc/display_jam.php 2009-12-03 15:16:22 EST (Thu, 03 Dec 2009)
@@ -19,6 +19,18 @@
   <!--[if IE 7]> <style type="text/css"> body { behavior: url(/style/csshover3.htc); } </style> <![endif]-->
   <?php #~ pwn_head(); ?>
 
+<script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', 'UA-2917240-2']);
+ _gaq.push(['_trackPageview']);
+
+ (function() {
+ var ga = document.createElement('script');
+ ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+ ga.setAttribute('async', 'true');
+ document.documentElement.firstChild.appendChild(ga);
+ })();
+</script>
 </head><!-- <?php print $_file->file_; ?> -->
 
 <body>
@@ -68,12 +80,6 @@
     </div>
 
     <div class="clear"></div>
- </div>
- <script src="http://www.google-analytics.com/urchin.js" type="text/javascript">
- </script>
- <script type="text/javascript">
- _uacct = "UA-2917240-2";
- urchinTracker();
- </script>
+ </div>
 </body>
 </html><?php } ?>


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk