mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-26 20:56:48 +00:00
14 lines
350 B
JavaScript
14 lines
350 B
JavaScript
// Call Matomo on asynchronous page loads
|
|
["turbo:load", "ujs:afterMorph"].forEach((listener) =>
|
|
document.addEventListener(listener, (event) => {
|
|
if (
|
|
typeof event?.detail?.timing === "object" &&
|
|
Object.keys(event?.detail?.timing).length === 0
|
|
) {
|
|
return;
|
|
}
|
|
|
|
window._mtm?.push({ event: "mtm.PageView" });
|
|
}),
|
|
);
|