Skip to content
Browse files

bugfix: when the user cannot access google at all (and hangs), the go…

…ogle analytics tracking code should not block the whole page from displaying.
  • Loading branch information...
1 parent be8e33c commit 0dea7cae5b9094ac41b751b2ca6392746558716c @agentzh agentzh committed
Showing with 8 additions and 4 deletions.
  1. +4 −2 utils/gen-html-index-cn.pl
  2. +4 −2 utils/gen-html-index-en.pl
View
6 utils/gen-html-index-cn.pl
@@ -29,13 +29,15 @@
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-24724965-1']);
+ _gaq.push(['_setDomainName', 'openresty.org']);
_gaq.push(['_trackPageview']);
- (function() {
+ var _gaf = (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);
- })();
+ });
+ setTimeout(_gaf, 0);
</script>
</head>
View
6 utils/gen-html-index-en.pl
@@ -30,13 +30,15 @@
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-24724965-1']);
+ _gaq.push(['_setDomainName', 'openresty.org']);
_gaq.push(['_trackPageview']);
- (function() {
+ var _gaf = (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);
- })();
+ });
+ setTimeout(_gaf, 0);
</script>
</head>

0 comments on commit 0dea7ca

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