Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Analytics exclude empty custom variable in a custom report

I have a custom variable set for all visitors; for our registered users it's some value, for unregistered users, it's empty.

I can find unregistered users in an advanced segment using the settings Exclude Custom Variable (Value 02) Matching Regexp .+ -- works brilliantly.

But I need a report of unregistered visitors for a dashboard, and tried to do the same thing with a filter. I have a metric of Visits and a dimension of something all vistors will have (e.g. Browser). My filter is identical to the one in the advanced segment, but ... not brilliant. I get no visits. I have tried to Include with a regex ^$ but no love there, either.

Any ideas what I am doing wrong?

like image 516
Tom Harrison Avatar asked Nov 01 '11 21:11

Tom Harrison


People also ask

Which would prevent data from appearing in a custom report?

Answer: A filter that filters out all data.

Why are variables necessary in a custom report?

Report variables allow you to: Create reusable, predefined formulas using report objects. Run a formula in Report Designer instead of exporting the data to Excel to run formulas.

How do I delete a custom dimension in Google Analytics?

Custom dimensions and metrics can't be deleted once created, but you can return to these settings in your account to manage and edit them. To stop using an existing custom dimension, uncheck the Active box, and click Save.


1 Answers

To understand your problem and the solution yourself, let me illustrate how the data recording works in any collection process (Google Anlaytics is one of the tools used for data collection and analysis):

To record and analyse data, you first decide what you want to record, and then how. Maybe this how is where Google Analytics comes in for you. So, the data that you want to see is the metric, it can have a name and a (usually numeric) value, and each dimension is how you want to separate or drill down into the various views of the data. As an example, if you want to know how many visitors visited your site everyday, and you want to be able to see through which source they came, Daily Visitor Count is your metric and Source is your dimension.

The important thing to understand here is that Dimensions and Metrics are not bound together. What I mean here is that just because you decided that Daily Visitor Counts should be viewable by Source, doesn't add a source to every updation of the Daily Visitor Count metric. In order to view the metric by the dimenision, you need to update a value for the dimension every time you record the metric.

If you don't record a dimension for a metric, then you cannot obtain the value of the metrics for which you didn't record a dimension by applying a filter on the dimension. Because, using a dimension filter only lets you access the values recorded for the dimension, and not all metrics, because, dimensions don't contain values of metrics, only metrics can optionally contain values for dimensions.

So when you query "dimension equals regex +*", it works, with both include and exclude, but you cannot query metrics with empty dimension using a dimensional filter. The best way would be to only add a standard or default value for the dimension every time you record the metric so that you can separate, something like (not set) or unknown.

Hope that helps. :)

I just hope you understand what you were trying to do is conceptually wrong, though it could still have been made technically feasible.

like image 167
artfuldev Avatar answered Dec 16 '22 16:12

artfuldev