Regular Expressions Anywhere in Google Analytics

So this is just a quick tip that may have been obvious to everyone but wasn't to me and I found it incredibly useful. In Google Analytics, you can use regular expressions in any search field. So if let's say you have an ecommerce site that dynamically forms URLs like this:

thanks.php?from=order;id=13456;type=book

you can go to Top Content and enter a regular expression like this in the search box:

/thanks\\.php\\?from=order;id=(.\*);type=book

Then if you wanted to see all orders for more categories you just replace type=book with something like type=(book|cd|dvd).

Of course, if the site had been thinking about analysis from the beginning, they would have formatted that URL to put type=book before the id, so that you could just search for the most static parts of the URL (thanks.php?from=order;type=book) and not have to use a regex in the search.

So all you webmasters out there, do the analysts a favor! When you formulate your dynamic URLs, the parts that are the most dynamic should go at the end. So if your information looks like this:

Orders
  Category
    Subcategory
      Individual ID

That's the order they should go in in the URL. Makes it much much easier to generate reports.

Another thing I'm figuring out is that I'm going to have to learn regular expressions better. People on the lists are pretty helpful but I think I need to just bite the bullet. Anybody got any advice on a good crash course (preferably online and free) to regex?

Comments:

Post a Comment:
Comments are closed for this entry.
About

johnc

Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today