Keep url clean
Melvin Jones Repol

Melvin Jones Repol @mrepol742

About: Software Engineer | Full Stack Web Developer | SEO | Data Analytics | Embedded System Design with Arduino Programming | Hardware and Software Troubleshooting | PWA

Location:
Caloocan City, Philippines
Joined:
Jan 15, 2022

Keep url clean

Publish Date: Jul 11 '22
4 2

We liked to use url params such as utm source, ref and custom one. But leaving it like that makes the url lenght quite long for example Searching on google then clicking on a particular content google will highlight it for you to see it easily but it append a data in the url like:

http://mrepol742.github.io/webvium#:~:text=webvium

Webvium

Also utm like http://mrepol742.github.io/?utm_source=dev.to&utm_medium=blog

And personally it wasnt look cool.

It's possible to remove the url parameters by using replaceState from window.historu as follows:

what it does is to replace the current url using the window.location.pathname leaving with clean and easy to read url.

Comments 2 total

  • Ben Sinclair
    Ben SinclairJul 11, 2022

    Browsers are starting to remove spam and tracking links these days anyway, so hopefully those days will be over soon.

    • Melvin Jones Repol
      Melvin Jones RepolJul 11, 2022

      yes bro and btw thats a good idea.. im working on my personal project browser for android i would say removing known tracker like utm is such a great idea.. i will look into it.. as of this moment what ive achieved in blocking tracking is by identifying the resources url if it links or says that is related to analytics tracking etc... i also do the same thing on ads but if they hosted the tracking on there own i dont know then probably allow users to add custom domain to be block.

Add comment