Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Filter on directory and all subdirectories in Google Analytics

I am trying to set up a filter to include only data for a particular directory and all its sub directories.

For example, I would like to include data from dogs directory and subdirectories

http://www.mysite.com/dogs/
http://www.mysite.com/dogs/index.htm
http://www.mysite.com/dogs/breeds.htm
http://www.mysite.com/dogs/puppies/
http://www.mysite.com/dogs/puppies/index.htm
http://www.mysite.com/dogs/puppies/care/
http://www.mysite.com/dogs/puppies/care/feeding.htm

When creating a new filter I think I should select a Pre-defined filter to Include only traffic to the subdirectories that begin with the subdirectory /dogs/ and not case sensitive.

I am just a bit confused about whether it should be that begin with or that are equal to. Am I right to use that begin with in my situation and is my subdirectory value correct?

(I ask because it takes 24 hours for the data to update so getting it wrong costs a lot of time)

like image 761
Kevin Brydon Avatar asked Feb 28 '13 12:02

Kevin Brydon


People also ask

What are the 2 types of filters in Google Analytics?

Search & Replace: This is a simple filter that you can use to search for a pattern within a field and replace the found pattern with an alternate form. Advanced: This type of filter allows you to build a field from one or two other fields.

How do I filter subdomains in Google Analytics?

Add View Filters Select “Custom” for the Filter Type. Change the Filter Type to “Include.” Change the “Filter Field” to “Hostname.” Enter the subdomain you want to track in the “Filter Pattern” section and remember to include backslashes before every period.


1 Answers

Turns out I was right. To filter on a directory and all subdirectories the settings should be

  • Predefined-Filter
  • Include Only
  • traffic to the subdirectories
  • that begin with
  • /dogs/
  • Not case sensitive
like image 69
Kevin Brydon Avatar answered Oct 05 '22 00:10

Kevin Brydon