Salesforce Pardot | ChannelMix Conversion ID Implementation
Purpose & Introduction
Pardot forms are embedded within web pages via iframes. The prerequisite implementation below will set the src string of your iframe with ChannelMix Conversion ID (CCID) as a query string parameter. This guide details requirements for taking the CCID from the src string to input that value into a hidden field, passing it to the CRM upon submission. Finally, the Pardot form Thank You Code will be updated to communicate to the parent that a conversion has occurred.
This guide assumes you already have a live Pardot form, embedded via iframe, which you would like to track as a ChannelMix Conversion.
Prerequisite Implementation
- Part I: ChannelMix Conversion Tracking for Iframes
- Part II: ChannelMix Conversion Tracking for Iframes - with Conversion ID
Requirement 1: Salesforce - Pardot Hidden Field Implementation
This guide is to be implemented after this guide: ChannelMix Conversion Tracking for Iframes - with Conversion ID.
- Login to Pardot Lightning
- Navigate to Admin > Configure Fields > Prospect Fields
- Click "+ Add Custom Field"
- Name the field "channelmix_conv_id"
- Set the field type "Hidden" and the Format to "Text"
- Click "Create custom field"
Hidden field example:
Requirement 2: Set The Hidden Field Value
After configuring the hidden form field, click the Advanced tab for the next steps.
- Set a value for the ID of this form field (ex. 'ccid_input')
- Copy/paste the following script to grab the CCID value and place it in the hidden field:
<script>
function setCCID(){
//get the CCID
var qsp = new URLSearchParams(window.location.search)
var cmx_cid = qsp.get('ccid');
if (cmx_cid != null && cmx_cid !== undefined) {
//set the CCID
document.getElementById('ccid_input').value='new value';
} else {
console.log('ccid not set!');
return 'not set';
}
}
setCCID();
</script>
Validation
In order to validate you implementation, submit the form and ensure that the ChannelMix Conversion Tracking (CCT) Tag fires and the CCID value captured by that tag matches the value set in your hidden field.
- Open the Google Tag Manager where your CCT Tag is implemented.
- Click Preview to open Tag Assistant
- Input the URL of the page that contains your embedded form.
- Submit the form and check Tag Assistant to verify that your tag fired when expected and shows the expected values.