---
title: "Embed a campaign on your website"
description: "Put a campaign inside a page on your website with the embed script or an iframe, check that it works, and fix common problems."
url: https://scratcher.io/help/sharing/embed-on-your-website
language: en
---

1. [Help center](https://scratcher.io/help)
2. [Publishing and sharing](https://scratcher.io/help/sharing)
3. Embed a campaign on your website

# Embed a campaign on your website

Put a campaign inside a page on your website with the embed script or an iframe, check that it works, and fix common problems.

Embedding puts the campaign inside a page on your own website, so visitors play without leaving your site.

## Get the embed script

1. In the editor, open **Settings** > **Embed & URL** > **Embed script**.
2. Copy the script. It is made for this campaign.
3. Paste it into your website's HTML where the campaign should appear. Most website builders and shop systems have an HTML or "custom code" block for this.
4. Publish the campaign, and open the page on your website to check it.

You can also choose **Embed** as the **Promotion method** when you publish, and copy the script from there.

## Script or iframe?

The **Embed script** panel gives you two ways to put the campaign on your site:

- **The script** (recommended). Place it exactly where the campaign should appear. It gives you everything, including automatic resizing, so the campaign always fits on the page.
- **An iframe**, below the script. Use it if your website doesn't allow scripts. Some features, such as automatic resizing, don't work in an iframe. The iframe has a fixed height, so you may need to change the `height` in the code to fit your campaign.

> A popup uses one script for your whole account instead. See [Show a campaign as a popup](https://scratcher.io/help/sharing/show-a-campaign-as-a-popup).

## Check that it works

1. Publish the campaign and open the page on your website.
2. In the editor, click **View campaign** in the top bar. Once the script has been found on your site, the menu shows an **Embed** link to the page where the campaign is.
3. Run the campaign health check. It opens your page in a real browser and checks that the script runs. See [Fix editor errors and run a health check](https://scratcher.io/help/campaigns/editor-errors-and-health-check).

You can also ask Rex: "Is the embed script working on my site?"

Until the script has been found on any of your websites, the **Embed script** panel shows **Not installed**.

## The campaign doesn't show

- **The campaign isn't published**, or its start date is in the future.
- **The script is in the wrong place.** Some website builders move scripts to the bottom of the page or remove them. Use a block made for HTML or custom code.
- **Your cookie banner blocks the script.** Some cookie consent tools block scripts they don't know. Allow the Scratcher script in your cookie tool.
- **Your website has a Content Security Policy** that blocks Scratcher. Click **Does your site use a Content Security Policy?** in the **Embed script** panel. It shows the exact sources your site must allow for the script and for the campaign frame. If you already have a policy, add the sources to it rather than sending a second one. Send it to your web developer.

## Link to the embedded campaign

On the **Campaigns** page, **Embed live URL** in a campaign's **Actions** menu opens the page on your website where the campaign is embedded.

To see where visitors come from, link people to that page with a channel. In the **Channels** settings, choose **Your website** and enter the **Page where the campaign is embedded** (it is filled in automatically the first time the campaign loads there). Each channel link then points to your page, and the script passes the channel on to the campaign. See [Track channels, Google Analytics and pixels](https://scratcher.io/help/results/track-channels-and-pixels).

## Change campaigns without touching your website

If you run a new campaign in the same spot every month, use a campaign schedule. You install one script once, and it shows the right campaign at the right time. See [Rotate campaigns with campaign schedules](https://scratcher.io/help/sharing/campaign-schedules).

Publishing and sharing

- [Share your campaign link and QR code](https://scratcher.io/help/sharing/share-your-campaign-link)
- [Share a campaign on social media](https://scratcher.io/help/sharing/share-on-social-media)
- [Embed a campaign on your website](https://scratcher.io/help/sharing/embed-on-your-website)
- [Show a campaign as a popup](https://scratcher.io/help/sharing/show-a-campaign-as-a-popup)
- [Design a popup and its teaser](https://scratcher.io/help/sharing/popup-design-and-teaser)
- [Choose your campaign's web address](https://scratcher.io/help/sharing/campaign-url-and-own-domain)
- [Send emails from your own domain](https://scratcher.io/help/sharing/email-sending-domain)
- [Rotate campaigns with campaign schedules](https://scratcher.io/help/sharing/campaign-schedules)

## Related articles

- [Show a campaign as a popupInstall the script once, choose the popup type, and decide on which pages, when, how often and for whom it shows.](https://scratcher.io/help/sharing/show-a-campaign-as-a-popup)
- [Rotate campaigns with campaign schedulesInstall one script on your website and let it show the right campaign at the right time, with no more website changes.](https://scratcher.io/help/sharing/campaign-schedules)
- [Editor errors and warnings: what they mean and how to fix themEvery error and warning the editor can show, what it means and how to fix it, and which ones stop you from publishing.](https://scratcher.io/help/campaigns/editor-errors-and-health-check)

## Still need help?

Real people are here to help. If you already use Scratcher, the quickest way is the chat inside the platform.

- **[Chat with us](https://platform.scratcher.io/login)**

    Log in and click the chat button in the bottom-right corner. Rex answers right away, and our team is a click away.
- **[Book a meeting](https://scratcher.io/book-a-meeting)**

    A free 30-minute video call with our team: a tour, campaign ideas or help with your setup.
- **[Email us](mailto:contact@scratcher.io)**

    Write to contact@scratcher.io and we will get back to you.
