---
schema_version: "1"
id: 3717cf6817d8329552211168aa80c21312f57759698a9556c2d1f06119ae782b
title: 将视图嵌入网页
collection: tableau
version: current
locale: zh-cn
portal_url: https://docs.salesforce.com/tableau/current/zh-cn/pro/desktop/embed.md
canonical_url: https://help.tableau.com/current/pro/desktop/zh-cn/embed.htm
source_site: help.tableau.com
content_type: documentation
content_hash: e0dad76235a58f554ffa34cab0b05b074b8736af105fc000425d2fafc2eb49a1
description: Copy the embed code to embed Tableau views into webpages.
---
[跳转到主要内容](#main-content)

# 将视图嵌入网页

> [!TIP]
> 
> Tableau Server 2022.3 及更高版本以及 Tableau Cloud 的嵌入代码已更改为使用嵌入 API v3。本主题包含有关嵌入入门的基本信息。有关嵌入 Tableau 视图的全面指导，请参见 [Tableau 嵌入 API 帮助](https://help.tableau.com/current/api/embedding_api/zh-cn/index.html)。有关从旧版本的嵌入 API 切换的信息，请参见[从嵌入 JSAPI v1 或 v2 迁移到嵌入 API v3](https://github.com/tableau/embedding-api-v3-guide/blob/main/README.md)。

您可以将交互式 Tableau 视图嵌入到网页、博客、wiki 页面、Web 应用程序和 Intranet 门户中。嵌入式视图会随着基础数据的变化或工作簿在 Tableau Server 或 Tableau Cloud 上的更新而更新。

嵌入式视图遵守 Tableau Server 和 Tableau Cloud 上使用的相同许可和权限限制。若要查看嵌入在网页中的 Tableau 视图，访问视图的用户还必须在嵌入该视图的 Tableau 站点上拥有帐户。有关详细信息，请参见[身份验证和嵌入式视图](https://help.tableau.com/current/api/embedding_api/zh-cn/docs/embedding_api_auth.html)。

帐户限制的一个例外情况是，您的组织在 Tableau Server 上使用基于内核的许可证，并且使用来宾帐户。这样，用户无须登录到服务器即可查看嵌入在网页中的 Tableau 视图并与其进行交互。请与您的 Tableau 管理员联系，以了解是否为您的 Tableau 站点启用了来宾用户。

**注意：**您的 Tableau 管理员可以限制允许嵌入的站点或完全禁用嵌入。如果您的嵌入视图未加载，请与您的管理员联系，以确保您嵌入它的站点在嵌入允许列表中。有关详细信息，请参见[用于嵌入的 Tableau 设置](https://help.tableau.com/current/api/embedding_api/zh-cn/docs/embedding_api_site.html)。

## 复制嵌入代码

嵌入视图的最快方法是复制 Tableau Server 或 Tableau Cloud 提供的嵌入服务器代码。您可以从视图上的共享对话框中访问此代码。

1. 在视图打开的情况下，单击工具栏中的“共享”按钮。
    
    ![视图工具栏](/tableau/current/zh-cn/pro/desktop/zh-cn/Img/shareview_menu.png)
2. 单击“复制嵌入代码”，然后将代码粘贴到网页中。若要定制您的嵌入式视图，请使用 [Tableau 嵌入 API](https://help.tableau.com/current/api/embedding_api/zh-cn/index.html) 中记录的选项。
    
    ![复制](/tableau/current/zh-cn/pro/desktop/zh-cn/Img/share_embed_code.png)

## 使用嵌入 API

若要修改从“共享”对话框中复制的基本嵌入代码，或者创建自定义嵌入式应用程序，请使用 [Tableau 嵌入 API](https://help.tableau.com/current/api/embedding_api/zh-cn/index.html)。您可以使用 API 为嵌入式内容启用单点登录 (SSO)，并使用 Tableau 已连接应用自定义和控制用户对数据的访问、控制工具栏选项、应用筛选器、触发事件操作、启用嵌入式 Web 制作等。