What You’ll Learn in This Article:
-
How to embed a YouTube video inside a Digioh campaign
-
Where to place the YouTube embed code in the campaign editor
-
How to test that your video displays correctly
-
What YouTube Error 153 means and how to fix it
Adding a YouTube video to a Digioh campaign is a great way to engage visitors with product demos, tutorials, or promotional content without sending them away from your site.
NOTE: In addition to YouTube, this process will work for any video player that provides embed code, such as Vimeo.
Step 1: Copy the YouTube Embed Code
- Go to the YouTube video you want to use.
- Click Share below the video.
- Select Embed.
- Copy the iframe embed code provided by YouTube.

It will look similar to this:<iframe width=”560″ height=”315″
src=”https://www.youtube.com/embed/YOUR_VIDEO_ID”
title=”YouTube video player”
frameborder=”0″
allow=”accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture”
allowfullscreen>
</iframe>
Step 2: Add the Video to Your Digioh Campaign
- Go back into Digioh and open the campaign where you’d like to add the video.
- In the Editor, click the HTML tabfor the page where you want to embed the campaign.

- Click + Add HTML Block
- Paste the YouTube embed code into the HTML field. The video will appear in your campaign once you add the code to the HTML field.

- (Optional) You can adjust the width and height. By default, YouTube sets its video dimensions larger than you may want for your campaign. The example below cuts the length and width down to 1/3 of their original value to show a smaller video that fits nicely next to the form.

