Using Google Analytics On Different Domains

Getting accurate data is a critical part of understanding the performance of your website. Here’s how to get the right analytics when there are different domains to be considered.

Video Transcript

David: So, Tricia, you had asked a question about Google Analytics on WordPress concurrently with Shopify. Do you want to explain that?

Tricia: Let me look back at my question. So, it’s actually a GoDaddy website and Shopify. It’s not WordPress, but yes. The Shopify site is on a subdomain. I believe my understanding is that Google Analytics is going to pick up that subdomain. So, as long as I have the same code on both of those sites, we’ll get the information, and I don’t need to do anything special. Is that correct?

David: Yes, yes. Google Analytics out of the box, you can put the same code on www, a non-triple w, and a subdomain, and it will carry through the session between one domain and the subdomain.

Tricia: Okay.

David: If Shopify was installed on website.com and then websitestore.com, that would be a separate domain.

Tricia: Okay. Yes.

David: So, for this, you’d have to set up cross-domain tracking, which is yet another reason why GA4 is superior. It is really easy to set up cross-domain tracking.

Tricia: Okay.

David: I had a client that had a booking system on a third-party website. Well, we just had to tell in the back end of Google Analytics, cross-domain tracking. Consider anything that is this domain, the same domain as this, and if you see the same code on there. It actually will insert the tracking code. It’s great. It’s a lot better than it used to be.

Tricia: So, I think that was kind of what I was thinking originally. We had talked about it before. So, for example, I use Book Like a Boss for my booking, and I have my subdomain, well, I’m not sure. I might be going off on a tangent. But that would be an instance of cross-domain, right?

David: Right. If the domains change.

Tricia: If it’s different. Correct.

David: The only thing is the letters before the main URI versus, correct me, my terminology. But the domain.com, .net, .awesome, whatever, as long as that’s the same, you can install the same analytic code on any number of them, and it will pass information and keep the session together. The advantage of that is that when someone lands because of organic search and then they check out on shop.website.com, it will attribute that sale to the organic search visit. If it’s a different domain, what you’ll see is all the sales are a result of the site at which it landed, website.com, and everything would come in as referrals.

Tricia: Okay. Yeah. So, you’re better tracking.

David: Right. Another way I’ve seen this is there’s a weird way sometimes people set up Salesforce where a form will be submitted. It goes through Salesforce and even ends on the main website’s page. But because there’s just a flash of a view of the Salesforce page between the submission of the form and the confirmation page, which is almost indiscernible for humans, every lead got attributed to Salesforce because it passed through before it went back. So, all we had to do was set up cross-domain tracking. Done, fixed that. Or, in this case, we changed the way the form was submitted, and it worked just fine. But it’s important to know. It’s important to know. So, if you see your website giving you self-referring traffic that’s actually in the weekly dashboard, self-referring traffic, you know that there’s something wrong with your analytics code. And that’s why that’s a metric in the weekly Google Analytics dashboard. So, in case something comes up weird, you’re like, wait, why am I getting traffic from my own website? Yeah, that’s why.

Tricia: Right. So, if, for instance, I did find out, evidently, the main site is a GoDaddy site. I tried using Google Tag Manager, and after quite an extensive talk with them, I found that they do not have the option for GoDaddy websites to add GTM. You can only add GA4. So, the GoDaddy site has Google Analytics 4 code, and Shopify, I believe, uses Google Tag Manager. That doesn’t really matter because their Google Tag Manager has that or whatever.

David: I think it’s going to be okay. I think it’s going to be okay. The only thing that could be a weird circumstance is if you have your analytics code in Tag Manager, but other analytics code, like your phone call tracking software outside of Tag Manager, it might not be able to communicate very well. I’ve seen that before. But in this case, the Tag Manager is just serving up analytics, so there should not be a conflict.

Tricia: Yeah, for right now, that’s all.

David: That just reminds me to remind you all that it’s better for you to use Tag Manager, but you don’t have to.

Tricia: Yeah, well, I’m not saying I preferred it, but when I found out I couldn’t use it, I was like, okay.

David: Yeah, it’s not worth stressing or yelling at GoDaddy or whoever, just move on.

Tricia: I didn’t have the option for it. So, yeah.

David: Okay. I’m glad you asked. That’s actually a pretty common occurrence. So, I hope everyone here can hear that and next time they encounter it, be like, okay, I see. I know exactly what’s going on.


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.