]> git.parisson.com Git - django-google-tools.git/commitdiff
Adding in a lot of cool tests and making the async GA code optional.
authorClint Ecker <clintecker@clint-eckers-macbook.local>
Fri, 4 Dec 2009 22:26:12 +0000 (17:26 -0500)
committerClint Ecker <clintecker@clint-eckers-macbook.local>
Fri, 4 Dec 2009 22:26:12 +0000 (17:26 -0500)
How to use one or the other is explained in the docs.  Thanks to
Cliff Dyer for the awesome updates and tests!

Merge remote branch 'jcdyer/master'

Conflicts:
google_analytics/models.py
google_analytics/templates/google_analytics/analytics_template.html

1  2 
.gitignore
AUTHORS
google_analytics/templates/google_analytics/analytics_async_template.html
google_analytics/templates/google_analytics/analytics_template.html

diff --cc .gitignore
index 0b37ad5bb91495fed33bf298646453f44e914707,0b37ad5bb91495fed33bf298646453f44e914707..71bc41a12da681ec292b8efcd4576d7c51e66e63
@@@ -1,2 -1,2 +1,3 @@@
  *.pyc
--build
++build
++*.swp
diff --cc AUTHORS
index 0000000000000000000000000000000000000000,0000000000000000000000000000000000000000..482e586cb556c93959a92625779ab070f688a521
new file mode 100644 (file)
--- /dev/null
--- /dev/null
+++ b/AUTHORS
@@@ -1,0 -1,0 +1,9 @@@
++The primary author of thie app is:
++
++ * Clint Ecker <me@clintecker.com>
++
++There are a number of other, awesome contributors:
++
++ * Kevin Fricovsky <http://github.com/howiworkdaily>
++ * J. Cliff Dyer <http://github.com/jcdyer>
++ * Chris Adams <http://github.com/acdha>
index 0000000000000000000000000000000000000000,2c255c3d0cd5cd36e116ed3a21c7c594555cdb28..f92b7b1529956273a10f3f7528ee463d1471115d
mode 000000,100644..100644
--- /dev/null
@@@ -1,0 -1,11 +1,13 @@@
 - document.documentElement.firstChild.appendChild(ga);})();
+ <script type="text/javascript">
+ var _gaq = _gaq || [];
+ _gaq.push(['_setAccount', '{{ analytics_code }}']);
+ _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');
++ // Avoid problems if the document doesn't actually contain a HEAD element:
++ var container = document.getElementsByTagName("head")[0] || document.body;
++ container.appendChild(ga); 
+ </script>
index 4cf0288e1c74ffabdaa3216fefa496592e22f4a2,5fb5df14bbd49f3cee89f85f9f0b0d4498b479e2..42a832f938d307b9247423b0acb10942520d6956
@@@ -1,15 -1,9 +1,9 @@@
  <script type="text/javascript">
- var _gaq = _gaq || [];
- _gaq.push(['_setAccount', '{{ analytics_code }}']);
- _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');
- // Avoid problems if the document doesn't actually contain a HEAD element:
- var container = document.getElementsByTagName("head")[0] || document.body;
- container.appendChild(ga);
- })();
- </script>
+ 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"));
+ </script>
+ <script type="text/javascript">
+ var pageTracker = _gat._getTracker("{{ analytics_code }}");
+ pageTracker._initData();
+ pageTracker._trackPageview();
 -</script>
++</script>