How To Troubleshoot Google Analytics 4 Using “Hostname”

Streamline the analytics setup for your clients’ websites by using the “hostname” dimension to identify where GA4 codes are implemented across multiple properties.

Video Transcript

Tricia: Okay. So basically, I have a client that I signed on and went to get access to their Google Analytics, and they actually have two separate GA4s in their analytics account. And so, I may have a couple of parts to this question, but I’ll see. Did I miss something yet?

David: Yeah, so, no, I don’t think you did, not based on what you asked. But you said that they have several different properties for one website and that the numbers are different for each property.

Tricia: Yeah. Well, so they’ve got five properties, but two are UA, so that explains what that is.

David: Yeah.

Tricia: There’s their main GA4. Then they have a GA4 because they have… It’s a practice. Just think like an acupuncturist, where you click on the link to schedule, and it goes to a booking page. That’s not their website; it’s someone else’s booking stuff, and that has Google Analytics, but it’s a different GA4 property. So, my first question is, why? And is it recommended that it stays? What was the thought process, and what do I need to know about it? Then there’s another one that I just don’t even know what it has to do with that booking system. And I’m not even sure what that is.

David: Yeah, so you gave an example, the URL. And the booking system is on And so, then the main website, I presume, is on, right?

Tricia: Yeah.

David: And so, it sounds to me like someone set up a second analytics profile on the subdomain.

Tricia: Well, so let me see the one.

David: Or one for both and then one that’s only on the one.

Tricia: The booking site is actually not a subdomain; it is on this other booking website.

David: It’s a totally different domain?

Tricia: Yes. Correct.

David: Okay. So, let’s call that website2.

Tricia: Okay.

David: So, we’ve got website,, and

Tricia: Yes.

David: Okay. And your hypothesis is that there are three different profiles, one for each of these sites?

Tricia: So, the third one I am not sure about. We’ve got the website, which is the GA4. Then we’ve got the booking site, which is a completely different company that makes the bookings. And then there’s another one that I don’t know what it is. I don’t know at all what it is.

David: Okay, well, so what you can do, since they’re all GA4 properties, is you can create an exploration with a dimension called “hostname” and then a metric like pageviews. Over a given timeframe, the hostname will be the domain in which the analytics code was executed. It is not the page but the domain because sometimes the page excludes the domain. This is how you get the domain out of Google Analytics. So, you could create an exploration on each of these profiles, and you might learn where the Google Analytics code for each profile is living. So, it would potentially say for one of them, or maybe it’s a combination of and on another. But it sounds to me like whoever set this up didn’t understand a couple of things. Number one, because there’s a subdomain in play, they don’t understand that Google Analytics handles subdomains. No problem. You just put the same code on all subdomains, and it just tracks everything consistently. When you don’t do that, when it passes from one domain to the subdomain that they have, if they have two separate codes, all you’re going to get is all the referring traffic from the main site to the subdomain. And you lose the initial way they found you, which is presumably landing on the main site.

Tricia: Okay.

David: Right? So that hostname will help you. And then, for the mysterious one where you don’t know where it is, the host’s name is going to help you figure out where this code residency is.

Tricia: Okay.

Have a question about this process? Ask it here:

Get started doing SEO today

SEO seems hard- you have to keep up with all the changes and weed through contradictory advice. This is frustrating and overwhelming. Curious Ants will teach you SEO while bringing your website more traffic and customers- because you’ll learn SEO while doing it.