mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
- Added configurable Google analytics template
(GOOGLE_ANALYTICS='UA-XXXX-YYYY' in your settings file)
This commit is contained in:
parent
32102dae12
commit
caacf48848
2 changed files with 19 additions and 7 deletions
11
pelican/themes/notmyidea/templates/analytics.html
Normal file
11
pelican/themes/notmyidea/templates/analytics.html
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
{% if GOOGLE_ANALYTICS %}
|
||||||
|
<script type="text/javascript">
|
||||||
|
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">
|
||||||
|
try {
|
||||||
|
var pageTracker = _gat._getTracker("{{GOOGLE_ANALYTICS}}");
|
||||||
|
pageTracker._trackPageview();
|
||||||
|
} catch(err) {}</script>
|
||||||
|
{% endif %}
|
||||||
|
|
@ -74,5 +74,6 @@
|
||||||
<p>The theme is by <a href="http://smashingmagazine.com">Smashing Magazine</a>, thanks!</p>
|
<p>The theme is by <a href="http://smashingmagazine.com">Smashing Magazine</a>, thanks!</p>
|
||||||
</footer><!-- /#contentinfo -->
|
</footer><!-- /#contentinfo -->
|
||||||
|
|
||||||
|
{% include 'analytics.html' %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue