mirror of
https://github.com/hendrikschneider/jekyll-analytics
synced 2024-11-21 19:23:04 +00:00
Added Matomo tracking pixel
This commit is contained in:
parent
da24705b17
commit
9ca90d930f
3 changed files with 23 additions and 11 deletions
|
@ -1,7 +1,7 @@
|
|||
|
||||
Gem::Specification.new do |s|
|
||||
s.name = 'jekyll-analytics'
|
||||
s.version = '0.1.11'
|
||||
s.version = '0.1.12'
|
||||
s.date = '2018-05-04'
|
||||
s.summary = "Jekyll plugin "
|
||||
s.description = "Plugin to easily add web analytics to your jekyll site without modifying your templates. Supported are: Google Analytics, Piwik, Matomo, MPulse"
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
class Matomo
|
||||
SETUP_CODE = """
|
||||
<!-- Matomo -->
|
||||
|
||||
<!-- Matomo Image Tracker -->
|
||||
<img src=\"%{url}?idsite=%{siteId}&rec=1\" style=\"border:0\" alt=\"\" />
|
||||
<!-- End Matomo -->
|
||||
|
||||
|
||||
<script type=\"text/javascript\">
|
||||
var _paq = _paq || [];
|
||||
_paq.push(['trackPageView']);
|
||||
|
|
|
@ -13,17 +13,23 @@ class MatomoTest < Test::Unit::TestCase
|
|||
assert_equal(matomoAnalytics.render(),
|
||||
"""
|
||||
<!-- Matomo -->
|
||||
|
||||
<!-- Matomo Image Tracker -->
|
||||
<img src=\"my.matomo.server/path?idsite=1&rec=1\" style=\"border:0\" alt=\"\" />
|
||||
<!-- End Matomo -->
|
||||
|
||||
|
||||
<script type=\"text/javascript\">
|
||||
var _paq = _paq || [];
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u=\'//\'+\"my.matomo.server/path\";
|
||||
_paq.push(['setTrackerUrl', u+'/piwik.php']);
|
||||
_paq.push(['setSiteId', '1']);
|
||||
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);
|
||||
})();
|
||||
var _paq = _paq || [];
|
||||
_paq.push(['trackPageView']);
|
||||
_paq.push(['enableLinkTracking']);
|
||||
(function() {
|
||||
var u=\'//\'+\"my.matomo.server/path\";
|
||||
_paq.push(['setTrackerUrl', u+'/piwik.php']);
|
||||
_paq.push(['setSiteId', '1']);
|
||||
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>
|
||||
<!-- End Matomo Code -->
|
||||
""")
|
||||
|
|
Loading…
Reference in a new issue