Feature request: Option to combine stats for pages with and without trailing slashes #336
Replies: 9 comments 12 replies
-
Thanks for the suggestion, I've noticed this myself on https://plausible.io/docs.plausible.io/pages If possible, I think the best solution is to change the website itself to redirect to ensure a consistent URL style. If not then I agree, there should be a way to merge analytics for paths with trailing slash and ones without. |
Beta Was this translation helpful? Give feedback.
-
The problem is not with the website itself, the problem is with third party services that manipulate the URLs. For instance, my website has all the endpoints without the final slash, but I submit some URLs of my site to third party services that alter them, and then serve the same URL with a final slash. That's why I think that's very critical to add an option to merge this kind of URLs, to have reliable stats. |
Beta Was this translation helpful? Give feedback.
-
Is there an option to set the "pageview url" that's being tracked? That could enable developers to set the url for pageviews to the canonical for example. |
Beta Was this translation helpful? Give feedback.
-
@davidsteeb Not at the moment. Makes sense to add that option though |
Beta Was this translation helpful? Give feedback.
-
Having the same issue. Many frameworks on the frontend produce URLs without trailing slashes when doing history transitions, whereas if someone visits the URL directly the backend tooling (whether it is Netlify router or Heroku static buildpack) adds the slash. Would be super cool to have some toggle in the settings whether to merge these or not. +1 to that! |
Beta Was this translation helpful? Give feedback.
-
At least from the SEO perspective, this should be done on the site itself as having two versions of the same page (http or https, www or non-www, / or non-/) can be treated by Google as two different pages which can cause the duplicate content penalty from the search algorithm. Something like this in the .htacess file fixes the trailing slash (most CMS have this sorted out of the box too): RewriteCond %{REQUEST_FILENAME} !-d We could fix this automatically in our reports (combine them both into one) but the issue still remains for the site which should be fixed. (more info: https://ahrefs.com/blog/trailing-slash/) |
Beta Was this translation helpful? Give feedback.
-
Does anyone have a 1-off script to update the existing records that have the trailing slash after I added the Rewrite rule to the htaccess? I don't know enough about the Plausible setup to do it. I tried searching postgres tables but it seems like it's not stored there |
Beta Was this translation helpful? Give feedback.
-
Any updates / ETA / suggestions on this? |
Beta Was this translation helpful? Give feedback.
-
I started to use Plausible today for The only things that nags me so far is the fact that Plausible treats To work around this issue on my end, I can either configure an HTTP redirect from |
Beta Was this translation helpful? Give feedback.
-
Precheck
Please note that this tracker is only for feature requests. Do not use the issue tracker for help or support. Our docs are a great place for most answers, but if you can’t find your answer there, you can contact us. Have an issue with your self-hosted install? You can ask in our community forum. Thanks!
Prerequisites
Feature request
Is your feature request related to a problem? Please describe.
My website does not add trailing slashes to the end of each URL (e.g., example.com/hello vs example.com/hello/). Plausible counts them separately. For example, see https://plausible.io/docs.plausible.io/pages
How would you like it to work
I would like an option to combine the stats for pages with and without trailing slashes
Screenshots (If applicable)
If applicable, add screenshots to help explain the proposed solution.
Beta Was this translation helpful? Give feedback.
All reactions