Embeds
Put a contact form or the whole landing page on a domain you own.
Embeds
Two script tags, for the two things sellers want on a domain they already own: the whole landing page, or just a contact form somewhere on their own page. Both work out which listing they belong to from the host page, so the same line works on every domain on your account.
There is no API key here and nothing to configure. Enquiries from an embed
arrive as ordinary leads, so they show up in your inbox, over the
API and in the lead.created
webhook like any other.
Each listing also shows its own snippets in the account area under Domains → Edit → Integrate.
Full landing page
Put this on the site the domain itself serves. It replaces the page with the listing's landing page: name, description, metrics, the contact form, and the price when the listing may show one.
<script src="https://ydomain.com/embed/landing.js" async></script>
It is the marketplace listing page, minus the marketplace header and the
breadcrumb that leads back into it. The framed copy is noindex, so it never
competes with the listing itself in search results.
| Attribute | Default | Use |
|---|---|---|
data-domain |
The page host | When the page is not served by the listing |
data-locale |
<html lang> |
Force a language |
<script src="https://ydomain.com/embed/landing.js"
data-domain="example.net"
data-locale="nl" async></script>
A host that is not listed with us leaves the page untouched, so an accidental install on the wrong site does nothing.
Contact form only
Put this where you want the form. It renders in place, in a frame that reports its own height, so it grows and shrinks with its content.
<script src="https://ydomain.com/embed/lead-form.js" data-height="720" async></script>
| Attribute | Default | Use |
|---|---|---|
data-domain |
The page host | When the page is not served by the listing |
data-locale |
<html lang> |
Force a language |
data-target |
Next to the script tag | CSS selector to render into |
data-max-width |
560 |
Widest the form may get, in pixels |
data-height |
720 |
Height to start at, before the form reports its own |
<div id="offer"></div>
<script src="https://ydomain.com/embed/lead-form.js"
data-domain="example.net"
data-target="#offer"
data-locale="nl"
data-max-width="640" async></script>
What to expect:
- Enquiries land in your normal lead inbox, tagged with source
embed. - Views from an embed are counted apart from marketplace views, so the stats page shows parked traffic separately.
- A subdomain falls back to the listing above it: a form on
offers.example.netbelongs toexample.net. - On a listing that may not advertise a sale the form is still there, without any offer field or sale wording.
Without JavaScript
Frame it yourself. This is the only page of ours that may be framed on another site.
<iframe
src="https://ydomain.com/embed/lead-form/example.net"
style="width:100%;max-width:560px;height:720px;border:0"
loading="lazy"
title="Contact the owner of example.net"></iframe>
The framed form posts its height to the parent window, if you want to size it yourself:
window.addEventListener('message', (event) => {
if (event.origin !== 'https://ydomain.com') return;
const payload = event.data && event.data.ydomainEmbed;
if (!payload || payload.type !== 'height') return;
document.querySelector('iframe').style.height = `${payload.value}px`;
});
Resolving a host yourself
Both scripts use one small public endpoint, and so can you. It needs no authentication and is CORS-open.
curl "https://ydomain.com/embed/resolve?host=offers.example.net&locale=nl"
| Parameter | Notes |
|---|---|
host |
Hostname to look up. A leading www. is ignored |
locale |
Optional; falls back to the default language |
{
"found": true,
"domain": "example.net",
"url": "https://ydomain.com/nl/embed/lead-form/example.net",
"landing_url": "https://ydomain.com/nl/embed/landing/example.net",
"title": "Make an offer for example.net",
"height": 720
}
An unknown, hidden or unpublished listing answers plainly, and the scripts then render nothing:
{
"found": false
}
title never promises a sale the listing may not advertise: on a parked name it
comes back as "Contact the owner of example.net".
Answers are cached for five minutes, so a listing you have just published can take that long to appear on a parked page.