How to Embed Tableau Dashboards

Recently Tableau Public switched their embed codes to use JavaScript instead of an iframe. This is arguably a better solution as iframes are old and stinky and no one wants to use them on their site. However, JavaScript is even more frought with errors in my experience.

So when I tried to embed a viz from Tableau Public recently I ended up with something that was 150px by 300px and didn’t even render. This is due to some conflicting JavaScript already running on my site that prevented it from running properly.

My options were to either try to debug the JavaScript error and fix it or just use the old iframe solution. Here is my answer. I hope this helps anyone else in the same boat as me and that one day we’ll find a more bullet proof solution. Cheers!

See the Pen Tableau Embed Link Generator by Ben Sullins (@bsullins) on CodePen.