Jump to content


Photo
- - - - -

Hostname Filter + Very Basic Regex Tutorial


  • Please log in to reply
3 replies to this topic

#1 rachaelgerson

rachaelgerson

    Member

  • Members
  • PipPip
  • 6 posts

Posted 05 June 2012 - 08:52 AM

All it takes is for one site to post your same GA code to their site (whether unintentionally or maliciously) and you'll suddenly have data for an additional site skewing all of your good data. For this reason, a best practice is to add a hostname filter to the GA profiles you'll be reporting on.

Hostname.png

Use RegEx for this filter - it'll be your best friend! Since it's so useful here, let's do a very quick crash course in the characters you need to know:
  • ^ - Starts with
  • $ - Ends with
  • \ - To make the period not a RegEx, but an actual period
  • | - Or
  • ( ) - Grouping
If we know that our hostname filter should include both www.seerinteractive.com and www.searchchurch.com (assuming both sites use the same UA and we want to report on them together), we could use this RegEx:
  • ^www\.(seerinteractive|searchchurch)\.com$
If we only need the one hostname, www.seerinteractive.com, we could just make this RegEx:
  • ^www\.seerinteractive.com$
And if the site also had a blog on a separate subdomain, we could do this:
  • ^(www|blog)\.seerinteractive\.com$


#2 Jill Whalen

Jill Whalen

    Administrator

  • Administrators
  • 70 posts

Posted 09 June 2012 - 10:27 AM

Rachael, does the filter only work for future traffic or does it apply to the past traffic you had before you put the filter in place? I have this problem and put it on just not, but it doesn't seem to be working.

#3 rachaelgerson

rachaelgerson

    Member

  • Members
  • PipPip
  • 6 posts

Posted 09 June 2012 - 10:44 AM

Hey Jill! All profile filters in GA work from the day they're applied. The data doesn't get reprocessed (which is why it's so important to have a raw data profile as a backup).

If you want to apply a report filter or an advanced segment to see what this information would have been for the historical data, you could use the same settings and apply directly to the report while in GA. LMK if this isn't clear, I can post screenshots a bit later!

#4 Jill Whalen

Jill Whalen

    Administrator

  • Administrators
  • 70 posts

Posted 09 June 2012 - 10:51 AM

Okay then that makes sense. I'll try it at the report level. Strange thing is my site shows about 10 different hosts. Some I know have my code by mistake, but others don't.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users