Hello,
I have been trying to get Matomo working on my word press site that uses an ajax theme.
The developer of the theme helped me to get gtag working one page loads using this js snippet:
jQuery(document).on('pjax:complete', function() {
gtag('send', 'page_view');
});
This works fine. So I have tried to include the following after reading the Matamo guides:
jQuery(document).on('pjax:complete', function() {
_paq.push(['setDocumentTitle', 'My New Title']);
_paq.push(['trackPageView']);
});
But page views, other than the initial visit are still not being tracked, so I then tried using Matamo tag manager to create a custom tag with custom triggers. One is a history change trigger and the other a page view trigger event.
Now using this code:
jQuery(document).on('pjax:complete', function() {
window._mtm.push({'event': 'mtm.PageView'});
});
But again this still isn’t working, my js knowledge isn’t great so hoping someone can help me as I would like to make use of Matamo.
Thanks
1 post - 1 participant