---
title: "Concierge Code when Pardot Form is an iFrame"
source_url: https://help.chilipiper.com/hc/en-us/articles/1500010544381-Concierge-Code-when-Pardot-Form-is-an-iFrame
article_id: 1500010544381
updated_at: 2026-04-23T16:54:46Z
---

When using Pardot Forms that are embedded as an iFrame, we use DOM event messages to pass the form submission data along and present a Calendar once Pardot verifies that the submission went through.

Note this does not work with the [native Pardot landing page implementation](https://help.chilipiper.com/hc/en-us/articles/1500011223882) code, and the implementations are not interchangeable. If you update the code below, make sure you update it in all areas.

This article will cover how to successfully implement Chili Piper with Pardot forms embedded in an iframe:

  * Add custom code to your Pardot form settings
    * Look & Feel → Below Form Code Editor
    * Completed Actions → Thank You Code
    * Parent Webpage Code
  * Optional
    * Custom field names using CSS class names



* * *

## Look & Feel → Below Form Code Editor

In Pardot, navigate to your form, under "Look and Feel" open the "Below Form" Source code, and add the script from the link below, being sure to follow directions to replace [[domain]] with your domain and [[router_name]] with the correct router name.

In Pardot, navigate to your form, under "Look and Feel" open the "Below Form" Source code, and add the script below, replacing "calendar" after "var tenantDomain = " with your domain and "test" with the correct router name.

**Please get the latest version of this implementation from**[**here**](https://docs.google.com/document/d/1LAETphmjofMMkNTEfaNrY0qB4dKi-80pLtSofFnXgso/edit?usp=sharing)**.**

**If you need more details on how to collect your Domain and Router names, please check the****Collecting Domain and Router name details** **section right below**

Paste the code in as shown here:

### ![](https://s3.amazonaws.com/helpscout.net/docs/assets/59499b792c7d3a0747ce0c73/images/5e5d2ae804286364bc9617ab/file-L3t4crBZ2r.png)

Hit **Confirm & Save**

### Collecting Domain and Router name details

Having your **domain** and **router** names ready is required for the implementation above. They can be found in your inbound router under the Embed code section: 

![](https://help.chilipiper.com/hc/article_attachments/47976072823571)

* * *

## Completed Actions → Thank You Code

Add the Following Code to the Completed Actions → Thank You Code
    
    
    <script>
    window.parent.postMessage(
    {
    message: "PARDOT_FORM_SUCCESS",
    },
    "*"
    );
    
    </script>

Ensure the following option is unchecked in the Completed Actions → Thank You Code tab:

_"Redirect to the following URL instead of showing the forms Thank you Content"_

![](https://help.chilipiper.com/hc/article_attachments/27695380847507)

* * *

## Parent Webpage Code

Add the Following Code to the Parent Webpage which the Pardot Embed HTML code resides.
    
    
    <script id="chilipiper-concierge" src="https://fire.chilipiper.com/concierge-js/cjs/concierge.js" crossorigin="anonymous" type="text/javascript"></script>
    <script>
    var leadObj = {};
    //Below is the event listener that will listen for the Pardot Events
    window.addEventListener("message", receiveMessage, false);
       function receiveMessage(event) {
       // Form data ready, update leadObj
       if (event.data && event.data.message === "PARDOT_DATA_READY" && event.data.data) {
          leadObj = event.data.data; // Update leadObj
       }
       // Form was submitted and validated, call ChiliPiper
       if (event.data && event.data.message === "PARDOT_FORM_SUCCESS") {
          // Account domain and router name are from Step #1 - no need to change it here
          ChiliPiper.submit(leadObj["CPTenantDomain"], leadObj["CPTenantRouter"], {
             map: true,
             lead: leadObj,
          });
       }
    }
    </script>

* * *

## Custom field names using CSS class names

When looking for field names to use, we check the CSS class names first, then placeholders and labels. Sometimes your form labels need to be complex and include some simple instructions, making the label hard to read and use for mapping in Chili Piper. With this implementation, you can specify field names using CSS Class names in Pardot. This will make mapping easier and more predictable.

Here is how to specify a CSS class name on a Pardot field:

  * Open your form in Pardot and click the Edit Button - Fields - Small Edit icon next to the field.  
![Screen_Shot_2021-05-18_at_10.02.36_AM.png](https://help.chilipiper.com/hc/article_attachments/26845781345427)
  * From here, click on Advanced and enter a CSS Class name starting with "CP_".  
For example, "CP_FirstName".  
![Screen_Shot_2021-05-18_at_10.06.59_AM.png](https://help.chilipiper.com/hc/article_attachments/26845773729299)
  * That's it! Now save and repeat for any other fields you want to specify a name for.



### Exception Handling

In the event that you are using a **Pardot Form that has 2 Columns** ([reference](https://trailhead.salesforce.com/trailblazer-community/feed/0D54S00000A82j3SAB)), this will require specific CSS Classes to achieve. To also have this work with Chili Piper:

  * First input the form-col-1 or form-col-2
  * Then space
  * Then your CP_fieldname



It should look like the below within your Pardot Form configuration

![pardot_column.png](https://help.chilipiper.com/hc/article_attachments/27585533765907)

When the page renders, you should expect to see the HTML on the page like the one below if configured properly:

![image \(32\).png](https://help.chilipiper.com/hc/article_attachments/26846284223507)
