Embedding YouTube into Tableau Dashboards

Firstly, thanks Chris McClellan for this tool, who has given his blessing to distribute more widely with the Datafam.

Here is a working solution – the TLDR is that Chris has created a lightweight wrapper that will successfully embed YouTube videos into your Tableau dashboards viewed within a web browser. Scroll down to the solution below for more.

Screenshot shows a Tableau dashboard with the YouTube player embedded within

Background

Over the last couple of weeks, I had been creating a Tableau dashboard which allows you to find Tableau User Group recordings published on the (unofficial) Datafam User Groups YouTube channel (you can check out that dashboard here by the way). I’d had trouble embedding YouTube videos into dashboards in the past but tried again with this project, following this knowledge base article. While it worked in Tableau Desktop, after publishing to Tableau Public, it would not load. Furthermore, this method loads the entire YouTube page, and not just the video player portion, which would have been my preferred option.

Disappointed, I sulked quietly and ended up just loading the YouTube thumbnail, adding an action to my dashboard that would open the video within YouTube in a new tab when clicked.

Somewhat satisfied, I published and released the project to the community and went about my day.

A week or so later, Chris reached out – and excuse me for sharing a private message, but it said “Hey, you had a problem with embedding YouTube links in a dashboard?”, shortly followed with a “try this :)”. I did so, and then after he made a few more tweaks to the wrapper he was creating, we were all systems go!

Solution

Using the wrapper is incredibly straightforward and works very much like Ken Flerlage’s web-based image tool.

  • Build your URL – if you’re just adding one static video, you can just enter it straight into the web object, otherwise if you want to control the embedded video dynamically, create a string-based calculated field
https://visualisedata.com.au/youtube.html?v=[video_ID]

Replace [video_ID] with the ID of your video(s) – for example:

https://visualisedata.com.au/youtube.html?v=uc1xH5p82F0
  • Add a web-page object to your dashboard
  • If adding just one video, paste the URL you created in the first step above into the web-page object. If you want to allow the user to change the embedded video dynamically, create a “Go to URL” dashboard action, specifying the web-page object you added as the “URL Target”

Additional Notes

  • Videos are set to NOT auto-play
  • We haven’t added any configurable parameters – so you currently can’t toggle the ability to auto-play via this wrapper (which is good IMO…)
  • Embedded videos can’t be full-screen; but users will be able to click through to watch directly on YouTube for that

Example

If you’d like to download and pull apart my Tableau User Group Recording Explorer dashboard which contains this wrapper where the video will change based on the user’s selection, find it on Tableau Public here.

I’ve also published a very quick and dirty example to Tableau Public which is embedded below, showing the working embed (one static video URL). I’ve also included the “official” but unsupported example from the Tableau knowledgebase within that dashboard, which doesn’t work in browsers.

Posts created 6

One thought on “Embedding YouTube into Tableau Dashboards

  1. Hey Jacob, thanks for the kind words, but you did a lot of work yourself as well 🙂

    Just on the auto-play settings – there’s 2 options:
    1) auto-play, but the video is muted
    2) not auto-play, but when the user presses play the sound is on.

    I could change the code so that you have a choice, but at the moment it’s hardcoded for Option 2

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts

Begin typing your search term above and press enter to search. Press ESC to cancel.

Back To Top