Adding Images to Your Tables in Data Studio

  • Image Function Feature Image

Adding Images to Your Tables in Data Studio

Did you know that your brain processes visuals more quickly than text or numbers? For this reason, including images in your dashboards and reports can make them easier to read and interpret by adding context to the data.

Since the launch of Google Data Studio, you have been able to insert image components into reports. However, with the new IMAGE function available for use in calculated fields, you can include images as part of your dataset and display them in tables. You could use this function to show video thumbnails, product photos, or other relevant images alongside your data.

Read on to learn how to use the IMAGE function in Data Studio and to see an example use case.

Using the IMAGE function in Data Studio:

  1. In your data source, create a new calculated field.
  2. Enter the image function as follows: IMAGE( Image URL, Alternative Text), where Image URL is a dynamically constructed URL to the relevant web-hosted image file and Alternative Text is the “alt” text for the image.
    • For example, using the Google Merchandise Store demo account in GA, we can retrieve product images using the formula:
      IMAGE(CONCAT('https://shop.googlemerchandisestore.com/store/20160512512/assets/items/images/', Product SKU, '.jpg'), Product)
    • This formula can be used as a template when recreating the dimension with your own data. The CONCAT function is used with the IMAGE function to build a complete URL out of a constant string and the Product SKU, as this is how the product image filenames are structured on the Google Merchandise Store.
  3. In your report, create a table. Select your newly-created image dimension. Also select other relevant dimensions and metrics to accompany your image.
    • For example, in our ecommerce product example, we selected Product, Product Revenue, Quantity, and Avg. Price.

Here is the finished example of product images from the Google Merchandise Store. The images can more easily help the viewer determine which product they are looking at, instead of reading only the product name.

Currently, there are limited formatting options available for images in tables. There is no way to adjust the alignment of the image relative to data in other cells. By default, Data Studio aligns text to the top of the row. Also, the only way to adjust the size of the image is by resizing the column width. Hopefully, sizing and alignment options for images will become available in the near future.

Do you have other use cases for images in tables? Let us know in the comments!

If you’ve found this post helpful, check out the other posts in our Data Studio series:
1. Tracking Your Data Studio Dashboards in Google Analytics
2. How to Share a Data Studio Report
3. Google Analytics Dashboard Template for Data Studio
4. Calculating Goal Flow Conversion Rate in Data Studio
5. Embedding Links in Data Studio
6. Simple Visualizations in Data Studio
7. Custom Channel Groupings in Data Studio
8. Calculating Percent of Total in Data Studio
9. Tips for Using RegEx in Data Studio
10. Data Studio Connectors from a Galaxy Far, Far Away
11. Audit Your Google Analytics Implementation with Data Studio

By |2017-12-18T15:04:01-05:00December 7th, 2017|13 Comments

