Skip to content

Commit

Permalink
Merge pull request #135 from andersinno/STAM-1-update-matomo-tracking
Browse files Browse the repository at this point in the history
STAM-1: Update matomo tracking
  • Loading branch information
samimedallal authored Apr 11, 2024
2 parents 76e841a + 6e19e1d commit baf69df
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions server/Html.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,18 @@ class Html extends Component {
return null;
}
const scriptString = `
var _mtm = window._mtm = window._mtm || [];
_mtm.push({'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start'});
var d=document, g=d.createElement('script'), s=d.getElementsByTagName('script')[0];
g.async=true; g.src='https://cdn.matomo.cloud/tamperecity.matomo.cloud/container_${settings.MATOMO_CONTAINER_ID}.js'; s.parentNode.insertBefore(g,s);
var mtm = window._mtm = window._mtm || [];
mtm.push({ 'mtm.startTime': (new Date().getTime()), 'event': 'mtm.Start' });
(function () {
var scripts = ['https://cdn.matomo.cloud/tamperecity.matomo.cloud/container_dEStTJeP.js', // Cloud container
'https://matomo.tampere.fi/js/container_mgAlas5z.js']; // On-premise Container
var d = document, s = d.getElementsByTagName('script')[0];
scripts.forEach(function (src) {
var g = d.createElement('script');
g.type = 'text/javascript'; g.async = true; g.src = src;
s.parentNode.insertBefore(g, s);
});
})();
`;
return (
<>
Expand Down

0 comments on commit baf69df

Please sign in to comment.