2 Replies Latest reply on Dec 20, 2016 12:48 PM by Joshua Gearheart

    Javascript API via Google Site

    Joshua Gearheart

      Will the Javascript API work with Google sites?

       

      I've tried embedding a workbook I have sitting on my company's Tableau server through Google's HTML box, iframe and scripts option, none seem to work.

       

      My understanding is that the JS API is inherent to server versions since 8.0, but I guess there's a chance my organization disabled it for security reasons...I guess that's possible (I've asked if that's the case already).

       

      My guess is that Google sites won't allow this behavior and that the HTML needs to be hosted on the same server as the workbook (someone smart will hopfeully tell me I'm wrong).

       

      I get no errors, just a blank container.

       

      Here's an example of how I've unsuccessfully configured this to work through Google's App Scripts:

       

      coolapp.html

      <!DOCTYPE html>

      <html>

      <head>

      <title>very cool app</title>

      <script type = "text/javascript" src="https://{server}/javascripts/api/tableau-2.0.0.js"></script>

      <script type = "text/javascript" src="Code.gs"></script>

      </head>

        <body>

        <div class='container'>

        <div class='row'>

          <div id='viz'></div>

        <script>

        var vizDiv = document.getElementById('viz');

        var vizURL = "{VIZ URL};

        var options = {

        };

        viz = new tableauSoftware.Viz(vizDiv, vizURL, options);

      };

        </script>

      </div>

      </div>

      </body>

      </html>

       

      code.gs

      function doGet() {

        return HtmlService.createHtmlOutputFromFile("coolapp");

      }