diff options
| author | Vojta Jina | 2011-05-25 14:00:12 +0200 |
|---|---|---|
| committer | Igor Minar | 2011-06-06 22:52:02 -0700 |
| commit | 350ee3110748eed64565bdfe8afd5dc6cbe3641d (patch) | |
| tree | 045da814b64bd8ade8145a25322ba8874fe55dfa /docs/src/templates | |
| parent | 2da07127e45312ce22d894aa771b8797e9a301a1 (diff) | |
| download | angular.js-350ee3110748eed64565bdfe8afd5dc6cbe3641d.tar.bz2 | |
Google Analytics - basic page tracking for docs
Diffstat (limited to 'docs/src/templates')
| -rw-r--r-- | docs/src/templates/docs.js | 3 | ||||
| -rw-r--r-- | docs/src/templates/index.html | 13 |
2 files changed, 15 insertions, 1 deletions
diff --git a/docs/src/templates/docs.js b/docs/src/templates/docs.js index 47d294c3..244ccce1 100644 --- a/docs/src/templates/docs.js +++ b/docs/src/templates/docs.js @@ -47,7 +47,8 @@ function DocsController($location, $browser, $window) { this.afterPartialLoaded = function() { SyntaxHighlighter.highlight(); - window.scrollTo(0,0); + $window.scrollTo(0,0); + $window._gaq.push(['_trackPageview', $location.hashPath.replace('!', '/')]); }; this.getFeedbackUrl = function() { diff --git a/docs/src/templates/index.html b/docs/src/templates/index.html index 117723b2..9bdf977b 100644 --- a/docs/src/templates/index.html +++ b/docs/src/templates/index.html @@ -9,6 +9,10 @@ <link rel="stylesheet" href="docs-combined.css" type="text/css"/> <link rel="stylesheet" href="syntaxhighlighter/syntaxhighlighter-combined.css" type="text/css"/> <script> + // GA asynchronous tracker + var _gaq = _gaq || []; + _gaq.push(['_setAccount', 'UA-8594346-3']); + /*! * $script.js v1.3 * https://github.com/ded/script.js @@ -84,5 +88,14 @@ <br class="clearFloat" /> <div id="twoColFooter">© 2010-2011 angular</div> </div> + + <script type="text/javascript"> + // lazy load GA asynchronous tracker + (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> </body> </html> |
