Skip to content

Commit

Permalink
[Just-Read] Conditionally enable Google Analytics
Browse files Browse the repository at this point in the history
As I personally don't have Google Analytics, I don't want to load the
script with empty default values.
  • Loading branch information
schtobia committed Oct 2, 2017
1 parent 63937f0 commit 4551ab6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Just-Read/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,13 @@ <h1 class="huge"><a href="{{ SITEURL }}">{{ SITENAME }}</a></h1>
Proudly powered by <a href="http://alexis.notmyidea.org/pelican/">Pelican</a>.</p>
</div>
</footer>

{% if GOOGLE_ANALYTICS %}
<script>
var _gaq=[['_setAccount','{{ GOOGLE_ANALYTICS }}'],['_trackPageview']];
(function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];
g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js';
s.parentNode.insertBefore(g,s)}(document,'script'));
</script>
{% endif %}
</body>
</html>

0 comments on commit 4551ab6

Please sign in to comment.