Displaying a Tableau Public URL in Salesforce

iframetableauweb-tab

I'd like to display a Tableau Public URL in Salesforce.
The URL itself works fine, but when I try to display it as a "Web Tab" or Visualforce page I get:
"public.tableau.com refused to connect."

For the Web Tab I simply enter the link and click "preview."

For the Visualforce page, my code is:

<apex:iframe src="https://public.tableau.com/app/profile/sydney.howard/viz/shared/9NSZCTRQ3" scrolling="true" id="theIframe"/>

This is not our Tableau public link, just an example of what our Tableau Public page looks like:
https://public.tableau.com/app/profile/sydney.howard/viz/shared/9NSZCTRQ3

This is a snapshot of the error page

Best Answer

Install this Tableau Viz Lightning Web Component from App Exchange. Once you installed you can see this below LWC Component in Lightning App Builder under Custom - Managed section.

enter image description here

Drag this Component to the Lightning Page where you want to embed as below.

enter image description here

Now go to the Public Tableau Report and follow the below steps and copy the URL to be embeded in Salesforce.

enter image description here

Puth the URL copied from the previous step into the URL field of the LWC Component as below.

https://public.tableau.com/views/LocatorMap/Dashboard1?:language=en-US&:display_count=n&:origin=viz_share_link

enter image description here

Now you can see the Public Tableau Report inside Salesforce. You can add this LWC Component in Home Page, Record Page and Lightning Page to embed Public Tableau Reports.

Follow this link to get more details: https://help.tableau.com/current/pro/desktop/en-us/embed_ex_lwc.htm