Skip to content

Commit

Permalink
Merge pull request #17 from carpentries/add-analytics
Browse files Browse the repository at this point in the history
add matomo tracking
  • Loading branch information
zkamvar authored Feb 3, 2022
2 parents 1d24eba + 593cc2c commit 9475603
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 4 deletions.
14 changes: 10 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
Package: varnish
Title: Front-end for The Carpentries Lesson Template
Version: 0.1.1
Authors@R:
Version: 0.1.2
Authors@R: c(
person(given = "Zhian N.",
family = "Kamvar",
role = c("aut", "cre"),
email = "[email protected]",
comment = c(ORCID = "0000-0003-1458-7108"))
email = "[email protected]",
comment = c(ORCID = "0000-0003-1458-7108")),
person(given = "François",
family = "Michonneau",
role = c("ctb"),
email = "[email protected]"),
person()
)
Description: This package does nothing but contain template HTML CSS and JS files.
License: MIT + file LICENSE
Encoding: UTF-8
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# varnish 0.1.2

* Add matmo analytics in the footer (@fmichonneau, #17)

# varnish 0.1.1

* Add LICENSE file clarifying MIT licensing
Expand Down
19 changes: 19 additions & 0 deletions inst/pkgdown/templates/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,22 @@
<script>
feather.replace();
</script>
<!-- Matomo -->
<script>
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["setDocumentTitle", document.domain + "/" + document.title]);
_paq.push(["setDomains", ["*.lessons.carpentries.org","*.datacarpentry.github.io","*.datacarpentry.org","*.librarycarpentry.github.io","*.librarycarpentry.org","*.swcarpentry.github.io", "*.carpentries.github.io"]]);
_paq.push(["setDoNotTrack", true]);
_paq.push(["disableCookies"]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://carpentries.matomo.cloud/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '1']);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src='https://cdn.matomo.cloud/carpentries.matomo.cloud/matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->

0 comments on commit 9475603

Please sign in to comment.