Only include Google Analytics markup if an account has been entered
parent
f521f8a9ec
commit
64083d6f39
|
@ -1,14 +1,16 @@
|
||||||
<!-- Google Analytics -->
|
{% if site.google_analytics %}
|
||||||
<script type="text/javascript">
|
<!-- Google Analytics -->
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
var _gaq = _gaq || [];
|
var _gaq = _gaq || [];
|
||||||
_gaq.push(['_setAccount', '{{ site.google_analytics }}']);
|
_gaq.push(['_setAccount', '{{ site.google_analytics }}']);
|
||||||
_gaq.push(['_trackPageview']);
|
_gaq.push(['_trackPageview']);
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
|
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';
|
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);
|
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
|
||||||
})();
|
})();
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
{% endif %}
|
Loading…
Reference in New Issue