Upcoming LunaMetrics Seminars
Seattle, Nov 3-7 New York City, Nov 17-21 Washington DC, Dec 1-5 Los Angeles - Anaheim, Dec 8-12

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.

inline-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.

http://www.lunametrics.com/blog/2009/07/23/query-parameter-inline-report-filters/

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