This time I want to show you how to create smart filters in Data Studio.
Let’s say that you have a multilingual site and you want to display a graph that shows you, new users, on a time axis, separately for each site.
If the separation between the languages of the site is clear and configured, like having a subdomain for each language (as is the case here, for example), then it’s not really much of a problem.
You can display a graph of all the subdomains:
And then you can select the graph and turn on the ‘Cross-Filtering’ option.
What will happen is that each time you’ll press on a certain line in the report, it will filter the graph (or the entire page, if you didn’t make a group for the elements) in such a way that only the data for the given line will be displayed:
That’s the simplest case you can get, and that’s not the reason we’re here now.
The question is, what do we do if the information with which you want to filter appears in a variable (non-configured) way?
For instance – you have the following graph that displays the conversion rate of each device, but you have no interest in looking at each and every device. Rather, you want to understand whether the conversion rate of a cheap device is worse than that of an expensive device:
What you need to do is create a new field:
And enter the following code into it:
This essentially configures the entries according to their contents.
For instance, the first line says that if the ‘Mobile Device Info’ field contains Galaxy M, Nokia, Xiaomi, etc. – then the entry that will be displayed will be ‘Low Level’.
If the ‘Mobile Device Info’ entry contains Galaxy A – then the displayed entry will be ‘Medium Level’.
And if the ‘Mobile Device Info’ entry contains Galaxy S or Apple – then the displayed entry will be ‘High Level’.
And if the ‘Mobile Device Info’ entry contains a different entry that doesn’t meet any of the criteria – it will then display ‘Other’.
This is obviously a rather simplistic breakdown as an example, but this way you can easily map out the various models and consolidate them according to their prices.
And after adding the field, our graph will look like this:
If we take down the ‘Mobile Device Info’ field – we’ll receive a nice breakdown that shows that the more expensive a device is, the higher its conversion rate is:
I’ll just point out that this doesn’t necessarily stem from the device itself, but rather from the site users (who affect the rating of the device that they want to acquire) and additional parameters like internet speed, which oftentimes relies on users’ geographical locations and affects its cost potential, among other things.
Likewise, under the ‘Other’ section there are many other devices that I didn’t have the energy to catalogue, so, once again – this is all just an example.
Now let’s change it into a filter.
Let’s say that we have additional graphs on our page and we want to give our client the option to filter all the graphs on the page according to the device classifications that we’ve just created.
We’ll click on ‘Add a control’ and select it in the drop-down list:
And as a field, we’ll create a new field with the code that we used before (it’s not the most convenient way, so be sure to read my comment in the end):
And now we have a filter that contains the entries ‘High’, ‘Medium’, ‘Low’, and ‘Other’ like before, and surprisingly (or perhaps unsurprisingly), if we’ll filter it according to ‘Low Level’ devices we’ll see that they come from India:
In principle, if you create a new field using a specific widget, that field will only be available in that specific widget.
If you want it to also be available for additional widgets, then you need to edit the data source:
And then click on ‘Add a field’ and add the code exactly as we did before – but this time it will create it at the data source level and not at the level of a single widget:
There are many more uses that CASE can be used for, and in this post, I showed you just one of them.
The idea is the same idea – take all of the entries of a certain field, configure them according to certain criteria, and then display them in a report.