Integration Guide · For DMVEz Tech Team
Drop the Montana Registration Services finder inside the DMVEz portal so existing customers can buy additional registrations without leaving the portal.
Embed this URL in an iframe. The finder is already chrome-free (no header / no footer), transparent background, and configured to skip lead capture and pre-fill from URL parameters.
https://quiz.mtregistrationservices.com/find-mrs-embedPass whatever DMVEz already knows about the customer. The finder will pre-fill the relevant fields and tag the GHL contact for clean attribution.
| Param | Effect | Example |
|---|---|---|
email |
Pre-fills the email field on the order step. | tim@example.com |
first_name |
Pre-fills first name. firstName also accepted. |
Tim |
last_name |
Pre-fills last name. lastName also accepted. |
Kennedy |
name |
Alternative: pre-fills both names from one field. | Tim Kennedy |
phone |
Pre-fills phone field. | 4065551234 |
dmvez_customer_id |
Passes through to GHL as a contact tag for portal-to-purchase attribution. Use the DMVEz customer ID so finance can join the two. | cust_42891 |
source |
Defaults to dmvez_portal if omitted. Override only if you split-test multiple portal entry points. |
dmvez_portal |
Drop this anywhere in the DMVEz portal. Replace the USER_* placeholders with the values you have on the customer at render time.
<iframe
id="mrs-finder"
src="https://quiz.mtregistrationservices.com/find-mrs-embed?email=USER_EMAIL&first_name=USER_FIRST&last_name=USER_LAST&phone=USER_PHONE&dmvez_customer_id=USER_ID"
style="width:100%; border:0; min-height:600px; display:block;"
allow="payment *; clipboard-read; clipboard-write"
referrerpolicy="origin"
title="Add a Montana registration">
</iframe>
src string. Phone numbers with + or names with spaces will break otherwise. In JS: encodeURIComponent(value).
The iframe posts two events to the parent window. Wire this listener once on the portal page so the iframe grows with content and so checkout escapes the iframe cleanly.
<script>
window.addEventListener('message', function (e) {
// Only trust messages from our finder origin.
if (e.origin !== 'https://quiz.mtregistrationservices.com') return;
var data = e.data || {};
// (1) Auto-resize the iframe to fit content — fires on every step change.
if (data.type === 'finder-resize' && typeof data.height === 'number') {
var f = document.getElementById('mrs-finder');
if (f) f.style.height = (data.height + 40) + 'px';
}
// (2) Customer finished the funnel — send the DMVEz portal top window to
// DMVEz checkout. Don't nest a checkout iframe inside this iframe — Stripe
// 3DS popups break in nested iframes.
if (data.type === 'finder-navigate' && data.url) {
window.location.href = data.url;
}
});
</script>
If the DMVEz portal is React-based, this is the same thing wrapped as a component. customer is whatever shape your portal already has.
import { useEffect, useRef } from 'react';
const FINDER_ORIGIN = 'https://quiz.mtregistrationservices.com';
export function MrsFinderEmbed({ customer }) {
const ref = useRef(null);
useEffect(() => {
function onMessage(e) {
if (e.origin !== FINDER_ORIGIN) return;
const data = e.data || {};
if (data.type === 'finder-resize' && typeof data.height === 'number' && ref.current) {
ref.current.style.height = (data.height + 40) + 'px';
}
if (data.type === 'finder-navigate' && data.url) {
window.location.href = data.url;
}
}
window.addEventListener('message', onMessage);
return () => window.removeEventListener('message', onMessage);
}, []);
const params = new URLSearchParams({
email: customer.email || '',
first_name: customer.firstName || '',
last_name: customer.lastName || '',
phone: customer.phone || '',
dmvez_customer_id: customer.id || '',
});
return (
<iframe
ref={ref}
src={`${FINDER_ORIGIN}/find-mrs-embed?${params.toString()}`}
style={{ width: '100%', border: 0, minHeight: 600, display: 'block' }}
allow="payment *; clipboard-read; clipboard-write"
referrerPolicy="origin"
title="Add a Montana registration"
/>
);
}
{ type: 'finder-navigate', url: '<DMVEz checkout URL>' } to the parent (DMVEz portal)./find-mrs-embed endpoint intentionally sends no X-Frame-Options header, so any origin can iframe it. If DMVEz wants to lock it down later, request a frame-ancestors CSP allowlist from Tim.localStorage (not cookies) for session state. Safari 17+ partitions storage per top-level site, which is fine — each DMVEz user gets their own finder session.e.origin === 'https://quiz.mtregistrationservices.com' in your message handler. The snippets above already do.Run these once in a DMVEz portal staging environment before going live.
/find-mrs-embed with no header or footer visible.?email=test@example.com, the email field is pre-filled at the order step.source=dmvez_portal tag.Questions, bugs, or feature requests: timk@dirtlegal.com. Engineering side is owned by the TK-DL platform team.
Engineering reference: src/quiz-platform/widget/standalone-finder-mrs-embed.html · route src/quiz-platform/server.js#/find-mrs-embed · commit b096cf75