Passing UTM Parameters to the Embedded Priceguide Estimator

If you’re running Google Ads (or any campaign that drops UTM parameters on a click), and you’ve embedded the Priceguide estimator on your own website using our iframe code — there’s one extra step you need to take, or your tracking will break.

Here’s why, and exactly how to fix it.

The problem in plain English

When someone clicks your ad, they land on a URL like this:

https://yoursite.com/quote/?utm_source=google&utm_medium=cpc&utm_campaign=spring

Those UTM parameters land on your page. But the Priceguide estimator is sitting inside an iframe on that page, and iframes don’t automatically inherit URL parameters from the parent page.

Result: the lead comes in, but the UTM data is missing. You can’t tell which campaign generated it.

The fix

Add this small script to the page where you’ve embedded the estimator. It reads the UTMs from your page URL and passes them through to the iframe so they get attached to the lead.

Step 1: Find your iframe embed code

It looks something like this:

<iframe
  src="https://app.priceguide.ai/estimator/your-estimator-id"
  width="100%"
  height="800"
  frameborder="0"
  id="priceguide-estimator">
</iframe>

Make sure your iframe has an id attribute. We’ll use priceguide-estimator in the example below — change it if yours is different.

Step 2: Add this script just below the iframe

<script>
(function() {
  var iframe = document.getElementById('priceguide-estimator');
  if (!iframe) return;

  var params = new URLSearchParams(window.location.search);
  var utmKeys = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content', 'gclid', 'fbclid'];
  var passThrough = new URLSearchParams();

  utmKeys.forEach(function(key) {
    if (params.has(key)) {
      passThrough.append(key, params.get(key));
    }
  });

  if (passThrough.toString()) {
    var separator = iframe.src.indexOf('?') > -1 ? '&' : '?';
    iframe.src = iframe.src + separator + passThrough.toString();
  }
})();
</script>

Step 3: Test it

  1. Visit your page with a test UTM: https://yoursite.com/quote/?utm_source=test&utm_medium=test&utm_campaign=iframe-check
  2. Right-click the estimator and inspect it.
  3. The iframe src should now end with ?utm_source=test&utm_medium=test&utm_campaign=iframe-check.
  4. Submit a test lead. Check your Priceguide dashboard — the UTMs should be attached.

That’s it. You’re tracked.

What this script captures

  • • All five standard UTM parameters (source, medium, campaign, term, content)
  • • gclid — Google Ads click ID, useful for offline conversion imports
  • • fbclid — Facebook click ID

If you’re tracking other custom parameters, add them to the utmKeys array.

Common gotchas

The iframe loads before the script runs. Make sure the script tag is placed after the iframe in the HTML, not before. The script needs the iframe to exist when it runs.

Caching plugins on WordPress. If you’re on WordPress and using a caching or optimisation plugin, it might minify or defer the script in a way that breaks it. Add the script to a “do not optimise” exclusion list if you run into trouble.

You’re using a page builder. Most page builders (Elementor, Divi, Webflow) have a “custom code” or “HTML embed” block. Drop the script in there, right under the iframe block.

When to skip this

If you’re sending traffic directly to the hosted Priceguide estimator URL (not embedded on your site), you don’t need any of this. UTMs on a direct link to app.priceguide.ai/estimator/your-id are picked up automatically.

This guide is only for the embedded iframe setup.

Need help?

    If you’ve followed the steps and tracking still isn’t working, send us a message with the URL of your embed page and we’ll take a look. Or if you’d rather hand it off — Claude Cowork or any AI dev assistant can drop this in for you in about two minutes. Most agencies can do it even faster.

    Five minutes of setup, accurate attribution forever. Worth it.

    On This Page:

    1. The Problem
    2. The Fix
    3. What The Script Captures
    4. Common Gotchas

    Have More Questions?

    We’d love to hear from you.