Skip to content
Browse files

apply a patch for Asynchronous Tracking from Shigechika AIKAWA

  • Loading branch information...
1 parent bb0b231 commit 101f7825c4c5985f5d2c035f184d1624f0de2fbe @dragon3 committed Dec 6, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 mod_google_analytics.c
View
4 mod_google_analytics.c
@@ -46,12 +46,12 @@ limitations under the License.
#include "apr_strmatch.h"
#include "apr_strings.h"
-#define VERSION "0.2"
+#define VERSION "0.2-async"
static const char *google_analytics_filter_name = "GOOGLE_ANALYTICS";
static const char *body_end_tag = "</body>";
static const unsigned int body_end_tag_length = 7;
-static const char *replace_base = "<script type=\"text/javascript\"><!-- \n var gaJsHost = ((\"https:\" == document.location.protocol) ? \"https://ssl.\" : \"http://www.\");document.write(unescape(\"%%3Cscript src='\" + gaJsHost + \"google-analytics.com/ga.js' type='text/javascript'%%3E%%3C/script%%3E\"));\n//--></script><script type=\"text/javascript\"><!-- \n try {var pageTracker = _gat._getTracker(\"%s\");pageTracker._trackPageview();} catch(err) {}; \n//--></script></body>";
+static const char *replace_base = "<script type=\"text/javascript\"><!--\n var _gaq = _gaq || [];\n _gaq.push(['_setAccount', '%s']);\n _gaq.push(['_trackPageview']);\n (function() {\n var ga = document.createElement('script');\n ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';\n ga.setAttribute('async', 'true');\n document.documentElement.firstChild.appendChild(ga);\n })();\n--></script>\n</head>";
static const char *tag_exists = "google-analytics\\.com/(ga|urchin)\\.js";
static const ap_regex_t *regex_tag_exists;
static const apr_strmatch_pattern *pattern_body_end_tag;

0 comments on commit 101f782

Please sign in to comment.
Something went wrong with that request. Please try again.