Skip to content

Commit

Permalink
matomo script
Browse files Browse the repository at this point in the history
  • Loading branch information
dietrichmax committed Feb 9, 2024
1 parent 01c8155 commit 7a9ff2a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,11 @@ export default function App(props) {
};

const trackPageviewMatomo = () => {
_paq.push(["setCustomUrl", pathname]);
_paq.push(['setDocumentTitle', document.title]);
_paq.push(['trackPageView']);
if (window.location.href.includes(config.domain)) {
_paq.push(["setCustomUrl", pathname]);
_paq.push(['setDocumentTitle', document.title]);
_paq.push(['trackPageView']);
}
}

useEffect(() => {
Expand Down

0 comments on commit 7a9ff2a

Please sign in to comment.