In this video,
I'm going to show you how to add dynamic conditional content in Google data
studio based on numerical ranges.
Hi, this is Ahmad from Siavak and I help you learn data studio to create better
reports quickly and more efficiently. Today,
I'm going to show you a technique that helps us not only show numbers,
but also communicate insights with our reports and draw people's attention to
the areas of the report that are most important and need immediate action. So,
instead of just showing a number, we want to show if it's good or bad.
Have all campaigns performed better or worse than expected.
Is that conversion rate less than, or more than the target.
Project managers have always followed this concept by adding a kind of traffic
light signal to their reports. Amber,
green and red to show which part of the project are fine,
which parts are at risk and which parts are critically overdue and need
immediate attention. As online marketers, we should be doing this too.
Especially if we know the target for the KPIs that we are representing
on our reports, but this is not easy to achieve in data studio.
We cannot simply write a different text message or show different icons based on
different ranges of a metric. At least right now, it is not possible.
That's why we decided to create a custom component to work around this
limitation. And today I'm going to show you how it works,
make sure to stick around to the end,
because I'm going to share this free component with you.
So you can also use it on your reports. Let's go ahead and get started.
So let's see what we can create with this conditional
content component. Here,
we have a report and we have different metrics in a score
card shown on this report. And we have three ranges. Revenue,
less than a thousand dollars between a thousand and $2,000 and more than
$2,000.
Now each of these columns shows one type of conditional
content that we can show based on this range of metric,
one of the capabilities of this component. So in this first column,
what I've done is just, I placed a special character,
a solid circle. You can find it on the character map, uh,
on a PC or the equivalent software or your Mac.
And I just put this character,
increased the font size and choose the color of the font for the character.
So I'd say if the revenue is less than a thousand dollar,
I want this character to be rendered under support the same character
with the yellow color and the same character with a green color.
As simple as that,
I could create a traffic light signal based on three different ranges of
this metric. The next column, exactly like that.
But just instead of putting a character,
I decided to put an emoji and this emoji could be
anything. And as you can see, this is not part of the scorecard beneath,
this is another component overlaid on the top of the scorecard.
In the next example,
I'm simply showing different pieces of text for each range,
but different color of course. And the final one, again, I'm using emojis,
a green check mark, a warning sign and a red cross.
Now let's take a look at the dynamic example and compare the features and
capabilities of conditional content component with the traditional built-in
conditional formatting in data studio.
So here we have a sample criteria.
Our metric is the number of new users, and we have four ranges, 0 to 10,000,
10 to 20,000, 20 to 30 and 30 to 50,000.
And depending on the range of this metric,
we want to be able to show different pieces of content.
So here I have a simple scorecard with conditional formatting applied to it
based on these ranges. And at the top,
I again have the same scorecard,
but this time it's a bit larger.
So this is the scorecard and I have put three different
instances of the conditional content components overlaid over
this scorecard. This one, this one, and this one.
Now let's use the filter on the left to dynamically change the number of new
users on this scorecard and see how these change. So for example,
first of all, Google organic more than 20,000,
let's click on only and see how do they update. 20,000?
It's good enough. We have written good enough.
We have changed this smiley and we have changed the color of this circle
at the top, at the bottom with conditional formatting.
The only thing that we could change was the background color of the
scorecard,
which is now exactly the same as the background color of the report and
the color of the font. Now,
if I change the filter to direct none, it would fall under the second range,
10 to 20,000. Let's see what happens. It should say fine.
Let's wait for it. Wait even more.
It was taking too long, but finally it says fine.
This smiley changed the color change. And at the bottom again,
the only thing we could change with conditional formatting was the color of the
background and color of the font.
Let's see some examples.
This one is a bit interesting, isn't it? It says too bad.
3070 new users is really too low. So let's look at it.
We will actually be able to show the actual number
on this score card in the content that was being rendered on the report.
It's quite interesting. Isn't it? Okay.
So let's change it back to a happy face and go back to edit
mode, to see how to install and configure this component.
Okay. So we have a blank report over here because first of all,
I want to show you how to add the components to your report.
This is not a built-in chart in data studio. This is a community,
not the visualization, but yeah, maybe somehow a visualization,
but it's the component.
So you have to click on this little icon here and then click on, explore more.
And then here it is not yet on the list. We haven't published it.
So it's not public. You have to know how to install it on your reports.
For this, I'm going to click build your own visualization and then here
in the manifest path fields.
This is what you need to type in exactly like this.
And then click submit. As soon as you do that,
you would find conditional content by Siavak.com And then you can click on
it and add it to your report. So, first things first,
it's highly likely that the first time that you add the component to your
report, you will see this error. Let's see what it says,
community visualizations disabled, where,
where does the disabled have been turned off by the owner of this data's source
so we have to go and try to edit the data source,
and hopefully you have the permission or ownership of the data source.
So you can do that. And then, you have to come here, community visualization,
access,
click on it and turn it to ON because this is a
third party visualization under support.
And by turning on the community visualization access,
you are allowing it to access your data in case the number of new
users to decide what content to show on your report.
As soon as you do that, you will see the default content.
Default content will be shown whenever there is no range selected
for that metric.
And this is the time you have to decide which metric you want to base your
criteria on. So for example,
let's not use new users and this time use something like page
views, okay. Page views. First of all,
let's also add a scorecard to support,
to see what kind of number are we working with. Okay.
So it's a bit more than 300,000.
Now let's back to our conditional content component and
head over to this time tab to define the ranges and the default
content and set the configurations for this component. First of all,
we have default content.
We can change it to anything like no range is selected,
or it is not true.
Maybe there's a range selected out of range, something like that.
So it's not in any of the ranges that we defined.
Then you can set this style URL and font family based on
any Google font that you like.
This is using the same backbone of our Google fonts component,
which you can find a YouTube video for an install that on your report as well.
If you want to have on brand report,
if you want to use any Google fonts in your reports in Google data studio.
And finally here can have inline CSS,
which I'm not going to use in this case because it's will apply to the default
content only.
Now the fun begins. We can define our first range.
You have to first enable the range and set the minimum and maximum.
So let's say we want this range to be from
a hundred thousand to 200,000
and the content would be fair enough,
some slider, okay,
now this doesn't apply to this component right now,
because as we can see the number of page views,
which is also applied in this case is much more than that. Okay?
So I'm gonna leave it here.
You can define the font size and the font color and the background color as
well.
But I'm going to define the second range with the minimum of 200,000
and the maximum of 400,000.
As soon as the value of the metric falls within this range,
the content is applied to the component here,
and it's shown under a point. Now I can say
very nice.
I can change the font size, make it a bit larger. Oh,
was it actually a smaller 48?
I can change the color and I can change the background color if I want to,
which I'm going to pass. Oh,
you can unreset it, or you can reset it, but it doesn't apply.
I'm not sure I have to check it out. Just like this.
You can define up to five ranges for your metric range. Number three,
you can enable have the minimum and maximum in place, set your content,
set your font size and colors, and you're done.
Then you can decide about range four and range five. And you're done.
Now.
Let's see how we can add the actual amount of metric in our
text. So here we said, very nice, but what if we want to say,
very nice. This number is really good.
So we can say very nice.
And I'm going to show you something you can put HTML in there.
BR tag means break. So it's a line break.
Now we're going to start with the number itself.
And this is the way we rendered the actual number on the
components. So we put metric exactly like this in the text
and the component.
We replace this with the actual amount of metric at that
moment based on all the other settings in the report.
So this
Page views is really great.
Now we can resize a component and that's it.
Now I'm sure that you can already see how useful this can be.
Any what kind of creative ways you can use this component in your
reports to maybe show the performance of the metrics or
communicate insight to the viewer of the report. Is the number good or bad?
Is this number less than, or more than what we expected?
Is it on target less than target, more than target.
You can define all of these inside the content of each range
and show a relevant, timely,
and correct message to the viewer of your report. As an example,
let's take a look at the final page of the sample report here.
So this is one of the ways that you can use the conditional content component
to show dynamic charts, titles above, below,
or beside your charts. So let's say that, you know,
that the target for monthly revenue for this business is $5,000.
You already know that this is a fixed number. Then,
you have a graph here,
a time series chart that shows the revenue this month,
where it says last month,
and then even without showing the actual metric on the reports,
you can use it inside a sentence,
close to the chart title revenue was this amount last month,
which is more than our monthly target of five grand.
So this is a great way for adding context,
aware commentary on your report,
instead of just writing something and a PDF after a report is generated
or writing something on the report that you have to make sure that it matches
every number that could be presented on a report. Good or bad,
I'm personally really excited about this component because this is something
that wasn't really easy to achieve in data studio before this.
And we've already started to update some of our client reporting
by adding little pieces of insight or indication of the
KPI performance here and there to help them consume the content on those
reports more easily.
Now it's your time to go set it up and use it to improve the user experience
and clarity of your reports.
I really can't wait to see what kind of creative ways you guys come up
with to use this component in your reporting dashboards.
I hope you enjoyed this video and you can use custom component to improve your
data studio reports. If you want to learn more about data studio,
I have multiple tutorials on YouTube, which you can look up and watch.
And if you're new to measure school,
make sure to subscribe so you can get notified of the future videos that we
publish. And finally, I would love to hear from you.
So feel free to leave your questions and comments below. This is Ahmad.
See you in the next video.