# Embed Code

> An embed code is a snippet you paste into your website to show a video, form, booking calendar, or map from another service. How it works and what to check.

Canonical URL: https://crevio.co/glossary/embed-code

## What is an embed code?

An embed code is a short snippet of HTML or JavaScript that shows content from another service inside your own website. You copy it from the service, such as YouTube, Google Maps, or a booking tool, and paste it into a page. The content then appears on your site and stays up to date, because it still loads from the original service.

## How an embed code works

1. **Copy the code.** Look for a "Share", "Embed", or "Add to website" option in the other service.
2. **Paste it into your page.** Most website builders have an "Embed", "HTML", or "Code" block for this.
3. **Publish.** Visitors now see the video, form, or widget on your page.

There are two common kinds:

- **iframe embeds** open a small window on your page that shows another site. YouTube videos and Google Maps work this way.
- **Script embeds** load a piece of JavaScript that builds a widget, such as a chat bubble or a review badge.

A simple iframe embed looks like this:

```html
<iframe src="https://www.youtube.com/embed/VIDEO_ID" width="560" height="315" title="How we install a water heater"></iframe>
```

## Examples for small businesses

| Business | What they embed | Why |
|---|---|---|
| Plumber | Google Map of the service area | Shows customers where you work |
| Salon | Booking calendar | Lets clients book without calling |
| Contractor | Review widget | Shows recent reviews on the homepage |
| Personal trainer | YouTube workout video | Keeps visitors on the site |
| Coach | Sign-up form | Builds an [email list](/glossary/email-list) for a [lead magnet](/glossary/lead-magnet) |
| Online seller | Buy button or checkout | Sells from a blog post or [landing page](/glossary/landing-page) |

## Embed code vs link vs integration

| | What the visitor sees | Effort |
|---|---|---|
| Link | Leaves your site to go to the other service | Lowest |
| Embed code | The content inside your page | Low |
| Integration | Data moves between tools behind the scenes, often through a [webhook](/glossary/webhook) | Higher |

Use a link when the other page works fine on its own. Use an embed when you want people to stay on your site.

## Things to check before you embed

- **Trust the source.** A script embed can run code on your page. Only use embed codes from services you know.
- **Use HTTPS.** Embeds that load over plain HTTP can be blocked by browsers.
- **Test on a phone.** Fixed widths can break mobile layouts. Look for a "responsive" option or a width of 100%.
- **Watch page speed.** Each embed adds loading time. Don't stack five widgets on one page.
- **Privacy rules.** Some embeds set cookies or track visitors. If you have visitors in Europe, see [GDPR](/glossary/gdpr).

## Why an embed might not show up

- **The site blocks it.** Many sites send a header (X-Frame-Options or a content security policy) that stops them from being shown inside another site. There is nothing you can do from your side except link to them instead.
- **Your builder strips scripts.** Some editors remove JavaScript for safety. Use the platform's dedicated code block.
- **Mixed content.** An HTTP embed on an HTTPS page is often blocked.
- **Wrong size.** A height of 0 or a tiny box can hide the content.

## How Crevio handles embeds

A Crevio product can include a website embed, which shows an external site or web app inside your buyer's dashboard after they purchase. Crevio checks the site's X-Frame-Options header first, and sites that block embedding can't be added, so use a link experience for those instead. See [Experiences](https://crevio.co/docs/features/experiences).
