Reputation: 749
I'm attempting to do some careful analysis of the way my website's visitors move through two particular multi-page actions (e.g. event registration) in order to determine where and why some visitors don't complete the actions. I'm trying to use the Google Analytics "Visitors Flow" tool to examine the data, especially to find out where the "did not complete" visitors went next.
The difficulty I've run into is how the developers put together the URL structure in our MVC framework. Roughly speaking, the URLs look like this:
/contacts/432/edit /* create new person profile, [0-9]+ format for new person ID */
/event_orders/763/edit /* create new event reg, [0-9]+ format for new event registration */
/event_orders/763?success=true /* action completed */
Because of how the URLs are constructed, it's currently not possible to use the GA Visitor Flow analysis to view how site users move through the action sequence.
What I'm hoping for: I want to be able to define URL groupings by using regular expressions.
I know it's possible to use regular expressions when filtering page views, but I haven't found anything along those lines in the Visitors Flow section. If anything it looks as though I would need to define site-wide URL groupings in order to always treat /contacts/[0-9]+/edit
as the same URL, thereby grouping the "create new event registration" page views into one chunk when viewing the Visitors Flow.
Is it possible to do this?
Upvotes: 11
Views: 4919
Reputation: 10002
Robert Kingston was almost correct, BUT replacement string should be quite different - when you use parentheses to catch strings you insert them with \1
, \2
and so on.
This is how to change your URL:
/
, e.g. for http://abc.eu/my/file.php?abc
URI is: /my/file.php?abc
).In this particular case you need:
^/(\w+)/(\d+)[/?](\w+)(.*)
/\1/\3?\2&\4
Orignal and new URI:
/contacts/432/edit -> /contacts/edit?432&
/event_orders/763?success=true -> /event_orders/success?763&=true
This should allow you to figure out what was the original URI, but visitor flow should look better (query string is ignored in flows).
Note! Your old data will not be modified even if you add filters to your old views. That is why you should add new views. Otherwise you will have mixed data with URLs in old and new format.
Upvotes: 2
Reputation: 749
In the original question, I stated what I was hoping for: "I want to be able to define URL groupings by using regular expressions."
It turns out that Google Analytics' Visitor Flow allows exactly this! Here's how.
Load up Visitors Flow, and apply any other filters and segmentations you want.
Navigate through the Visitors Flow interface to find one example of the pages that you want to group. In the case of my original question, one example was /contacts/432/edit
Left click on that node and select "Explore traffic through here". That will convert the interface so that it shows all the entrance paths to and exit paths from that node, regardless of where that node occurred in the sequence of each visitor's interaction with the site.
Click on the "gear" icon above the node in the new display. That will bring up a new dialogue box that allows a number of "Match" options: "contains", "begins with", "ends with", "equals", and "matches regexp"!
I haven't plumbed the depths of the regexp flexibility here, but for one of the groupings that I was looking for, I entered /contacts/*/edit
in the second field
The third field is optional, but allows you to use a more friendly name for the node.
Click "Apply". Now all the matching URLs will be grouped!
(Bonus) In order to see the specific URLs that have been grouped and some overview statistics of each of those URLs, left click on the node and click "Group Details".
Happy regex'ing!
Upvotes: 5
Reputation: 174
Robert Kingston has it right, although it might be worth noting what the $A1$A3 thing means in the replace string.
The $A means filter field A and the 1 means "the stuff in the first curved brackets" the 3 means "the stuff in the 3rd brackets". the slash at the start is literally just a slash.
I strongly recommend creating additional profiles for this kind of thing, and always having a "Vanilla" profile that is never touched in case of disasters.
Upvotes: 1
Reputation: 369
Unfortunately there's no clean way to do this without creating a new profile along with some custom profile filters.
To do this simply jump into the Admin interface, create a new profile (if you don't want to muddy your existing data - you can create oodles of these anyway) and create a custom advanced filter with the following options:
Type: Search & Replace
Field: Request URI
Search String: ^/(contacts|event_orders)(/\d*)(.*)
Replace String: /$A1$A3
Here's how that looks in the GA interface:
Upvotes: 5