Skip to content
Permalink
Browse files
Add GA tracking to docs, only when not local
  • Loading branch information
Noah Slater committed Apr 10, 2014
1 parent 9d61faf commit 5db4eed2af58e04fc76cb2f373a800cf9beca2ba
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
@@ -106,7 +106,9 @@
'index': 'pages/index.html'
}

html_context = {}
html_context = {
"ga_code": "UA-658988-6"
}

html_sidebars = {
"**": [
@@ -115,6 +117,7 @@
"relations.html",
"utilities.html",
"help.html",
"tracking.html",
]
}

@@ -16,9 +16,9 @@
<h3>More Help</h3>

<ul>
<li><a href="https://couchdb.apache.org/">Homepage</a></li>
<li><a href="https://couchdb.apache.org/"{% if not local %} onclick="_gaq.push(['_link', 'https://couchdb.apache.org/']); return false;"{% endif %}>Homepage</a></li>
<li><a href="http://wiki.apache.org/couchdb/">Wiki</a></li>
<li><a href="https://couchdb.apache.org/#mailing-list">Mailing Lists</a></li>
<li><a href="https://couchdb.apache.org/#mailing-list"{% if not local %} onclick="_gaq.push(['_link', 'https://couchdb.apache.org/#mailing-list']); return false;"{% endif %}>Mailing Lists</a></li>
<li><a href="http://webchat.freenode.net/?channels=couchdb">IRC</a></li>
<li><a href="https://issues.apache.org/jira/browse/CouchDB">Issues</a></li>
<li><a href="{{ pathto('download') }}">Download</a></li>
@@ -0,0 +1,15 @@
{% if not local %}
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{ ga_code }}']);
_gaq.push(['_setDomainName', 'couchdb.org']);
_gaq.push(['_setAllowLinker', true]);
_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>
{% endif %}

0 comments on commit 5db4eed

Please sign in to comment.