cessda / cessda.guidelines.public

CESSDA Technical Guidelines
https://docs.tech.cessda.eu/
Creative Commons Attribution 4.0 International
0 stars 2 forks source link

Add Matomo Cloud tracking code #49

Closed cessda-bitbucket-importer closed 3 years ago

cessda-bitbucket-importer commented 3 years ago

Original report on BitBucket by John Shepherdson (GitHub: john-shepherdson).


The code snippet must list the Cloud instance as the first tracker.

On the main cessda.eu website, dual tracking is already implemented, with the full code snippet being as follows (ids have been updated for this application)

<!-- Matomo -->
<script type="text/javascript">
var _paq = window._paq = window._paq || [];
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push(["setDoNotTrack", true]);
_paq.push(['trackPageView']);
_paq.push(['enableLinkTracking']);
(function() {
var u="https://cessda.matomo.cloud/";
_paq.push(['setTrackerUrl', u+'matomo.php']);
_paq.push(['setSiteId', '5']);
var secondaryTrackerUrl = 'https://analytics.cessda.eu/matomo.php';
var secondaryWebsiteId = 5;
_paq.push(['addTracker', secondaryTrackerUrl, secondaryWebsiteId]);
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.type='text/javascript'; g.async=true; g.src='//cdn.matomo.cloud/cessda.matomo.cloud/matomo.js'; s.parentNode.insertBefore(g,s);
})();
</script>
<!-- End Matomo Code -->

cessda-bitbucket-importer commented 3 years ago

Original comment by John Admin CESSDA Admin (JWT) (GitHub: john-shepherdson).


@openconcept Can you look at this at same time as issue #52? Thanks

cessda-bitbucket-importer commented 3 years ago

Original comment by John Shepherdson (GitHub: john-shepherdson).


See commit https://github.com/cessda/cessda.documentation.theme/commit/1f665970f5544f9a3b85fc35d54e9e5d39a8a7f7

cessda-bitbucket-importer commented 3 years ago

Original comment by John Shepherdson (GitHub: john-shepherdson).


Need to check Matomo cloud to see if tracking is actually happening