mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-26 20:56:48 +00:00
11 lines
333 B
JavaScript
11 lines
333 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" });
|
|
})
|
|
);
|