Embed an external media file
Last updated: April 5, 2023
Available with any of the following subscriptions, except where noted:
|
|
|
Legacy Marketing Hub Basic |
You can embed external media files, such as YouTube videos, in a rich text module in your pages, blog posts, and knowledge base articles. Videos can also be embedded in the video module in drag and drop areas of pages or the drag and drop email editor.
To track interactions with a video, learn how to add HubSpot Video to your content instead.
Supported media types
The embed feature supports URLs in oEmbed format, which is common for most media types. Platforms that use the oEmbed format include YouTube, Spotify, and Vimeo. For a full list of supported media providers, see the oEmbed documentation.
Media files with additional security, such as private YouTube videos, are not supported.
Embed an external media file in a rich text module
Please note: external media files cannot be embedded in rich text modules in marketing emails.
You can embed a media file in a rich text module by pasting the URL directly into the rich text editor. If you see an error message when adding your media file's URL, HubSpot recommends inserting the embed code instead.
Embed an external media file with a URL
-
Navigate to your content:
- Website Pages: In your HubSpot account, navigate to Marketing > Website > Website Pages.
- Landing Pages: In your HubSpot account, navigate to Marketing > Landing Pages.
- Blog: In your HubSpot account, navigate to Marketing > Website > Blog.
- Knowledge Base: In your HubSpot account, navigate to Service > Knowledge Base.
- Hover over your page, post, or article, then click Edit.
- In the content editor, click the rich text module.
- Paste the URL of the media file into the rich text module. The media file preview should populate automatically.
Embed an external media file with an embed code
-
Navigate to your content:
- Website Pages: In your HubSpot account, navigate to Marketing > Website > Website Pages.
- Landing Pages: In your HubSpot account, navigate to Marketing > Landing Pages.
- Blog: In your HubSpot account, navigate to Marketing > Website > Blog.
- Knowledge Base: In your HubSpot account, navigate to Service > Knowledge Base.
- Email: In your HubSpot account, navigate to Marketing > Email.
- Hover over your page, post, or article, then click Edit.
- In the content editor, click the rich text module.
- In the rich text toolbar, click the Insert dropdown menu and select Embed.
- In the dialog box, enter the external media file's embed code. You will be shown a preview of your file.
- Click Insert.
Format an external media file
-
Navigate to your content:
- Website Pages: In your HubSpot account, navigate to Marketing > Website > Website Pages.
- Landing Pages: In your HubSpot account, navigate to Marketing > Landing Pages.
- Blog: In your HubSpot account, navigate to Marketing > Website > Blog.
- Knowledge Base: In your HubSpot account, navigate to Service > Knowledge Base.
- Hover over your page, post, or article, then click Edit.
- In the content editor, click the rich text module.
- Click the embedded file.
- Edit your media file's position, dimensions, and spacing in the toolbar.
- To resize your file, enter pixel values for the width and height.
-
- To adjust the media file's position within a block of text, click the inline alignment icons.
- To make your video responsive, click the fullWidth full width icon. The video will take up the full width of the device it's viewed on.
Please note: embedded media files with a <script> tag are not supported in full width because they generate dynamic content.

- To edit advanced options for your media file, click the edit edit icon.
- Developers can edit the style and behavior of an embedded video in the Embed code text field.
- By default, media files use lazy loading and will only load if a visitor scrolls to their area of a page. To have your media file start loading when the page loads, click the Loading options dropdown menu and select Eager.
Replace an external media file
If you need to replace an embedded external media file, remove the original file, then embed the URL of the new file:
-
Navigate to your content:
- Website Pages: In your HubSpot account, navigate to Marketing > Website > Website Pages.
- Landing Pages: In your HubSpot account, navigate to Marketing > Landing Pages.
- Blog: In your HubSpot account, navigate to Marketing > Website > Blog.
- Knowledge Base: In your HubSpot account, navigate to Service > Knowledge Base.
- Hover over your page, post, or article, then click Edit.
- In the content editor, click the media file, then click the delete remove icon.
- Repeat the steps to embed a new file URL.
Embed an external video in a video module
You can also embed an external video on your page or a marketing email with a video module. This module is only available in drag and drop areas of pages and the drag and drop marketing email editor.
Embed an external video in a video module in an email
- In your HubSpot account, navigate to Marketing > Email.
- Click the name of the email.
- In the sidebar editor, click the Video module and drag it into your email.
- In the content editor, click the video module to edit its options.
- Under Video type, select Embed.
- Enter the Video URL.

- Edit your video's dimensions, thumbnail image, and positioning in the left sidebar editor:
- Enter a width or height to resize the video.
- To customize the video's thumbnail, click Upload images to upload an image from your computer, or click Browse images to add an image from your files tool.
- To ensure your video displays at full width on mobile devices, select the Show as maximum width on mobile devices checkbox. Videos will never display at a width larger than their original dimensions.
- To move the video to the right or left, click the Alignment dropdown and select Left, Center, or Right.
- To add space to the sides of your video, click to toggle the Padding switch on.Enter pixel values for padding in the Top, Bottom, Left and Right text fields or select the Apply to all sides checkbox to apply the same padding to all sides of the video.
Embed an external video in a video module on a page
Please note: the video module can only be added to pages with a drag and drop area.
-
Navigate to your content:
- Website Pages: In your HubSpot account, navigate to Marketing > Website > Website Pages.
- Landing Pages: In your HubSpot account, navigate to Marketing > Landing Pages.
- Hover over your page and click Edit.
- In the sidebar editor, click the Video module and drag it into your page.
- In the content editor, click the video module to edit its options.
- In the Video type section of the sidebar editor, select Embed.
- Enter the Video URL.
- Select whether the size of the video will change on different devices:
- Automatically adjust: your video will be responsive, i.e. it will scale based on browser and device size.
- Exact width and height: your media will always be this exact size on all devices.
- If you've set your video to be responsive, select its maximum size:
- Original size: the video will not scale to be larger than its original size.
- Full width: the video will take up the full width of the device it's viewed on.
- Custom: the video will not exceed a specific width and height set in the sidebar editor. enter pixel values for its dimensions in the Width and Height text boxes.
- To customize your video's thumbnail image, click Upload to select a new file from your computer, or click Browse images to select an image from your files tool.