Skip to main content

iFrame CTA Integration

Overview

Ownly supports widget action triggering via HTML5 postMessage, allowing seamless cross-origin communication between an embedded iFrame and the parent web page.

This feature enables clients to reserve, save, build directly from third-party platforms or partner portals where Ownly is embedded.


Prerequisites

Before using this integration:

  • The Ownly widget must be embedded on the parent page.
  • The iFrame must send valid postMessage events.
  • The parent window must listen for postMessage events.
  • Only trusted iFrame sources should be allowed to interact.
  • Ensure all required data fields are passed correctly.

How It Works

  1. The iFrame sends a structured postMessage to the parent page.
  2. The parent page verifies the origin and data structure.
  3. The parent triggers the appropriate Ownly widget action based on the message type.

This provides a secure, modular way for third-party platforms to interact with Ownly widgets.


Example

Send a message from within an embedded iFrame:

function ownlyReserveHome() {
const message = {
type: "ownly-reserve-home",
data: {
"listing-external-id": "quickPossession9",
"listing-description": "Turnkey quick possession home.",
"listing-address": "Test address",
"listing-community-id": "LpewPE7J",
"listing-community-name": "Belmont",
"listing-model-id": "b2rpZDey",
"listing-model-name": "Manhattan",
"listing-price": "412000",
"listing-size": "2406",
"listing-beds": "4",
"listing-baths": "3",
"listing-image": "https://ownly.amazonaws.com/models/328/cfd5b1fd.png",
"listing-url": ""
}
};

window.top.postMessage(message, "*"); // Replace * with a trusted domain in production
}

Data Overview

The data object contains all required listing information. This should match what Ownly expects when displaying or reserving a home.


Data Attribute Reference

The data object passed in the postMessage must include the following fields:

Field NameDescriptionRequired
listing-external-idUnique external ID for the listingtrue
listing-descriptionShort description of the hometrue
listing-addressFull address of the listingtrue
listing-community-idInternal ID of the communitytrue
listing-community-nameDisplay name of the communitytrue
listing-model-idInternal ID of the home modeltrue
listing-model-nameName of the modeltrue
listing-pricePrice of the hometrue
listing-sizeSquare footage of the hometrue
listing-bedsNumber of bedroomstrue
listing-bathsNumber of bathroomstrue
listing-imageURL of the home's display imagetrue
listing-url(Optional) Link to listing or pagefalse

These fields are used consistently across:

  • Single Family Homes
  • Multi-Family Homes
  • Quick Possession Homes

Event Types

The type field in your message determines the Ownly widget action triggered:

type ValueAction Triggered
ownly-reserve-homeOpens reservation flow for a specified listing
ownly-save-homeSaves the home to the user’s favourites
ownly-build-homeStarts the build-and-price experience
ownly-get-verifiedBegins the ID or eligibility verification process

Each action expects the data object to be passed correctly and completely.