Note: This feature requires adding JavaScript to your website. If you are not comfortable with code, we recommend involving a developer.
Optix embedded forms can send tracking events to your website as visitors move through them. Under the hood, forms run inside an iframe and use window.postMessage to pass events to your page - so you can forward them to Google Analytics, your CRM, or any analytics system you already use.
Tracking events works across all four Optix forms: drop-in bookings, tour bookings, sign-up, and inquiry.
Tracking events helps you:
Measure conversions accurately: Know when a visitor completes a booking, joins a plan, books a tour, or submits an inquiry - without relying on page redirects.
Connect campaigns to outcomes: Pair Optix events with your own UTM parameters or referrer data to see which channels are driving memberships and bookings.
Send data anywhere: Forward events to Google Analytics, a tag manager, your CRM, or any pipeline your team already uses.
How to enable tracking
How to enable tracking
Tracking events are off by default, so existing embeds are unaffected. How you turn tracking on depends on how the form is embedded on your page.
Option 1: Embed code from Settings > Web forms (recommended)
Most sites use the embed code copied from Settings > Web forms - a div tag (optix-member-widget, optix-booking-widget, optix-tour-widget, or optix-inquiry-widget), or a popup <a> link, paired with the optix.v1.js script. This code does not include tracking by default. To turn it on, add optix-tracking="1" directly to your existing embed:
<div class="optix-booking-widget" optix-venue="your-space" optix-mode="embed" optix-tracking="1"></div>
To restrict delivery to your site only (recommended, since events can carry personal data like email addresses), also add optix-tracking-origin:
<div class="optix-booking-widget" optix-venue="your-space" optix-mode="embed" optix-tracking="1" optix-tracking-origin="https://your-website.com"></div>
Keep the optix.v1.js script tag in place - it reads these attributes and turns tracking on for you. This works the same way for all four widget types and for the popup <a> link. You do not need to replace your embed with an iframe to get tracking working.
Option 2: Custom iframe embed
If you built your own iframe embed directly, rather than using the embed code from the dashboard, add ?tracking=1 to the form URL in your iframe instead:
<iframe src="https://your-space.optixapp.com/signup/?tracking=1"></iframe>
By default, messages are sent to any parent origin (*). To restrict delivery to your site only, also pass your origin:
<iframe src="https://your-space.optixapp.com/signup/?tracking=1&tracking_origin=https://your-website.com"></iframe>
Note: Why is tracking opt-in? Conversion events carry personal data (email, name). Keeping tracking opt-in means this data only flows where it is expected. It also avoids conflicts with other scripts on your page that listen for window messages.
How to listen for events on your page
How to listen for events on your page
Add a message event listener to your page. Always check e.data.source === "optix-form" first - your page may receive messages from many sources.
window.addEventListener("message", (e) => { if (!e.data || e.data.source !== "optix-form") return; // Forward to Google Analytics (gtag.js) gtag("event", e.data.event, { form: e.data.form, ...e.data.payload }); // ...or merge with your UTM/source data and send anywhere });
How to set the message format
How to set the message format
Every event posted to the parent window has this shape:
{ source: "optix-form", form: "booking" | "tour" | "signup" | "inquiry", event: "page_view" | "booking_confirmed" | ..., payload: { ... }, ts: 1718000000000 }
source - Always "optix-form". Use this to filter out unrelated messages.
form - Which form fired the event: "booking", "tour", "signup", or "inquiry".
event - The event name. See the table below.
payload - Event-specific fields. See the table below.
ts - Emit time in milliseconds. Useful for de-duplicating messages.
What are the supported events
What are the supported events
Event | Form(s) | When it fires | Payload fields |
form_ready | All | The form has loaded | (none) |
page_view | All | On every step / route change | name, path |
booking_checkout | Booking | Visitor reaches the sign-in step | resource_id, resource_name, location_id, location_name, start_timestamp, end_timestamp, subtotal, total |
booking_confirmed | Booking | A booking is confirmed | user_email, booking_id, resource_id, resource_name, location_id, location_name, start_timestamp, end_timestamp, subtotal, total |
tour_confirmed | Tour | A tour is booked | user_email, tour_id, location_id, location_name, start_timestamp, end_timestamp |
signup_checkout | Sign-up | Visitor reaches the payment step | user_email, plan_name, pass_name, plan_start_timestamp, plan_duration_months, total |
signup_completed | Sign-up | A sign-up is completed | user_email, plan_name, pass_name, plan_start_timestamp, plan_duration_months, total |
inquiry_submitted | Inquiry | An inquiry is submitted | user_email, plan_name, pass_name, custom_inquiry |
Note: start_timestamp and end_timestamp are Unix timestamps in seconds. Some payload fields are omitted when not yet available - for example, booking_checkout does not include user_email because the visitor has not signed in yet. The subtotal and total on booking_checkout are estimates from the payment preview; booking_confirmed carries the final confirmed amounts.
FAQs
FAQs
Can I track UTM parameters or referral sources through Optix events?
You can read the UTM parameters or referrer data from your own page URL and attach them to the event before forwarding it to your analytics system. Optix events tell you what happened (a booking, a sign-up, a tour); your page gives you where the visitor came from. Combine the two on your end to get full attribution.
Does adding ?tracking=1 or optix-tracking="1" affect existing embeds?
No. Tracking events are off by default. An embed only sends events once you opt in, and there are two ways to opt in depending on your embed type: add optix-tracking="1" to your existing widget embed (the div or popup <a> code from Settings > Web forms), or add ?tracking=1 to the URL if you're using a custom iframe embed. Any embed without one of these does not send events and is unaffected.
Which forms support tracking events?
All four Optix embeddable forms support tracking events: drop-in bookings, tour bookings, sign-up, and inquiry.
Does tracking work if I'm using Link mode instead of an embed?
No. Link mode sends visitors directly to your *.optixapp.com page instead of embedding the form on your site, so there's no parent page on your site to receive the postMessage events. Tracking requires an embed, either the widget embed code or a custom iframe, so your site is the parent frame listening for messages.
What is tracking_origin, and should I use it?
With the default *, the browser delivers each event to whatever origin occupies the parent frame, including if your page is itself embedded somewhere else. Setting tracking_origin (or optix-tracking-origin, for widget embeds) to your exact site (e.g. https://your-website.com) ensures personal data in conversion events is only ever delivered to your page. Use it whenever events carry user data, which they do for any conversion event.
What is the ts field for?
The ts field records the emit time in milliseconds. You can use it to de-duplicate events on your end if needed.
Need more info on Forms?
