Iframe embed for popup builders
Drop ReTarget.gg offers into a GeoTargetly-style popup with a single iframe: no script tag, no allowlist negotiation, two query params.
Some publishers can't drop a global <script> tag: for example when offers need to render inside a popup built with GeoTargetly, OptinMonster, ConvertBox, Sleeknote, Wisepops, Privy, or any no-code overlay tool. ReTarget.gg ships a tiny cross-origin iframe that renders the same section ad block as widget-section.js, with just two query params: no script, no allowlist negotiation, no host-page CORS to debug.
TL;DR
<iframe
src="https://retarget.gg/?pub=YOUR_PUBLIC_KEY&website=YOUR_WEBSITE_KEY"
style="width:100%;min-width:320px;min-height:280px;border:none;overflow:auto;"
title="Offers"
></iframe>Paste into your popup builder, replace the two placeholders, done.
When to use this
Use the iframe when all of these are true:
- You can paste arbitrary HTML into a popup / modal / banner builder.
- You can't add a top-level
<script>tag to the page (the popup tool sandboxes its content, or the page is locked down by your CMS or consent manager). - You're OK with a single ReTarget.gg offer block rendering inside the popup: no full-page geo overlay, no Trigger Widget flow.
If you can add a regular script tag, prefer the Section widget or Geo-blocking widget. They're lighter, give you layout control, and can talk to the host page (events, resize, etc.).
How it works
Iframe loads with your keys
Pass your public key (
pub=…) and website key (website=…) as query params. The iframe URL resolves to a hosted view tied to your website.Offers render inside the iframe
The hosted view fetches a decision and: if the visitor is on the blocked side: up to 6 offer cards for their country. All traffic is attributed to the website whose keys you passed.
Clicks open in a new tab
Offer clicks open in a new tab so your popup stays put. Attribution and earnings land in the same Websites → Analytics page as the script-tag embeds.
The iframe is designed to be embedded cross-origin, so any parent page can frame it.
Step-by-step: GeoTargetly
GeoTargetly is the most common pairing because it lets you fire popups based on country / region. Fresh-account walkthrough:
1. Create the popup
- Sign in to dashboard.geotargetly.com.
- Add new popup → Custom HTML popup (the "blank canvas" option). Avoid the templated lead-gen popups.
- Name it something memorable:
ReTarget.gg: geo block fallback.
2. Paste the HTML
<div style="
width: 500px;
max-width: 100%;
background-color: #ffffff;
font-family: Arial, sans-serif;
text-align: center;
padding: 20px;
box-sizing: border-box;
border-radius: 10px;
">
<div style="margin-bottom: 20px;">
<h2 style="margin-bottom: 10px; font-size: 20px; color: #333;">
Service Not Available in Your Location
</h2>
<p style="font-size: 14px; color: #555; line-height: 1.5;">
We're sorry, but our services are not currently available in your region
due to geographic compliance requirements.
</p>
<p style="font-size: 13px; color: #777; margin-top: 10px;">
Thank you for your understanding.
</p>
</div>
<div style="width: 100%;">
<iframe
src="https://retarget.gg/?pub=YOUR_PUBLIC_KEY&website=YOUR_WEBSITE_KEY"
style="width:100%;min-width:320px;min-height:280px;border:none;overflow:auto;"
title="Offers"
></iframe>
</div>
</div>3. Find your keys
- ReTarget.gg dashboard → Websites → click your site.
- On the site detail page, find the Integration keys section: copy the
pk_…intopub=and theweb_…intowebsite=.
4. Targeting and triggers
In GeoTargetly:
- Geo target → Show to visitors from: any country / region your main product doesn't support.
- Display rules: On page load or After 2 seconds: ReTarget.gg loads offers async, so pop immediately is fine.
- Frequency: 1 per session keeps the UX clean.
5. Pick the pages
In the Pages tab, choose where this popup fires. Most publishers set /* so blocked traffic always sees an alternative.
6. Activate
Save, activate, and the iframe is live for matching visitors.
Other popup builders
The same HTML works in any builder that accepts custom markup:
| Builder | Where to paste | Notes |
|---|---|---|
| OptinMonster | "Custom HTML" element | Disable OptinMonster's "Yes/No" or "Optin" form: you don't need them. |
| ConvertBox | "HTML / embed" block | Set block width to 100%. |
| Sleeknote | "Custom HTML" element | Editor adds a max-width wrapper: set to at least 320px. |
| Wisepops | "Custom HTML" widget | Tick "Allow this widget to receive third-party content". |
| Klaviyo Forms (Pro) | "Custom HTML" block | Use min-height: 320px. |
| Hello Bar | "Custom HTML" template | Best for full-screen takeovers. |
| Privy (Plus) | "Custom HTML" element | Available only on Plus plan. |
Required query params
| Param | Required | What it is |
|---|---|---|
pub | yes | Public key (pk_xxxxxxxxxxxx_xxxxxxxx). |
website | yes | Website key (web_xxxxxxxxxxxxxxxx). |
Missing either key and the iframe falls back to the marketing homepage: so if you see marketing copy inside the iframe, you forgot a key. data-pub / data-website are accepted as aliases, but pub / website is canonical.
Sizing
The iframe is fixed: it does not auto-resize to its content. Sensible defaults:
| CSS | Reason |
|---|---|
width: 100% | Fill the popup container. |
min-width: 320px | Phone-friendly without horizontal scroll. |
min-height: 280px | Fits 3 to 4 offer cards on most layouts. |
min-height: 480px | Fits the full 6-card grid without inner scroll. |
overflow: auto | Graceful fallback for short popups. |
border: none | Remove the default iframe border. |
Small bottom-bar popups: min-height: 200px collapses to a 2-card carousel. Full-screen takeovers: height: 100% and let the parent size everything.
Styling
You can't restyle the cards: browsers sandbox cross-origin frames. What you can style:
- Popup background, padding, border radius, drop shadow.
- Headline and explainer copy around the iframe.
- Close button (if your builder doesn't ship one).
- Logos or branding.
Pick a popup background that contrasts with the iframe's white card background (soft grey or your brand color works). Keep the surrounding copy short: visitors should understand "these are alternative offers" within 2 to 3 seconds.
Parent domain
Each ReTarget.gg website is bound to a single registered domain. The iframe is designed to be embedded from any parent page, so what matters for your analytics is that the pub / website keys in the iframe src match the website you expect the traffic to land on.
If you need to run offers on two distinct parent domains, register each as its own website in the dashboard and use the corresponding keys in each popup.
Limitations vs script-tag embed
| Feature | Iframe | Section / geo widget |
|---|---|---|
| Full-page geo overlay | ❌ | ✅ (widget.js) |
| Trigger Widget flow | ❌ | ✅ (widget-decline.js) |
| SDK hooks (events, resize) | ❌ | ✅ |
| Auto-resize | ❌ | ✅ (section widget) |
| Deep customization | ❌ | ✅ (layout + container) |
If any of these matter, use Section or Geo-blocking directly.
Testing
Local visit
Trigger the popup from your own browser. If you're inside an allowed country, the popup probably won't fire: that's geo rules doing their job.
VPN test
Connect to a blocked country that has active advertisers (US, UK, Germany, Australia, Canada are reliable). Reload and the iframe should fill with 3 to 6 cards.
Click test
Click an offer. It opens the advertiser's landing page in a new tab; your popup stays put.
Reporting check
Dashboard → Websites → [your site] shows new impressions on your next refresh. Clicks appear once the invalid-click filter clears them.
Common errors
| Symptom | Fix |
|---|---|
| Marketing homepage inside iframe | Missing / mistyped pub or website. Re-copy from the dashboard. |
| "No offers available in your region" | No active advertisers for that country. Test with a US/UK VPN. |
| Popup never fires | Popup-builder issue. Disable the builder's geo rules temporarily to confirm. |
| Iframe cut off / scrollable | min-height too low. Bump to 320px+. |
X-Frame-Options: DENY error | You embedded the wrong URL. Only the query-param form https://retarget.gg/?pub=…&website=… is designed to be iframed. |
| Clicks freeze the page | Consent / privacy plugin intercepting iframe clicks. Allowlist *.retarget.gg in your CMP. |
FAQ
Does the iframe count toward my ReTarget.gg analytics? Yes: every iframe load is one impression, every click is one click for the website key in the src. Same reporting as script-tag embeds.
Do I need a separate website key per popup tool? No. One website key per site (parent domain). Fire the same iframe from multiple popups without issue.
Will it slow down my page? The iframe loads lazily inside the popup: which itself fires after the builder's own script: so it doesn't block the parent page's rendering.
Can I change which offers are shown? Offer eligibility comes from the ReTarget.gg marketplace; you can't hand-pick offers from the iframe. To narrow the marketplace, restrict Verticals on your website.
Is it GDPR / consent-safe? The iframe doesn't set first-party cookies on the parent page. It does fire ReTarget.gg's own analytics inside the iframe (see Privacy). If you want explicit consent, render the popup only after marketing cookies are accepted in your CMP.
Related
Publisher
Geo Popup & Decline Popup overview
The product framing for the install you just read.
Advertiser
CPC, CPA, eCPM in one auction
The demand side of the network — useful context even for publishers.
Essays
Long-form strategy
How others think about geo-blocking, KYC declines, and bid models.
Need help with setup?
Send us your website stack, target regions, and whether you are installing Geo Popup or Decline Popup.