Skip to content

Commit

Permalink
chore(matomo): Add generic Matomo script to fix stats
Browse files Browse the repository at this point in the history
  • Loading branch information
rebeccadumazert committed Feb 18, 2025
1 parent 2e9d9b8 commit 362cf9a
Showing 1 changed file with 27 additions and 3 deletions.
30 changes: 27 additions & 3 deletions assets/js/matomo.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,34 @@
var _mtm = (window._mtm = window._mtm || []);
_mtm.push({ "mtm.startTime": new Date().getTime(), event: "mtm.Start" });
var _paq = (window._paq = window._paq || []);
/* tracker methods like "setCustomDimension" should be called before "trackPageView" */
_paq.push([
"setExcludedQueryParams",
[
"login_hint",
"reset_password_token",
"id_token_hint",
"siret_hint",
"_se",
"referer",
"state",
"did_you_mean",
"magic_link_token",
"moderation_id",
"user_id",
"organization_id",
"simulationId",
"_csrf",
],
]);
_paq.push(["trackPageView"]);
_paq.push(["enableLinkTracking"]);
(function () {
var u = "https://stats.data.gouv.fr/";
_paq.push(["setTrackerUrl", u + "matomo.php"]);
_paq.push(["setSiteId", "85"]);
var d = document,
g = d.createElement("script"),
s = d.getElementsByTagName("script")[0];
g.async = true;
g.src = "https://stats.data.gouv.fr/js/container_yr4sXd50.js";
g.src = u + "matomo.js";
s.parentNode.insertBefore(g, s);
})();

0 comments on commit 362cf9a

Please sign in to comment.