Chrome Network Filtering Tip for Analytics
When debugging analytics there are lots of tools you can use. Pretty much anything that can look at the HTTP requests will do something useful. Personally, I like to just use the Network tab in Chrome Developer Tools most of the time. This gives me lots of flexibility to look at any tag as I switch between Adobe Analytics (AA), Google Analytics (GA), Floodlights, Marekto, etc, etc. It is also helpful if I’m trying to investigate how analytics is impacted by site issues as I delve into redirects or iframes.
Basic Network Filtering
When working across all these requests one useful bit of know-how is filtering the Network tab using RegEx. I have found this especially handy in GA implementations where I may be taking advantage of non-interaction events to track scrolling or impression information of some sort. This can cause a single page to have quite a few entries in the Network tab. In this example setup, activity across two pages looked something like this (notice I’m already filtering for “collect” which is a standard part of a Universal Analytics GA hit):
If I’m wanting to look at certain types of requests (such as only page view hits, event hits, or hits with certain values) then this view can be a bit cumbersome to work with. I may find myself taking extra time just flipping through requests to find the one I’m interested in.
Bring on the RegEx
To make this a bit easier you can just apply RegEx to the filter field. Once upon a time Chrome had a checkbox you had to check for this to work. Now you just need to use slashes around your expression like so:
This example using /collect.*scroll/ will just filter for my scroll events. A few other expressions to consider are:
- GA pageview hits: /collect.*t=pageview/
- GA event hits: /collect.*t=event/
- AA custom link requests /b\/ss.*pe=lnk_o/
- AA page hits: /b\/ss(?!.*pe=)/
Extra Considerations
Going back to the scroll example…these events have an event category of “page scroll”. I could be more specific and do something like /collect.*ec=page scroll/ …except that this just wont work. Keep in mind that you are now filtering based on the request URL so you need to keep URL encoding in mind. We would have to modify this expression to /collect.*ec=page%20scroll/. Notice the space is replaced by %20 which is the URL encoding for a space.
Some of these examples could be unnecessarily complicated. Often filtering for “pageview” or “t=pageview” is unique enough. But, hey, you have more options now.
Another catch is this doesn’t work with POST requests since in the case of a POST the values are passed in the payload instead of the URL. POST is used by AA and GA if the URL is going to be too long so expect that to crop up at times where you are just sending a lot of data.