You can integrate Ometria's hosted preference centre page on your website using an iframe to mirror the page our team creates for you.
This is useful if you'd like the preference centre to display on a contact's account page so you can capture the same preferences on that page as you would via email.
Before you begin
Raise a request with our Support team and provide the URLs you plan to embed your iframe in.
Support will make sure this URL is whitelisted so that the form will work correctly.
Setting up the iframe
The preference centre link is dynamically generated with the following structure:
To render a unique preference centre page you'll need a page on your website dedicated to the preference centre.
- This page must only be accessible to logged in contacts.
- For every logged in contact accessing this page, their email address must be known in order to render the iFramed preference page successfully.
When a contact accesses the page, the following requests should be executed, in this order:
- A logged in contact accesses the preference centre page.
- A request is made to Ometria to associate the user's email address to their profile ID.
- The profile ID populates inside the
<iframe>tag to render the contact's personal preference centre.
- The contact is served with their own personal preference centre, hosted on ometria.email.
To render John’s preference centre, the website makes the following request using the Profiles endpoint of Ometria’s Data API and a populated email parameter:
will return these two fields below (among many others):
The id value can now be used to populate the profile hash within src:
title="Inline Frame Example"
You can find your
account ID in the URL used to access your account on app.ometria.com.
This must be a fixed value for your iframe rendering.
Why use iframe?
Embedding Ometria's preference centre directly in your website will help with any future changes, as amendments to the preference centre are reflected in the iframe.
This means it's a great option if you don't want to manage two preference centres.
Preference centres which are embedded using iframe update as soon as a contact changes their preferences, so the changes are immediately saved against their contact details in Ometria: