Why anchor (hash) clicks remove the query string in the Url

Viewed 185

The marketing platform I am using is adding a query string to my page Urls. Here's an example how it is adding the string to my index.html:

https://www.example.com/index.html?SessionGuid=5365jh-49eb-2547-9865-b4c34aed8c94

I have these anchor links in the main navigation, they jump up and down the page to different sections, here's an example:

<a class="nav-link" href="#rankings">Rankings</a>

Now when the nav link is clicked, the page jumps to the correct area but the query string is getting removed from the URL and the Url changes to this:

https://www.example.com/index.html#rankings

But the # should be added at the end of the Url and the Url should look like this:

https://www.example.com/index.html?SessionGuid=5365jh-49eb-2547-9865-b4c34aed8c94#rankings

What am I missing? Why does the # click remove the ?SessionGuid= query string in the Url?

0 Answers
Related