Discuss regaining access to Analytics accounts, restoring accounts, changing user access levels, and navigating the homepage
 
Guide Me
star_border
Reply

Tracking Blog Traffic

Visitor ✭ ✭ ✭
# 1
Visitor ✭ ✭ ✭

Hi there,

 

So I have a website with a blog on a subdomain.

(e.g. www.mywebsite.com & blog.mywebsite.com)

They're both using the same GA code snippet.

 

Should I separate them into different properties or views?

All of my traffic is lumped together and I can't tell what's what/

Does it matter?

 

Thanks!

1 Expert replyverified_user

Tracking Blog Traffic

Top Contributor
# 2
Top Contributor

Hi :-)
Create a new view and add the following filter, 

Filter Type: Custom filter > Advanced
Field A: Hostname Extract A: (.*)
Field B: Request URI Extract: (.*)
Output To: Request URI Constructor: $A1$B1
Click Save to create the filter.

 

Going forward as it collects data, it will prepend the hostname to the request uri so as to seperate

the pageviews for the different hostnames to tell which domain they occurred on.

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Tracking Blog Traffic

Visitor ✭ ✭ ✭
# 3
Visitor ✭ ✭ ✭

Thanks for the reply, I'll give it a shot.

Field A & B are both required, right?
Will that data look different from my normal filtered view?

Re: Tracking Blog Traffic

Top Contributor
# 4
Top Contributor

Field A & B are both required, right?

I always just leave it set at whatever the default is.. i think B is unchecked by default.

 

From the older dev docs

you will see only the request URI in the content reports, and not the top-level or sub-domain for a given page. So for example, for visits to the following pages:
http://www.example.com/index.php and another page on
http://sub.example.com/more.php
The reports will show:
— index.php
— more.php
You will not be able to distinguish which page is from which domain. To show the domain in the page reports, set a filter to include all components of the page URL, as follows:

  1. In the View (Profile) Settings page, click the Add Filter link.
  2. Choose Add New Filter and provide the filter a name.
  3. Choose Custom Filter and select Advanced on the Filter type settings.
  4. Under Advanced settings:
    1. FieldA should be set to Hostname
    2. FieldB should be set to Request URI
  5. Set the values for both Field A and Field B to (.*), which is an expression that captures all characters.
  6. Set the Output To --> Constructor option to Request URI and provide $A1$B1 as the value for that choice.

Your reports will now show:
www.example.com/index.php
sub.example.com/more.php
This will capture the www.example.com portion of your URL and include that at the beginning of your page URL in the content reports section.

Bronwyn Vourtis, Google Analytics Top Contributor
Was my response helpful? If yes, please mark it as the ‘Best Answer.’ Learn how here

Tracking Blog Traffic

Visitor ✭ ✭ ✭
# 5
Visitor ✭ ✭ ✭

That totally worked! Thanks.

I had to filter by hostname only and my previous data is still lumped, but I should have accurate numbers going forward.

Woo hoo!