Next.js Discord

Discord Forum

<Link> and <a> behavior with target blank adds Google Tag Manager / Google Analytics URL Parameters.

Unanswered
Manchester Terrier posted this in #help-forum
Open in Discord
Manchester TerrierOP
Hello I have noticed the following behavior with the <Link> component and <a> element when Google Tag Manager and Google Analytics installed.


1) If the href is internal and has target="_blank", when open in new tab it’s URL get parameters like this :

?_gl=1p1je79_upMQ.._gaNTMxOTQ2NDkyLjE3NTcwODU0MTM._ga_LYWKDH6QTJ*czE3NTcwODU0MTMkbzEkZzAkdDE3NTcwODU0MTMkajYwJGwwJGgw

2) If href is external has target="_blank" , when open in new tabs it’s normal


I want to be able to use target="_blank" with out the GA parameter being passed in the URL.

Is there a simple way of solving this without having to look through GTM / GA Admin for every website I make? Is there even a solution for this?

5 Replies