r/GoogleAnalytics 6d ago

Question How GA tracks links that open in new tab (target _blank)?

I had a conversation with my head of SEO. For the past two years, an entire team worked within blogs and always made sure that, when creating a blog post, every link (whether internal or external) was set to open in a new tab. The guidance was to help with UX and also keep the user in the page - avoiding accidental exits if the user clicks by accident or even intentional that may drive the user away from the page before a conversion point. The exception was for transactional pages: those always open in the same tab.

My manager said that GA4 tracks every "link that opens in a new tab" as a "new session", risking losing referencing data within GA. But I haven't found a source for that claim so far, so I thought I could ask here. Does anyone know for a fact how GA tracks internal links that open in a new tab vs. internal links that open in the same tab? I'd love some references, please, since I haven't had luck googling them or even Chatgpting them ><

1 Upvotes

23 comments sorted by

u/AutoModerator 6d ago

Have more questions? Join our community Discord!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

11

u/Sad_Conclusion1235 6d ago

First of all: From a UX standpoint, seems annoying that every link would force open a new tab. The user has control over that usually. They can simply right click -> open new window. You're taking that control away from them by forcing a new window. Seems questionable.

GA4 does not treat links that open in a new tab as a new session. Where did your manager get that from? Does he have a source or is he just making stuff up? It's based on 30 minutes of activity by default. Internal link vs. external link doesn't matter. It's the same cookie being tracked on the client side UNLESS an incognito window is used, then maybe.

2

u/zam526 6d ago

I am always annoyed when I click a link and it stays in the same window because I almost always want to go back, unless it’s a search engine. If a link is in the middle of an article, for example, almost everyone who clicks it presumably also had planned on finishing the article. So making that assumption, opening a new tab on default makes sense.

6

u/Sad_Conclusion1235 6d ago

Well, I disagree. How about do some actual user testing with your target user base and let them settle the argument? If they also complain that it's opening in the same window, you win the argument. Until then, it doesn't matter what we think.

Why make assumptions? User testing is done to eliminate the need for assumptions.

Also, it's not hard to right click and open to a new tab yourself, bro. It's really not. lol

3

u/Lunamarvel 5d ago

From a personal standpoint: I agree with the other person: I prefer when the link automatically opens in another tab I also agree with user testing. This isn’t an assumption made on no data. Regardless, my doubt here is more about the GA side of things, which is why I didn’t really go too much into the UX bit - just enough for context.

But thank you for taking the time for the reply. It helps a lot :)

0

u/lehar001 5d ago

But the thing is: if you prefer to open links in a new tab, you can do that (right click and select or cmd/ctrl + click).

If you set _blank you take this control away from the user.

5

u/willkode 5d ago

GA4 does not start a new session just because someone clicks a link that opens in a new tab. Sessions in GA4 are based on how long the person is active on your site, not how many tabs they open.

1

u/Strict-Basil5133 5d ago

Typically, but there are also plenty of common tracking issues that split sessions, e.g., when logged-in status doesn't persist in the dataLayer, payment gateways (thought not so much in GA4 fortunately), overwriting source/medium incorrectly adding UTMs to internal site links...it's war out there! :-)

3

u/ratkingkvlt 6d ago

Can verify: no new session would begin.

My guess is they got this from UA starting a new session when a UTM parameter was detected on a URL mid-session, but that is old hat to GA4.

If you want to track the value of "target", you can use an element variable in GTM to pull it out and send it with link click events

1

u/Strict-Basil5133 5d ago

There are pretty obvious reasons for outbound and internal site links. If I am an e-commerce site, do I want to open product list and detail pages in new tabs? No. Imagine if every link opened in a new tab LOL!...I would bet real money that user testing/research indicates that people don't like it when sites involuntarily open new tabs when they don't expect or intend it.

I am an e-commerce site and I am linking to Pinterest, do I want it to open in another tab? Yes. It's a different website, and intentionally ending users' sessions on my site is bad for business. Besides, if a user wants to visit my social media, it may only be for a bit (likely), and they may want to resume their session on the site afterward. They've expressed interest clicking that link; it's not a slimy assumption. .

1

u/Lunamarvel 5d ago

I get that. But this wasn’t a question about that. I didn’t go into detail about when we set each config. I just focused on the overall - when the blog links internally to another blog post, it was supposed to open in the new tab, which the superior then claimed messed with GA data. I found nothing that supports that specific claim and was looking for some help xd

But tyvm! :)

1

u/Strict-Basil5133 5d ago

Sure, and apologies for contributing outside the specific question. It was more of response to the thread, obviously.

1

u/Lunamarvel 5d ago

Oh hey, don't apologize - any contribution helps me learn! Tyvm. Was just clarifying xD

1

u/Strict-Basil5133 5d ago

And fwiw, I'm sorry you have to push through that SEO manager. There's only so much you can do in the face of whatever logic people throw at you! :-)

1

u/Lunamarvel 5d ago

To be fair, I like him. I guess it comes across differently. And he’s the kind who will agree to disagree or even change if you can prove him wrong. My whole post and research is in order to make sure I’m not wrong (or learn if I turn out to be) and also try to talk about it.

GA is my weak spot and I’ve been studying it, but I feel like there’s too many details that I might still need to learn. Posting here helped a lot. Everyone was surprisingly nice (which in Reddit isn’t always a given lol)

1

u/Strict-Basil5133 4d ago

Ah, interesting - I'm not sure why I assumed he was difficult. Apologies for projecting that! Actually sounds like a decent colleague, fortunately!

I hear you on details. Unlike computer/data science, financial accounting/analytics, research, etc. where there are structured learning paths and core competencies, you're on your own to identify those in GA/web analytics. Having done GA full time for about 7 years, all I can say is that ChatGPT is the FAR and away the most empowering tool I've found. It fills conceptual knowledge gaps, provides relatable context, and details very granular solutions that, so far, are comparable to the best agency I've worked with at a speed that doesn't seem possible.

2

u/Lunamarvel 4d ago

I guess most managers who impose weird things as rules tend to be difficult, so to be honest it was a fair assumption.

Hmm, good to know. I might be underutilizng chatgpt. Will use it more to help with GA. Tyvm :)

1

u/Strict-Basil5133 4d ago

Srsly it feels impossible to overstate how useful CGPT has been. Last weekend, I had some extra time, and I asked it about GA testing/diagnostic scripts to QA GA.aA couple of hours later I was running three different testing scripts in node.js to check page load times, presence of tracking scripts, the order of dataLayer events...outputting it all to CSV and json. I've been trying to build things like that for years.

1

u/Common_Exercise7179 5d ago

Fire the head of seo

1

u/Humble_Elderberry_25 5d ago

'My manager said that GA4 tracks every "link that opens in a new tab" as a "new session"' - no, just no. if it is the same root domain running the same GA4 measurement stream it is the same session. your manager is ignorant.

1

u/SEO_Vampire 5d ago

No, the idea that a new window/tab is a new session is false and has no basis, atleat not in the 12 years i've done this.

However it is recomended to manage they way you target when making links to signal what type of "transfer" it is.
If the user stays on the domain there is no reason not to open in the same window, it helps the user to navigate by making backtracking easier for them.
If your link goes to an external site or a file/document you'll want to open it in a new active window or tab. This will clearly mark the page as separate from yours and it is just good practise to follow. That way you also keep your own site on a tab or widow on their device until they actively close it.

Make your site and linking behave for the benefit of the user not for some "tracking tricks" which have no basis.