13 Comments

  1. SugaP January 24, 2018 at 9:14 pm - Reply

    Now I am creating a simple machine learning application. Is it possible to use jpg files in my Google Storage on Data Studio?

    • Marc Soares January 25, 2018 at 9:45 am - Reply

      The IMAGE function requires the image URL, as shown in step 2. You will need a direct URL to the file. I don’t think Google Drive can provide you with direct links to images, so that likely won’t work. Does that answer your question?

  2. Hazem April 14, 2020 at 5:16 pm - Reply

    Hello Marc,

    So do mean that even the “shared link” generated by google drive won’t work?

    I have been struggling today to get images from my GD on data studio dashboard!! Tried the URL method and the image field method with no luck!! Still getting the broken link icon instea of the picture!!

    • Marc Soares April 17, 2020 at 12:37 pm - Reply

      Hi Hazem. Yes, shared links from Google Drive will not work with the IMAGE function. The URL needs to link directly to the image file, i.e. it needs to have an image extension like .jpg or .png.

  3. ujwal chaudhari November 5, 2020 at 1:19 pm - Reply

    I’m getting the same broken image icon even after doing this method and trying other multiples as well. Can you help?

    • Marc Soares November 11, 2020 at 9:14 am - Reply

      It looks like Google has changed the image file structure on the Merchandise Store website since we published this blog post. We’ll need to look into how we can adjust the formula to construct the proper image URLs. However, if you have your own images hosted on your own website, this approach will still work.

  4. Celestine November 10, 2020 at 10:31 pm - Reply

    Hi! So, I’m having trouble connecting the images I have in Sheets to Data Studio. I already have the link for the images on one column in Sheet – titled: ALERT LINKS.

    Using the formula you have above, is this correct?
    IMAGE(CONCAT(ALERT LINKS, SKU, ‘.jpg’), SKU)

    Because it still doesn’t work 🙁

    • Marc Soares November 11, 2020 at 9:18 am - Reply

      Do you have the full image URLs in your spreadsheet (i.e. if you go to the URL in your browser, it loads the image)? If so, then you don’t need to concatenate the URL at all. You could just use IMAGE(ALERT LINKS, SKU).

    • Glauber Sant'Ana November 28, 2020 at 1:24 pm - Reply

      Localize the image you want on google-drive, click one time in the image, in case the info of the image is hidden, click in icon ( ℹ ) in order to show details of the image. Notice that a copy of the image will appear then click on it with right button and copy the image address and then paste it in the desired field, where data studio will present the desired image, note that copied address is different from original ID.

  5. Andrew E November 23, 2020 at 11:53 am - Reply

    Hi Marc,

    This was so helpful, thank you! I have used this to help make our reports more visual, which is great, but I have a question: Do you know how to create an image function to show an image in a table when you don’t know what the image file type is?

    I’ve created a chart for a Google Data Studio report that shows the top-performing posts on a blog.

    We use a specific text ID to name pages and associated assets (like images), and we add the pixel size as part of the image filename, so the following, which includes a custom field to add that text ID, works for displaying most of our images in the table:

    IMAGE(CONCAT(‘https://www.xxxxxxx.xxx/contentimage/mic/xxx/’,TEXT ID,’-800′,’.jpg’)), “sad trombones”

    But some of our images are gifs, and this obviously won’t work with those, so some top-performing stories in our table are accompanied by an error message instead of the correct image.

    Do you know of a way to write an IMAGE expression that will add the correct file format extension?

    Thanks in advance for any help you can offer!

    • Marc Soares November 24, 2020 at 10:57 am - Reply

      Hi Andrew,

      Glad you found the post helpful! There unfortunately isn’t a way in Data Studio to check whether an image URL is valid. You will need to provide the IMAGE function with the correct file extension. You could do this by replacing the “.jpg” value with a separate field. For example, IMAGE(CONCAT('https://www.xxxxxxx.xxx/contentimage/mic/xxx/',TEXT ID,'-800', IMG FORMAT))).

      The IMG FORMAT field would then need to correspond with the TEXT ID to return the appropriate file extension. You could use a CASE expression to return “.gif” for certain TEXT ID values, e.g. CASE WHEN TEXT ID = "ABC" THEN ".gif" ELSE ".jpg" END.

      Hope that provides you with some ideas.

      Marc

    • Glauber Sant'Ana November 28, 2020 at 1:34 pm - Reply

      correction

      Localize the image you want on google-drive, click one time in the image, in case the info of the image is hidden, click in icon ( ℹ ) in order to show details of the image. Notice that a copy of the image will appear then _press shift key_ and click on it with right button and copy the image address and then paste it in the desired field, where data studio will present the desired image, note that copied address is different from original ID.

  6. Andrew E November 24, 2020 at 12:41 pm - Reply

    Thanks very much for the response, Marc.

    We could amend our text ID going forward to include something that signals the accompanying image is a gif. That would make your IMG FORMAT custom field idea work for future content pieces.

    Much appreciated!

Leave A Comment