simpleanalytics / roadmap

File you bugs and feature requests here
23 stars 2 forks source link

Don't remove slashes from URL-s (or add slashes and modify URLs) #627

Open simpleanalyticsbot opened 2 years ago

simpleanalyticsbot commented 2 years ago

I don't like the feature (this should be the bug actually) that SA removes trailing slashes from URL-s. It is not the job of the analytics app to modify URL in any way.

It is up to individual website to create URL structure and redirects as it wants, analytics should not make wrong assumption how URL should look like.

For SEO purpose Google explicitly states that it treats URLs separately and equally. So you can actually have different content on /page and /page/ URL (bad practice perhaps, but still, you can). SA would treat this as single page which is wrong.

If you use trailing slashes on your web site, all the URLs SA displays might be non-existing URLs actually , and if you click on such URL from SA you might get 404 error (if you haven't made any redirection on your website) which cause confusion and bad UX in my case while I use SA.

Also, by accident you might have both /page and /page/ returning the same content which is bad for SEO and duplicated content. I usually spot this mistakes in Google Analytics when I see both /page and /page/ in reports and then I apply redirect to force only one page. With SA I can't do that since SA will trim the slash from URL if exists and I don't actually know what is the exact URL user visited.

adriaandotcom commented 2 years ago

I think we should make this optional indeed. Replied to you by email.

paulsavage commented 2 years ago

New to SA, so apologies if it's a configuration issue.

I'm not sure if this is still the case, but just in case it is, here is another vote for this.

In this case the page is at mydomain.com/mypage/subpage/ but it's displayed in SA as mydomain.com/mypage/subpage

image

Clicking on the blue link icon

image

Points to mydomain.com/mypage/subpage which (in my case) doesn't exist.

To fix this I need to do some .htaccess fun, so that someone will be directed to the actual page mydomain.com/mypage/subpage/ when they click on the link to mydomain.com/mypage/subpage