I'm currently working on a static website powered by Gatsby and hosted on AWS Amplify. We have recently integrated Piwik (Matomo) along with GA4 using gtag for analytics tracking. However, we've encountered an issue where Piwik counts page views twice for URLs that undergo a redirect from a URL without a trailing slash to a URL with a trailing slash.

To provide some context, our website has an "imprint" page accessible at example.com/imprint. We have set up a redirect rule in our Amplify configuration to ensure that when users visit example.com/imprint, they are redirected to example.com/imprint/ (with a trailing slash). This redirection is necessary for proper URL structure and SEO purposes.

The problem arises when Piwik records the page views. It counts both example.com/imprint and example.com/imprint/ as separate page views, even though they refer to the same content. Essentially, Piwik considers the redirect as two distinct page views.

We would like to find a solution to ensure that Piwik recognizes the redirect and does not count it as a separate page view. Ideally, we want to track the actual content of the page (example.com/imprint/) and avoid duplication in our analytics data.

Here are the relevant details of our setup:

Static website: Gatsby Hosting: AWS Amplify Analytics tracking: Piwik (Matomo) and GA4 (integrated via gtag) Redirect rule: Amplify configuration to redirect example.com/imprint to example.com/imprint/ Is there a way to configure Piwik or modify our setup to accurately track page views without counting the redirect as a separate page view? Any insights or suggestions would be greatly appreciated!

0

There are 0 answers