add piwik code
This commit is contained in:
parent
7f26d11afa
commit
36565ea168
4 changed files with 25 additions and 0 deletions
|
@ -103,3 +103,7 @@ footer_accounts:
|
|||
- instagram
|
||||
- youtube
|
||||
- flickr
|
||||
|
||||
piwik:
|
||||
url: piwik.theorangeone.net
|
||||
site_id: 1
|
||||
|
|
|
@ -34,6 +34,7 @@ REPO = Repo(search_parent_directories=True)
|
|||
BUILD_PRODUCTION = 'BUILD_PRODUCTION' in os.environ
|
||||
from plugins import image_resizer
|
||||
META_IMAGES = image_resizer.generate()
|
||||
PIWIK = settings.piwik
|
||||
|
||||
# Disable some pages
|
||||
TAG_URL = False
|
||||
|
|
|
@ -18,6 +18,8 @@
|
|||
<title>{% block htmltitle %}Page{% endblock %} - {{ SITENAME }}</title>
|
||||
|
||||
<link rel="stylesheet" href="/static/css/index.css" type="text/css" />
|
||||
|
||||
{% include "extras/piwik.html" with context %}
|
||||
</head>
|
||||
<body id="page-top">
|
||||
{% block navbar %}
|
||||
|
|
18
theme/templates/extras/piwik.html
Normal file
18
theme/templates/extras/piwik.html
Normal 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 %}
|
Reference in a new issue