How to Generate Interactive Word Clouds in Google Data Studio for Free

Word cloud, also known as text clouds or tag clouds. They are generally used to visualise text data, such as product reviews, comments, tweets, news articles and many more!

So if you’re interested in building a word cloud using a free data visualisation tool like Google Data Studio, you are in the right place!

What is Wordcloud ?

Word cloud is a collection of words displayed in different sizes and weights. Usually the bigger and the bolder the word appears, the more frequently the text is being mentioned in the text data; hence the more important the subject is.

From a business perspective, word cloud can be useful in:

  • Visualising and understanding customers review or feedback
  • Identifying new keywords to target in your blog articles to rank higher in search engines
  • Share fun facts in a visually appealing way

There are other interesting applications using wordclouds technology, see below example.

Creative Wordcloud Example for Poetry

Creative Wordcloud Presented by My Poetic Side

 

Wordcloud Created by Danalyser in Google Data Studio

Wordcloud that shows common keywords that bring in traffic to my website: www.danalyser.com.

Wordcloud in Google Data Studio

As of the day this article was written, there's no native chart that supports wordcloud visualisation in Data Studio. Hence, I am going to introduce you to two community visualisation components that you could use to create a word cloud without no/less coding required: 

  1. Simple Word Cloud, and
  2. Vega / Vega Lite. 

Community Visualisation in Looker Studio

Community visualisation, also known as partner visualisation in GDS. These are the visualisation add-ons developed by third party vendors or the volunteers.While some of the visualisations are being reviewed by Google, you should always add visualisations from trusted providers, especially if you are dealing with sensitive data. 

How to Use a Wordcloud Community Visualisation Add-Ons in GDS

Check out the full video tutorial below to learn how to add a beautiful and interactive wordcloud in Data Studio Dashboards!


Option 1: Simple Word Cloud by Meliorum 

Step 1: Set Up Data Studio Report

So first of all, you’ll need to create a new data studio report if you don’t have one yet. Then import a dataset of your choice or download the sample dataset I found online. This dataset contains Amazon UK Shoes reviews and some of the product information, it'll be used as the data source in this tutorial.

If you are new to Data Studio and not sure how to get started in Data Studio, check out my Complete Data Studio Course which I have covered how to import a Google Sheets dataset and build an interactive and branded report from start to finish, so be sure to watch that video first!

Step 2: Enable Community Visualisation Access

Once we have created the data source, you’ll have to turn on the community visualisation access to your data source(s), in other words, installing the visualisation add-on, otherwise you can’t insert any word cloud charts that we are going to use today. To enable access, go to Resources > Managed Added Data Source and make sure the Community Visualisation Access is turned on here. Then, close the window.

Step 3: Import & Use Wordcloud Add-On

Now we are ready to import our first word cloud add-on: Simple Word Cloud, which is built by Meliorum.

Word cloud in Looker Studio by Meliorum

Figure: Wordcloud generated by Meliorum in Looker Studio

Before we import, it's worth noting that this component is still under development and it is not yet reviewed by Google, so install at your own risk. The other downside of using this add-on is that it's a little buggy so it might not be the best choice if you want to add it to a production report.

Now I’m going to guide you on how to search and import this visualisation add-on into your data studio report.

First, you’ll need to click on one of the menus in the toolbar, the icon has a combination of four different shapes, so it should be easy to spot it. Otherwise, you can hover on the icons and look for “Community Visualisations and Components”. Once you have found it, you’ll have to click “Explore More” at the bottom of the window. Here you’ll see all the available add-ons for Data Studio..

If you want to use Simple Word Cloud, simply click on “Build your own visualisation”, then enter the manifest path: gs://meliorum-visualisations/wordcloud/

You can copy and paste it to your report. Next, we are going to click submit and allow access to add the component.

After we installed the add-on, we can now add a word cloud to our report using Simple Word Cloud by clicking on the report canvas to add the chart.

