Tracking Bing Conversions Within iFrame?
I’ve been researching for a bit now and it seems like there is just no easy way to track Microsoft ad conversions within an iFrame.
On our site we use Pardot forms, which are obviously embedded within an iframe. We created an event listener that passes event data from the iframe to the browser, and can get picked up by Google (both Analytics and ads).
I was hoping this would work for our Microsoft ads as well, but Microsoft’s documentation states in no uncertain terms “don’t put the UET event code in an iframe”.
I’m thinking at this point my best option will just be to rely on goal completions in GA relating to UTM values to measure the performance of my Microsoft ads campaigns, but I’d love to pass those conversion events back to the Microsoft platform for tracking there if possible.
Has anyone found a solution?
The short answer is:
Your reliance on the event listener that successfully passes data to Google is a fantastic first step, but you’re correct that the standard Microsoft Universal Event Tracking (UET) tag won’t work within the iFrame, and Microsoft explicitly forbids it.
The excellent, reliable, and cost-effective solution is to stop trying to fire the UET tag client-side and instead implement server-side conversion tracking using your existing systems.
Specifically, you should use the Salesforce Account Engagement API (Pardot API) or Webhooks to push the conversion data (including the msclkid
which you can capture on the parent page) directly to the Microsoft Advertising Offline Conversion API.
This server-side method bypasses all iFrame and browser restrictions and feeds high-quality, first-party data directly into Microsoft’s ad algorithms for accurate measurement and optimization.
The long answer is:
Your current approach of using an event listener to pass data from the Pardot iFrame to the parent window’s data layer is the most common and robust way to handle iFrame forms for client-side tracking like Google Analytics and Google Ads.
However, as you’ve found, Microsoft’s UET tag is notoriously restrictive regarding iFrames.
Simply firing the UET event tag with the event listener data still relies on a client-side mechanism that is prone to being blocked or encountering issues with the iFrame context.
The most effective, long-term solution is to shift your Microsoft conversion tracking entirely to a server-side process, leveraging the tools you already have.
Capture the Microsoft Click ID (msclkid
): On the parent page, you need to capture the msclkid
URL parameter and store it in a cookie or session storage.
This is the crucial unique ID that links the form submission back to the specific Microsoft ad click.
Pass msclkid
through the Form: Use your event listener and the data layer push to capture the form submission, but also ensure you pass the stored msclkid
value from the parent page’s cookie into a hidden field in the Pardot form.
When the user submits the form, Pardot captures the lead data, including the msclkid
.
Server-Side Send via Salesforce Account Engagement API/Webhooks: Instead of firing the UET tag client-side, you use Pardot’s built-in functionality to notify an external service upon successful form submission.
Pardot Webhooks: This is the cheapest and simplest approach.
You configure a Pardot Completion Action to fire a webhook upon form completion.
This webhook sends the lead’s email, the conversion time, and the captured msclkid
(plus any value data) to a dedicated server endpoint.
Salesforce Account Engagement API: This is a more robust, but more complex and potentially costly, option where you retrieve the data from the API after the form submission.
Google Tag Manager (GTM) Server Container + Stape/GCP as the Endpoint: The cheapest and most flexible server endpoint is the GTM Server Container hosted on a platform like Stape or Google Cloud Platform (GCP).
The Pardot webhook is configured to send its data payload to the GTM Server Container URL.
In the GTM Server Container, you use a Microsoft Advertising Offline Conversion API Tag (which Stape offers a template for) to process the incoming data.
This tag takes the msclkid
, the conversion time, and the conversion value, and securely sends them directly to the Microsoft API endpoint.
This architecture – Salesforce/Pardot Webhook GTM Server Container Microsoft Advertising Offline Conversion API – solves your problem completely.
It sends conversions as a first-party, server-to-server signal, bypassing the browser and iFrame issue entirely.
It’s an “offline conversion” in Microsoft’s terms, but it functions for your online lead submissions, giving the Microsoft ad platform the high-quality signal it needs for effective bidding and optimization without relying on the problematic client-side UET tag within your iFrame setup.