AdWords is now Google Ads. Our new name reflects the full range of advertising options we offer across Search, Display, YouTube, and more. Learn more

Analytics
1.9K members online now
1.9K members online now
Dive into multiple domain (Cross/Sub) tracking, implementing Ecommerce and Enhanced Ecommerce, setting up Event tracking, and Universal Analytics code.
 
Guide Me
star_border
Reply

Cross domain with Cloudflare?

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I'm wondering if I can do cross-domain analytics when the "front end" to the sites is Cloudflare, which, as you probably know, does its own thing with Analytics, as you enter the analytics ID into Cloudflare and then it injects analytics.js into the page.

 

So, here's an example setup - multiple subdomains, across 3 "main" domains, which are related to what the charity does.

(I'm giving this background info in case someone says "but why don't you do it this other way instead!).

 

charity1.site1.org

charity2.site1.org

charity3.site2.org

charity4.site3.org

 

All unique content from different charities, but templated. In an ideal world, I'd like to be able to seperate out the analytics from different domains, but use the same tracking code. I don't really want to have to make multiple analytics properties for each subdomain. I'm not making any money out of it, so the less time the better!

 

If this is possible, would someone mind pointing me in the right direction? Thanks!

1 Expert replyverified_user

Re: Cross domain with Cloudflare?

Top Contributor
# 2
Top Contributor
Hi Jonathan,

as long as you can add some additional code to tracking there should be no problem in setting up cross domain tracking.

1. Cross domain tracking
Use this as the starting point - https://support.google.com/analytics/answer/1034342?hl=en#GA

2. Reporting per domain / subdomain and one aggregate reporting view
In your case instead of creating multiple properties you have one yet you would need to have multiple views where
a) one would report all data from all domains / sub domains (hostname in URI filter may be useful)
b) multiple views would report on each subdomain / domain (use include hostname filter for each of those views)
c) RAW view (no filters applied)

Hope it helps!

Kind regards,
Zorin
Web analyst @ escapestudio.net

Re: Cross domain with Cloudflare?

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Hi Zorin, and thanks for your reply.


@Zorin Escape wrote:
as long as you can add some additional code to tracking there should be no problem in setting up cross domain tracking.

No, I'm afraid it's not possible to modify the ga code that is injected by Cloudflare, so it' sounds like this isn't possible.

 

But thanks for the other information; I'll have to find another way round it, but again, thank you for the response.