Salesforce Pardot
Pardot (now officially called “Marketing Cloud Account Engagement”) is Salesforce’s B2B marketing automation platform. Pardot forms are typically embedded on your website as cross-origin iframes hosted on pardot.com or salesforce-sites.com subdomains.
Because these iframes are cross-origin, the parent page cannot directly access the form fields inside them. AttributionHub solves this by appending attribution data as URL search parameters on the iframe src. Pardot reads these parameters and can use them to pre-fill hidden fields when the form loads.
If you embed a Pardot form handler page as an inline <form> element (e.g., on a custom Pardot landing page hosted on your domain), AttributionHub’s standard forms handler covers it automatically.
Prerequisites
Before you begin, make sure:
- The AttributionHub tracking script is installed on your site (see Installation)
- You have access to Pardot (Marketing Cloud Account Engagement) with permissions to edit forms and custom fields
- You have access to your website’s code or CMS to embed the Pardot form
Step 1: Create Custom Fields in Pardot
You need custom prospect fields in Pardot to store the attribution data.
- In Pardot, go to Admin (or Pardot Settings) > Object and Field Configuration > Prospect Fields
- Click Add Custom Field
- For each attribution field you want to track:
- Set the Name to something descriptive (e.g., “Attribution Channel - Latest Touch”)
- Set the Custom Field ID (also called “External Field Name” or API Name) to match the AttributionHub field name (e.g.,
ah_lt_channel) - Set the Type to Text
- Click Create Custom Field and repeat for each field
See the Recommended Hidden Fields section for a list of the most useful fields to create.
Step 2: Add Hidden Fields to Your Pardot Form
- In Pardot, go to Content > Forms (or Marketing > Forms depending on your navigation)
- Open the form you want to edit, or create a new form
- Click Add Field (or the + button)
- For each attribution field:
- Select the custom field you created in Step 1 from the field list
- In the field settings, check the box to Keep this as a hidden field (or set Type to Hidden, depending on your Pardot version)
- Do not set a default value — AttributionHub will fill it in automatically
- Save and publish the form
Step 3: Embed the Form on Your Page
Use Pardot’s standard iframe embed code on your website:
<iframe
src="https://go.yourcompany.com/l/XXXXX/XXXXX-XXXXX/XXXXX"
width="100%"
height="500"
type="text/html"
frameborder="0"
allowTransparency="true"
style="border: 0"
></iframe>AttributionHub automatically detects Pardot iframes by looking for these patterns in the src:
pardot.comgo.pardot.comsalesforce-sites.compardot.salesforce.com
No modifications to your embed code are required.
Step 4: Test the Integration
- Visit a page on your site that contains the Pardot form
- Open your browser’s DevTools (F12)
- Find the Pardot iframe in the Elements panel
- Check that its
srcURL now includes attribution parameters (e.g.,?ah_lt_channel=Organic+Search&ah_lt_source=Google&...) - Submit a test form entry through the Pardot form
- In Pardot, go to Prospects and find the test prospect. The custom fields should contain attribution values
For a full testing walkthrough, see Verify It Works.
How It Works
- AttributionHub detects Pardot iframes on your page based on their
srcURL - It reads attribution data from localStorage
- It builds URL search parameters from your field mapping (each field name becomes a parameter key, each attribution value becomes the parameter value)
- It updates the iframe
srcwith the new parameters, causing the iframe to reload with pre-filled values - Inside the iframe, Pardot reads the URL parameters and fills the corresponding hidden fields
This process happens automatically on every page load. The iframe reload is typically fast since it is loading the same form with additional parameters.
Recommended Hidden Fields
The table below lists the most commonly used fields. For the complete field catalog, see Field Reference.
Core Attribution Fields (Latest Touch)
| Custom Field ID | Description | Example Values |
|---|---|---|
ah_lt_channel | Channel group (latest touch) | Paid Search, Organic Social, Direct |
ah_lt_source | Traffic source name | Google, Facebook, Direct |
ah_lt_medium | Traffic medium | paid, organic, social, email |
ah_lt_campaign | Campaign name | spring_sale, Organic Search |
ah_lt_content | Content classification | Paid Search Ad, Social Post |
ah_lt_term | Search keyword (if available) | running shoes |
ah_lt_landing_url | Landing page URL (no query string) | https://yoursite.com/pricing |
Core Attribution Fields (First Touch)
| Custom Field ID | Description | Example Values |
|---|---|---|
ah_ft_channel | Channel group (first touch) | Paid Search, Organic Social |
ah_ft_source | Traffic source name | Google, Facebook |
ah_ft_medium | Traffic medium | paid, organic, social |
ah_ft_campaign | Campaign name | launch_campaign |
ah_ft_landing_url | Original landing page URL | https://yoursite.com/blog/post |
Global Fields
| Custom Field ID | Description | Example Values |
|---|---|---|
ah_visitor_id | Unique visitor ID, persistent across visits | a1b2c3d4-e5f6-7890-abcd-ef1234567890 |
ah_touch_count | Total number of recorded visits | 5 |
For additional fields including latest-non-direct touch (
ah_lnd_*), drill-down fields, raw UTM parameters, and ad click IDs, see the full Field Reference.
Custom Field Mapping
If your Pardot custom fields use different IDs, override the defaults:
<script>
window.attrhub = {
settings: {
fieldMapping: {
"latest.attribution.channelGroup": "pardot_channel",
"latest.attribution.source": "pardot_source",
"latest.attribution.campaign": "pardot_campaign",
},
},
};
</script>See Configuration for the full mapping reference.
Tips
- Salesforce sync — When Pardot syncs with Salesforce, your attribution custom fields can be mapped to corresponding Salesforce Lead or Contact fields. This gives your sales team visibility into how leads found your site.
- Pardot automation rules — Use attribution field values in Pardot automation rules, completion actions, or segmentation rules. For example, automatically assign leads from “Paid Search” to a high-intent pipeline.
- Pardot landing pages — If you host the form on a Pardot landing page, add the AttributionHub script to the landing page template’s custom HTML section. The form on the landing page will be detected and populated automatically.
- Engagement Studio — Reference attribution fields in your Engagement Studio drip campaigns to personalize follow-up based on how the prospect originally arrived.
- Multiple forms on one page — AttributionHub detects and populates all Pardot iframes on the page independently.
Troubleshooting
Custom fields are empty after form submission
- Check that the Pardot custom field External Field Name / Custom Field ID exactly matches the AttributionHub field name (or your custom field mapping). Names are case-sensitive.
- Ensure the fields are added as hidden fields in the Pardot form editor.
- Inspect the iframe
srcin DevTools to confirm attribution parameters are being appended. - Enable logging (
enableLogging: truein settings) and check the browser Console. - Make sure Pardot’s form is configured to accept URL parameter pre-fill. Some Pardot configurations require that “Allow pre-fill” is enabled for each field.
Iframe not detected
If AttributionHub does not detect your Pardot iframe, it may be using a custom domain that does not match the default patterns. Add the data-attrhub-pardot attribute to the iframe element to force detection:
<iframe
data-attrhub-pardot
src="https://forms.yourcompany.com/l/XXXXX/XXXXX"
...
></iframe>Form appears but loads slowly
The iframe src URL is updated by AttributionHub, which causes the iframe to reload with parameters. If the Pardot form is slow to load, this is a Pardot server issue rather than an AttributionHub issue. Consider optimizing your Pardot form handler page or using fewer fields.