I am trying to open a url in a new tab with some custom parameters, but the custom parameters never show when opening the page.
Example given: we have a url that already contains parameters. If we use window.open like this it works as intended and opens the url:
const myUrl = "https://play.google.com/store/apps/details?id=com.spotify.music&hl=nl&gl=US"
window.open(myUrl, "_blank")
But when i try to do something like this it just opens "https://play.google.com/store/apps/details?id=com.spotify.music&hl=nl&gl=US" again and ignores / removes the parameters i added:
const customUrl = `${myUrl}&foo=${encodeURIComponent(params!.foo)}&bar=${encodeURIComponent(params!.bar)}`
I have gone through numerous topics already but I have not found a solution. I tried with and without the encodeURIComponent, replacing '&' with '&' and also while not using string interpolation. Am i missing something?