Analytics
5.3K members online now
5.3K members online now
Ask questions about filter set-up and issues with using filters in Google Analytics reports
 
Guide Me
star_border
Reply

Combine data from two subdomains

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

I am trying to combine data from two subdomains into one Google Analytics view (but there are some other complicating factors - see below).

 

We have the following setup in Google Analytics:

 

UA code for Texas

- View for houston.company123.com

- View for dallas.company123.com

- View for austin.company123.com

- etc.

 

UA code for California

- View for losangeles.company123.com

- View for sandiego.company123.com

 

UA code for Nevada

- View for lasvegas.company123.com

- View for reno.company123.com

 

But, we also take pay-per-click visitors to a different subdomain.

 

So, if we take our Austin location as an example:

 

We have traffic going to our main site - austin.company123.com .

Then we also take Austin's pay-per-click traffic to - pages.company123.com/austin  (austin is always in the URL for the Austin pay-per-click landing pages)

 

So my question is, can I use one or more Google Analytics filters within the Google Analytics view for austin.company123.com that:

> Brings in the data only for the visitors that go to austin.company123.com AND the visitors that go to pages.company123.com/austin

(so it excludes the visitors from houston.company123.com and dallas.company123.com who share the same UA code)

 

Thanks very much.

 

 

1 Expert replyverified_user
1 ACCEPTED SOLUTION

Accepted Solutions
Marked as Best Answer.
Solution
Accepted by topic author Mark K
June 2016

Re: Combine data from two subdomains

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Thanks very, very much Zorin. You were basically right, thanks very much.

In our case, we needed to show the full URLs in the Google Analytics view (as you mentioned).

And then in the next filter we just needed to have a custom advanced include filter that just had - austin - that's it.

The tricky thing was that the order of the filters matters. The "Show Full URLs" filter had to be above the "austin include" filter.

The filters ended up like this:

First Filter:

Show Full URLs filter:

Custom Advanced Filter
Field A --> Extract A
Hostname: (.*)

Field B --> Extract B
Request URI: (.*)

Output To --> Constructor
Request URI: $A1$B1

Check the Field A Required box
Check the Override Output Field box

Second filter:

"Include only visitors with austin in URL somewhere"

Custom Include Filter

Filter Field: Request URI

Filter Pattern: austin

That did the trick.

Thanks again very much.

View solution in original post

Re: Combine data from two subdomains

Top Contributor
# 2
Top Contributor
Hi Mark,

you can explicitly include traffic from two or more subdomains / domains inside a view by using a Custom Include Filter using a Filter field > Hostname. In your case it is a bit more complex as you also use a part of the path. So:
1. Create a view filter where you add hostname to URI
2. Create a view fillter which uses Request URI and includes austin\.company123\.com|pages\.company123\.com/austin (there is probably a more simple regex for this but would need a live example for that)

In any case test the setup by creating a new test view and after a successful testing period implement to a production / reporting view. This procedure will only work if both abc and pages subdomain data is collected inside the same GA property.

Hope it helps.

Kind regards,
Zorin
Web analyst @ escapestudio.net
Marked as Best Answer.
Solution
Accepted by topic author Mark K
June 2016

Re: Combine data from two subdomains

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭
Thanks very, very much Zorin. You were basically right, thanks very much.

In our case, we needed to show the full URLs in the Google Analytics view (as you mentioned).

And then in the next filter we just needed to have a custom advanced include filter that just had - austin - that's it.

The tricky thing was that the order of the filters matters. The "Show Full URLs" filter had to be above the "austin include" filter.

The filters ended up like this:

First Filter:

Show Full URLs filter:

Custom Advanced Filter
Field A --> Extract A
Hostname: (.*)

Field B --> Extract B
Request URI: (.*)

Output To --> Constructor
Request URI: $A1$B1

Check the Field A Required box
Check the Override Output Field box

Second filter:

"Include only visitors with austin in URL somewhere"

Custom Include Filter

Filter Field: Request URI

Filter Pattern: austin

That did the trick.

Thanks again very much.

Re: Combine data from two subdomains

Top Contributor
# 4
Top Contributor
Happy to help!

Kind regards,
Zorin
Web analyst @ escapestudio.net