Here is my first blog post for WAW. I don’t intend to write technical posts but this one turned out to be a quasi-technical one! Here goes:
At work I am putting together a comprehensive analytics report for one of our clients. With the partner agency, we have come up with a measurement framework in order to dissect our client’s online visitors and of course to find patterns, correlations and trends that are otherwise not identifiable. Just to give an example, we are looking at the traffic from a) one of three provinces that b) spends more than 89 seconds on the site, and c) came to the site through paid search (we have close to 50 other segmentations that are more complex than this one). We compare our findings with those that show similar behaviour and identify whether there are any relationships we are not yet aware of. For example, we discovered that those who visit the site between 9am and 11am ~45% more likely to purchase, regardless of the source of the visit. So, what do you do? You notify your Social Media team to push your content between those times to increase the likelihood of purchases.
The reason that I’ve told this story is not to brag about my analytical skills. Although I’ve used the Advanced Segmentation extensively, I never thought that I would ever want to master regular expressions until I started working on this project. Imagine creating a segment with all of the above (3 provinces, say BC, QC and ON, visited more than 89 seconds via paid search traffic). Yeah, sounds easy to create this segment but what about if you want to compare this data to an entirely different group (i.e., those who did not visit from these 3 provinces, who spent less than 90 seconds and arrived at the site via organic search)? So not only do you have to exclude these parameters, you also have to make them AND conditions instead of ORs in order to be able to do your comparison… unless you know how to use regular expressions of course (or create an advanced segment for every single metric you come up with!).
So I created an advanced segment only for the visits from these provinces (include Region). This is what it looks like as a regular expression:
After that it’s so easy to include and exclude the regions you need for your particular segmentation purposes. This is just an example to explain how regex works… you can use it to create much more sophisticated queries for your analytics needs.
If you master regular expressions, you will:
- Save time
- Impress your colleagues
- And most importantly, design queries that will help you segment your data further (imagine I want to segment the traffic that used my name as a search keyword; I can look at those who even misspelled my name (or thought that I was Russian i.e., B[oa]ris)
Go ahead and spend some time on regex and think of ideas of how to apply them. Here is a link to a nice and short e-book Robbin Steiff wrote some time ago.
Let me know what you think of regex in the comments.