Upcoming LunaMetrics Seminars
Boston, Apr 6-10 Los Angeles, Apr 13-16 Atlanta, Apr 27-30 Washington DC, May 11-15

Query parameter for inline report filters

The filter at the bottom of reports can be quite handy. But you may have noticed that (like lots of AJAX-y things on the web these days) the URL doesn’t change when you apply this filter.


This can be a pain when you want to bookmark it or share the filtered report with someone else. (Sure, you can email them the report, but the static output isn’t the same as letting them play with it live.)

So you may be interested to know that you can actually apply the filter with a query parameter in the URL. (This may be of interest to anyone who’s writing Greasemonkey scripts or something like that, as well.)

The query parameter is q and you can use whatever expression you would use in the regular filter box. (Just make sure you URL-escape any characters that aren’t safe in URLs.) There’s also a query parameter qtype that specifies the value of the “containing” or “excluding” dropdown. Set qtype=0 for a “containing” filter and qtype=1 for an “excluding” filter. Just add these parameters to the URL for the report that you already have, and voila! you have a filtered report.

Jonathan Weber

About Jonathan Weber

Jonathan Weber is the Data Evangelist at LunaMetrics. He spreads the principles of analytics through our training seminars all over the East coast. The next seminar he'll be leading will be a Google Analytics training in Boston. Before he caught the analytics bug, he worked in information architecture. He holds a Master’s degree from the University of Pittsburgh School of Information Sciences. Jonathan’s breadth of knowledge – from statistics to analysis to library science – is somewhat overwhelming.


4 Responses to “Query parameter for inline report filters”

John says:

If you’re lazy like me, you can let GA do the work of generating the URL for you.

Just set up the report the way you want it to look, with the filter applied, etc, and click the “Add to Dashboard” button at the top.

Now, go to the Dashboard, find the box for the report you just added.

The “View Report” link at the bottom of that box is the URL you want.

Free games says:

I think it should be helpful for the report. The inquiry parameter is q and it will assist to use anything look we would use in the regular filter box.

Mike Plummer says:

If you’re even lazier, you can click the “email report” button, then click the “back to report” link to put all of the updates you’ve made to the report in your browser’s address bar. Same amount of clicks, but eliminates the having to look for your report on the dashboard step.

Robbin says:

Mike, since when are you lazy? Robbin