Third-Party Embeds and Tracking
Landing pages often embed third-party tools (e.g. Cal.com for booking, Typeform/OpnForm for forms). For consistent attribution and conversion tracking you need:
- GTM and Google Analytics to load in the context of the embed (or the parent page that contains it).
- User-id passed into the embed so bookings/submissions can be tied back to the same user and ad click.
Cal.com
User-id in the booking widget
- Cal.com embed code can accept prefill parameters (e.g. hidden fields). Use this to pass the same first-party user-id you use on the rest of the site (e.g.
_c_sctor_c_pca). - In the Cal.com embed snippet, add the hidden field / query parameter that Cal.com uses for prefills (check Cal.com docs for the current parameter name, e.g.
metadata[user_id]or a custom field). Set its value from your user-id script (localStorage/cookie) before the embed loads or via the embed URL. - Result: When someone books, the event (or webhook) includes that user-id so you can attribute the conversion to the same user and campaign.
GTM and Google Analytics
- If the embed is iframed from Cal.com’s domain, the iframe content runs in Cal.com’s origin: your GTM/GA snippet on the parent page does not run inside the iframe. So:
- Page-level tracking: GTM/GA on the landing page that contains the embed will fire as usual (page view, CTA clicks, etc.). The “booking” step happens inside the iframe, so you won’t get a native GA page view for the Cal.com booking pages inside the iframe.
- Booking completion: Use one or both of:
- Cal.com webhooks / server-side events: If Cal.com sends a webhook or server event on booking, send that to your server-side GTM (or backend) and log a conversion event (e.g.
cal_booking_complete) with the user-id you passed in. - PostMessage / parent-page listener: If Cal.com supports posting a message to the parent window on booking success, listen for it on the landing page and push a
dataLayerevent (e.g.cal_booking_complete) so GTM/GA on the parent page can fire tags.
- Cal.com webhooks / server-side events: If Cal.com sends a webhook or server event on booking, send that to your server-side GTM (or backend) and log a conversion event (e.g.
- If Cal.com is embedded in a way that keeps the user on your domain (e.g. Cal.com’s inline or overlay embed that still loads your GTM/GA), then GTM and GA will already run on that page; ensure your base GTM/GA snippet is on the page and that you fire a conversion tag when the booking is completed (e.g. via the same webhook or PostMessage approach above).
Checklist
- User-id is passed into the Cal.com embed (hidden field or prefill parameter).
- GTM and GA are installed on the landing page that contains the Cal.com embed (so page view and other in-page events are tracked).
- A conversion event for “booking completed” is implemented (webhook to sGTM, or PostMessage + dataLayer on the parent page, or both).
- That conversion event includes the same user-id for attribution.
Other embeds (forms, surveys)
- Forms (e.g. OpnForm, Typeform): Same idea: pass user-id via hidden field or URL parameter into the form so submissions carry it. See GTM and OpenForm for the
_c_pca/ hidden-field pattern. - GTM/GA: If the form is in an iframe, GTM/GA on the parent page still run; fire a conversion tag when the form submit is detected (e.g. form submit listener, or server-side webhook from the form tool).
Summary
| Embed type | User-id | GTM/GA |
|---|---|---|
| Cal.com | Pass via prefill/hidden field in embed config | On parent page; booking completion via webhook or PostMessage + dataLayer |
| OpnForm / form tools | Hidden field or URL param (same as main site user-id) | On parent page; form submit event or webhook for conversion |
Adding GTM and Google Analytics to the page that contains Cal.com (and passing user-id into Cal.com) gives you consistent tracking and attribution for booking conversions.