Experiment with the size and placement of the video to find what works best with your pop-up. - Click Save.
Step 3: Test the Campaign
After adding the video:
-
Test your campaign on your live site.
-
Note: You can use the preview on live site feature for this by going to your campaigns list > Eye Icon > Preview on Live Website.
-
-
Confirm the video loads correctly inside the campaign.
-
Publish the campaign when ready.
If the video does not load correctly, review the troubleshooting section below.
Troubleshooting: YouTube Error 153
Some customers may encounter YouTube Error 153 when embedding videos inside Digioh campaigns.
What Error 153 Means
YouTube recently updated its security policies for embedded videos. These updates require embedded videos to verify the origin (domain) of the page hosting the video.
By default, Digioh campaigns are rendered inside a dynamically created iframe with the origin about:blank. Because this iframe does not have a verifiable domain, YouTube may block the video and display Error 153.
To resolve this, the campaign needs to be served from a hosted iframe on your own domain, which provides a valid origin for YouTube.
How to Fix Error 153 (Hosted iFrame Solution)
The recommended fix is to configure a Hosted iFrame, which loads campaign content from a file on your own domain instead of the default about:blank iframe.
This only needs to be set up once.
Step 1: Create a Hosted HTML File
Create a file called: campaign.html
Add the following template code to the file:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script>
(function() {
try {
// Extract root domain for validation
function getRootDomain(host) {
if (!host) return '';
var parts = host.toLowerCase().split('.');
if (parts.length <= 2) return host;
var last = parts[parts.length - 1];
var second = parts[parts.length - 2];
// If TLD is 2 chars (country-code) and second-level is short, return last 3 labels
if (last.length === 2 && second.length <= 3) {
return parts.slice(-3).join('.');
}
return parts.slice(-2).join('.');
}
// Validate domain format (host only, no path)
function isValidDomain(domain) {
if (!domain) return false;
// Check for valid domain format: alphanumeric, dots, hyphens only
// No IPs, localhost, or special chars
var validFormat = /^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$/i;
if (!validFormat.test(domain)) return false;
// Block localhost and IP addresses
if (/^(localhost|127\.|0\.|10\.|172\.(1[6-9]|2[0-9]|3[01])\.|192\.168\.)/.test(domain)) return false;
if (/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(domain)) return false;
return true;
}
function normalizeCdnInput(value) {
if (!value) return { host: '', path: '' };
var host = value;
var path = '';
try {
if (/^https?:\/\//i.test(value)) {
var parsed = new URL(value);
host = parsed.hostname;
path = parsed.pathname || '';
} else if (value.indexOf('/') >= 0) {
var parsedWithProtocol = new URL('https://' + value);
host = parsedWithProtocol.hostname;
path = parsedWithProtocol.pathname || '';
} else {
host = value;
}
} catch (e) {
return { host: '', path: '' };
}
// Basic path safety check (allow path segments only, no traversal)
if (path && !/^\/[a-z0-9\-._~\/]*$/i.test(path)) {
return { host: '', path: '' };
}
if (path && /(^|\/)\.\.(\/|$)/.test(path)) {
return { host: '', path: '' };
}
// Trim trailing slash to avoid double slashes when appending
if (path.length > 1 && /\/$/.test(path)) {
path = path.replace(/\/+$/, '');
}
return { host: host, path: path };
}
// Get CDN domain from URL parameter, fallback to default
var cdn = 'www.lightboxcdn.com';
var requestedCdn = '';
try {
var search = window.location.search;
if (search) {
var match = search.match(/[?&]cdn_domain=([^&]+)/);
if (match) requestedCdn = decodeURIComponent(match[1]);
}
} catch(e) {
// Parsing failed, use default
}
// Validate cdn_domain if provided (allow optional path segment)
var cdnParts = null;
if (requestedCdn) {
cdnParts = normalizeCdnInput(requestedCdn);
if (!cdnParts.host || !isValidDomain(cdnParts.host)) {
cdnParts = null;
}
}
if (requestedCdn && cdnParts) {
var iframeHost = window.location.hostname;
var iframeRoot = getRootDomain(iframeHost);
var cdnRoot = getRootDomain(cdnParts.host);
// Allow if:
// 1. Default lightboxcdn.com domain
// 2. zeropartyforms.com domain
// 3. Same root domain as iframe host (customer's domain)
if (cdnRoot === 'lightboxcdn.com' || cdnRoot === 'zeropartyforms.com' || (iframeRoot && cdnRoot === iframeRoot)) {
cdn = cdnParts.host + (cdnParts.path || '');
}
// Otherwise use default (prevents arbitrary domain attacks)
}
var protocol = location.protocol === 'https:' ? 'https://' : 'http://';
var head = document.head || document.getElementsByTagName('head')[0];
// Load lz-string
var s1 = document.createElement('script');
s1.src = protocol + cdn + '/static/lz-string-1.4.4.js';
s1.onerror = function() {
// Script failed to load - fail silently to not break customer site
};
s1.onload = function() {
try {
// Load box-iframe-init
var s2 = document.createElement('script');
s2.src = protocol + cdn + '/static/box-iframe-init.js';
s2.onerror = function() {
// Script failed to load - fail silently
};
head.appendChild(s2);
} catch(e) {
// Failed to load second script - fail silently
}
};
head.appendChild(s1);
} catch(e) {
// Complete failure - fail silently to not break customer site
}
})();
</script>
</head>
<body>
</body>
</html>
Step 2: Upload the File to Your Website
Upload the file to your server so it is publicly accessible.
Example:
https://www.yoursite.com/campaign.html
Requirements:
- The file must be publicly accessible
- It must be served over HTTPS
- The MIME type should be text/html
Possible locations include:
https://www.yoursite.com/campaign.htmlhttps://www.yoursite.com/lightbox/campaign.htmlhttps://cdn.yoursite.com/digioh/campaign.html
Step 3: Configure Hosted iFrame Metadata
Next, configure the hosted iframe inside Digioh.
-
Open your campaign in Digioh.
-
Go to Settings > Campaign Settings > Campaign Metadata.

-
Add the following metadata entry:
- Key: hosted_iframe
- Value: https://www.yoursite.com/campaign.html
This tells Digioh to load the campaign from your hosted file.
Additional Troubleshooting
If your video still does not load:
-
Confirm the hosted_iframe metadata key is spelled correctly
-
Verify the hosted file is accessible via HTTPS
-
Test the hosted file URL directly in your browser
-
Clear cache or test in an incognito window
-
Check the browser console for errors
If you continue to experience issues embedding YouTube videos in your campaigns, please contact support@digioh.com and include the campaign ID and the page URL where you’re testing and we’ll be happy to help.