Moving on, we’ll want to define a text field to generate the word cloud, which is review_text. As for the size and weight of the wordings, it’s computed based on the metric field. So based on your use case, you’ll want to define the metric field as well. For our example, we are going to use record count as the metric.

Now we have a word cloud generated just from a few clicks thanks to the visualisation developed by Melorium.

However, I do notice there’s a bug here when I am trying to interact with the filter. For instance, whenever I filter the report or changing the colour or styling of the wordclouds, it would create a duplicated chart under the previous word cloud (which you have to scroll down in order to see the updated wordcloud), instead of replacing the existing one, which could be quite confused to the users and report editors.

Option 2: Wordcloud by Vega / Vega Lite

Personally I would prefer to generate word clouds using a slightly more advanced component called Vega / Vega Lite, especially if you would like to build an interactive report. It’s built by Jeremy Chen and has successfully passed the review by Google Data Studio team. This component is very interesting as not only it supports word cloud, it also offers other different charts like Sunburst, Heatmap, Calendar View, Tree layout and many more beautiful charts.

FREE WORDCLOUD GENERATED BY LOOKER STUDIO

Figure: Word cloud generated using Looker Studio

So now, to import this component, it is very similar to how we did it for Simple Word Cloud earlier, except that now we do not need the manifest path since it has already been reviewed and approved.

Remember to follow step 1 and step 2 above to use this component in your Data Studio report if you have not used any community visualisation add-on in your dashboard.

Step 3: Import & Use Wordcloud Add-On

To install this add-on, you need to go to the Community Visualisation menu on top and click Explore more. From there, scroll down and look for Vega/Vega Lite (for simplicity I’m gonna call it Vega from now onwards). Select the component and click Allow, then it’ll be added to the report.

Now, click on the canvas to add the word cloud. 

Once you add the chart, you’ll notice some random data being selected, so make sure you drag the correct text field to the Dimension field.

If you follow our example (using the Amazon Shoes Review dataset): As the seller, we want to know what the customer talked about the most in their reviews to understand their preference as well as their pain points. Therefore, we’ll choose the “review_text” column as the dimension. Then, for the metrics, we can add the record count, this will make sure we count the individual word correctly.

After we have defined what data goes into the wordcloud, you notice we have a beautiful word cloud generated. You can resize the chart if the text is too small, the words would adjust accordingly based on the size of the chart.

Step 4: Customising Vega Wordcloud

But it’s not quite what we want. You may notice the text is super long and the individual words are kinda repetitive. For example, from the word cloud we can see there are multiple reviews mentioned that the shoe is hard. But it’s being scattered around and it’s really difficult to get insights from there, hence it really defeats the purpose of a word cloud.

So what we could do here is to process the text and break them into individual words, and then count the frequency of each term. To do that, we’ll need to customise the Javascript code that helped us generate this wordcloud using Vega. In Vegga, we can do data transformation that helps us separate the text into individual words using a Transform function called CountPattern. I won’t go into detail how it works, but if you go to Style, you’ll see a chunk of code that helps us create wordcloud. Basically, the idea is modifying this code to help us achieve a better outcome for text representation of the review comments.

Disclaimer: I am not very familiar with coding in Javascript, but I managed to get it done after a few attempts and I am so excited to share this solution with you all because I don’t see people sharing this solution publicly and I can foresee many people are struggling with this as the documentation provided by Vega isn’t very clear on how to use it in Data Studio. Besides, when I’m doing research about word clouds in a data studio, I don’t find many articles or resources online as well.


So what you need to do is to copy the chunk of code below. Then go to STYLE tab and paste the code under Configuration spec.

 

Note: If you want to add a second chart, unfortunately we can’t use the usual shortcuts Cmd + C and V to copy-paste the chart when using this add-on. Alternatively, you can go to the community viz menu again and under the added report resources, you’ll see the new component being added here. Just select Vega and click on the canvas again to add the word cloud.

Back to blog