nginx and google analytics

bwellsnc bwellsnc at gmail.com
Thu Jun 23 02:39:53 MSD 2011


I am trying to find the right sub_filter settings to make nginx place
my google analytics code on all my pages.  Here is the google code:

<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-XXXXX-X']);
  _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>

If anyone has a suggestion, I would really appreciate it. Thanks!

Brent



More information about the nginx mailing list