1
Fork 0

add piwik code

This commit is contained in:
Jake Howard 2016-10-07 22:02:09 +01:00
parent 7f26d11afa
commit 36565ea168
Signed by: jake
GPG key ID: 57AFB45680EDD477
4 changed files with 25 additions and 0 deletions

View file

@ -103,3 +103,7 @@ footer_accounts:
- instagram - instagram
- youtube - youtube
- flickr - flickr
piwik:
url: piwik.theorangeone.net
site_id: 1

View file

@ -34,6 +34,7 @@ REPO = Repo(search_parent_directories=True)
BUILD_PRODUCTION = 'BUILD_PRODUCTION' in os.environ BUILD_PRODUCTION = 'BUILD_PRODUCTION' in os.environ
from plugins import image_resizer from plugins import image_resizer
META_IMAGES = image_resizer.generate() META_IMAGES = image_resizer.generate()
PIWIK = settings.piwik
# Disable some pages # Disable some pages
TAG_URL = False TAG_URL = False

View file

@ -18,6 +18,8 @@
<title>{% block htmltitle %}Page{% endblock %} - {{ SITENAME }}</title> <title>{% block htmltitle %}Page{% endblock %} - {{ SITENAME }}</title>
<link rel="stylesheet" href="/static/css/index.css" type="text/css" /> <link rel="stylesheet" href="/static/css/index.css" type="text/css" />
{% include "extras/piwik.html" with context %}
</head> </head>
<body id="page-top"> <body id="page-top">
{% block navbar %} {% block navbar %}

View file

@ -0,0 +1,18 @@
{% if BUILD_PRODUCTION %}
<!-- Piwik -->
<script type="text/javascript">
var _paq = _paq || [];
_paq.push(["setDomains", ["*.theorangeone.net"]]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="//{{ PIWIK.url }}/";
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['setSiteId', '{{ PIWIK.site_id }}']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.defer=true; g.src=u+'piwik.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<noscript><p><img src="//{{ PIWIK.url }}/piwik.php?idsite={{ PIWIK.site_id }}" style="border:0;" alt="" /></p></noscript>
<!-- End Piwik Code -->
{% endif %}