Marketing Automation Integration

Pardot B2B forms

51 views March 15, 2017 April 13, 2017 developer 1

Identify companies from their first visit with Azalead Account Sensing and push appended company data directly into Salesforce Pardot. Azalead company data is standardized and normalized so you will instantly improve the quality of collected data.

Most of website visitors leave website without living any trace, fill forms scare them. Marketers have to design short forms to get leads. It's not effective. They don't get all information they would like to have.

Azalead API can help you get high quality leads without asking website visitor to fill a long web form. It's very easy and fast to put in place. The principle is simple: use Azalead company visitor data to fill hidden fields in your web forms. Azalead API is a great way to add qualified leads into your system.

How it works

The Azalead website tag provides a JSON string. This string describes the name and firmographics of your company visitors. It contains several company data fields including:

  • Company Name
  • National ID
  • NACE code
  • Size
  • Legal Form
  • Industry
  • Employees
  • Website
  • City
  • Country
  • Country code
  • Zip Code

What does this variable look like?

{
    "companyName": "TOTAL S.A.",
    "nationalId": "542051180",
    "naceCode": "0610",
    "size": "Very large company",
    "legalForm": "SA",
    "industry": "Oil & Gas",
    "employee": "100307",
    "website": "www.total.com",
    "city": "COURBEVOIE",
    "country": "France",
    "countryCode": "FR",
    "postCode": "92400" 
}

Getting website visitor data

To use Azalead website tag you will need to open an Azalead account. If you do not yet have an account, you can sign up here for a free trial account.

After opening an account, you will receive your unique Azalead tracker code to paste on your website. Either place the tag at the end of the <body> section of your html pages or use one of our CMS plugins (WordPress, Joomla, Drupal).

Once the Azalead tag is on your website, you will be able to capture the visiting company data to add content in Pardot Web forms. The process is straightforward. When the variable is loaded, the tag fires a javascript event "azaCompanyVisitorLoaded". So you just need to listen to the "azaCompanyVisitorLoaded" event. When this event is fired you can access the "aza_company_visitor" variable and get the Company details you need to prefill your forms.

After placing the Azalead tag on your website you can implement the form example below.

Here is a sample of website personalization Company data in the Azalead tag

var aza_company_visitor = '{ "companyName": "TOTAL S.A.", "nationalId": "542051180",
 "naceCode": "0610", "size": "Very large company","legalForm": "SA", 
"industry": "Oil & Gas", "employee": "100307", "website": "www.total.com",
  "city": "COURBEVOIE", "country": "France", "countryCode": "FR", "postCode": "92400" }';
if (/(MSIE|Trident\/|Edge\/)/i.test(navigator.userAgent)) {
    var e = document.createEvent("Event");
    e.initEvent("azaCompanyVisitorLoaded", !0, !0), document.dispatchEvent(e)
} else document.dispatchEvent(new Event("azaCompanyVisitorLoaded"));

Create a Pardot B2B web form

Step 1 - Add Company based Prospect Custom Fields in Pardot

Personalize your prospects in Pardot by adding prospect company custom fields.

Name Field Type
Aza Company Name Aza_Company_Name Hidden
Aza National ID Aza_National_ID Hidden
Aza Industry Aza_Industry Hidden
Aza Nace Code Aza_Nace_Code Hidden
Aza Website Aza_Website Hidden
Aza Company Size Aza_Company_Size Hidden
Aza Employee Aza_Employee Hidden
Aza Legal Form Aza_Legal_Form Hidden
Aza Post Code Aza_Post_Code Hidden
Aza City Aza_City Hidden
Aza Country Aza_Country Hidden
Aza Country Code Aza_Country_Code Hidden

Step 2 - Add Company based hidden fields in your Pardot form

Personalize your form fields by adding company visitor hidden fields.

Step 3 - Fill your form hidden fields

Use Azalead company visitor data to fill your form hidden fields. In Pardot you have two ways to handle form :

  • in Pardot landing pages
  • via an iframe in your html page

You can find an example for each case just bellow:

Fill Pardot B2B form hidden fields

Use Azalead company visitor data to fill your form hidden fields. In Pardot you have two ways to handle form : in Pardot landing pages or via an iframe in your html page. You can find an example for each case just bellow:

Code sample

Javascript Sample

<script type="text/javascript">
var azaCompanyName, azaNationalId, azaIndustry, azaNaceCode, azaWebsite, azaCompanySize, azaEmployees, azaLegalForm,azaPostCode, azaCity, azaCountry, azaCountryCode;

function retrieveFormInputs(){
    var inputs = document.getElementsByTagName("input");
      
    for (var i = 0;i < inputs.length;i++) {
        if(inputs[i].type==="hidden" 
            && inputs[i].parentElement.classList.contains("form-field")
            && inputs[i].parentElement.classList.contains("Aza_Company_Name")) {
            azaCompanyName = inputs[i];
        }
        if(inputs[i].type==="hidden" 
            && inputs[i].parentElement.classList.contains("form-field")
            && inputs[i].parentElement.classList.contains("Aza_National_ID")) {
            azaNationalId = inputs[i];
        }      
        if(inputs[i].type==="hidden" 
            && inputs[i].parentElement.classList.contains("form-field")
            && inputs[i].parentElement.classList.contains("Aza_Industry")) {
            azaIndustry = inputs[i]; 
        }
        if(inputs[i].type==="hidden" 
            && inputs[i].parentElement.classList.contains("form-field")
            && inputs[i].parentElement.classList.contains("Aza_Nace_Code")) {
            azaNaceCode = inputs[i]; 
        }
        if(inputs[i].type==="hidden" 
            && inputs[i].parentElement.classList.contains("form-field")
            && inputs[i].parentElement.classList.contains("Aza_Website")) {
            azaWebsite = inputs[i];
        }
        if(inputs[i].type==="hidden" 
            && inputs[i].parentElement.classList.contains("form-field")
            && inputs[i].parentElement.classList.contains("Aza_Company_Size")) {
            azaCompanySize = inputs[i];
        }
        if(inputs[i].type==="hidden" 
            && inputs[i].parentElement.classList.contains("form-field")
            && inputs[i].parentElement.classList.contains("Aza_Employee")) {
            azaEmployees = inputs[i];
        }
        if(inputs[i].type==="hidden" 
            && inputs[i].parentElement.classList.contains("form-field")
            && inputs[i].parentElement.classList.contains("Aza_Employee")) {
            azaEmployees = inputs[i];
        }
        if(inputs[i].type==="hidden" 
            && inputs[i].parentElement.classList.contains("form-field")
            && inputs[i].parentElement.classList.contains("Aza_Legal_Form")) {
            azaLegalForm = inputs[i]; 
        }
        if(inputs[i].type==="hidden" 
            && inputs[i].parentElement.classList.contains("form-field")
            && inputs[i].parentElement.classList.contains("Aza_Post_Code")) {
            azaPostCode = inputs[i]; 
        }
        if(inputs[i].type==="hidden" 
            && inputs[i].parentElement.classList.contains("form-field")
            && inputs[i].parentElement.classList.contains("Aza_City")) {
            azaCity = inputs[i]; 
        }
        if(inputs[i].type==="hidden" 
            && inputs[i].parentElement.classList.contains("form-field")
            && inputs[i].parentElement.classList.contains("Aza_Country")) {
            azaCountry = inputs[i]; 
        }
        if(inputs[i].type==="hidden" 
            && inputs[i].parentElement.classList.contains("form-field")
            && inputs[i].parentElement.classList.contains("Aza_Country_Code")) {
            azaCountryCode = inputs[i]; 
        }
    }
}

document.addEventListener('azaCompanyVisitorLoaded', function (e) {
  if (typeof aza_company_visitor !== "undefined") {
    var myCompanyVisitor = JSON.parse(aza_company_visitor);
    retrieveFormInputs();
    //, , , , , , , ,azaPostCode, azaCity, azaCountry, azaCountryCode;
    if (myCompanyVisitor != null && myCompanyVisitor.companyName != null) {
        azaCompanyName.value = myCompanyVisitor.companyName;    
    }
    if (myCompanyVisitor != null && myCompanyVisitor.nationalId != null) {
        azaNationalId.value = myCompanyVisitor.nationalId;
    }
    if (myCompanyVisitor != null && myCompanyVisitor.industry != null) {
        azaIndustry.value = myCompanyVisitor.industry;
    }
    if (myCompanyVisitor != null && myCompanyVisitor.naceCode != null) {
        azaNaceCode.value = myCompanyVisitor.naceCode;
    }
    if (myCompanyVisitor != null && myCompanyVisitor.website != null) {
        azaWebsite.value = myCompanyVisitor.website;
    }
    if (myCompanyVisitor != null && myCompanyVisitor.size != null) {
        azaCompanySize.value = myCompanyVisitor.size;
    }
    if (myCompanyVisitor != null && myCompanyVisitor.employee != null) {
        azaEmployees.value = myCompanyVisitor.employee;
    }
    if (myCompanyVisitor != null && myCompanyVisitor.legalForm != null) {
        azaLegalForm.value = myCompanyVisitor.legalForm;
    }
    if (myCompanyVisitor != null && myCompanyVisitor.postCode != null) {
        azaPostCode.value = myCompanyVisitor.postCode;
    }
    if (myCompanyVisitor != null && myCompanyVisitor.city != null) {
        azaCity.value = myCompanyVisitor.city;
    }
    if (myCompanyVisitor != null && myCompanyVisitor.country != null) {
        azaCountry.value = myCompanyVisitor.country;
    }
    if (myCompanyVisitor != null && myCompanyVisitor.countryCode != null) {
        azaCountryCode.value = myCompanyVisitor.countryCode;
    }
  } 
}, false);
</script>

Fill Pardot B2B form hidden fields (iframe version)

The code sample bellow uses Azalead Website Personalization data to fill Pardot hidden fields when the form is in an Pardot iframe. You just need to copy/paste the sample bellow and remplace your form URL.

Code samples

Pardot B2B form (iframe)

<iframe id="aza-b2b-form" src="YOUR_FORM_URL" width="100%" height="600" type="text/html" frameborder="0" allowTransparency="true" style="border: 0">
</iframe>
<script type="text/javascript">
// put your Pardot B2B form url here
var azaB2bFormUrl = "YOUR_FORM_URL";

document.addEventListener('azaCompanyVisitorLoaded', function (e) {
  if (typeof aza_company_visitor !== "undefined") {
    var yourCompanyVisitor = JSON.parse(aza_company_visitor);

    if (yourCompanyVisitor != null && yourCompanyVisitor.companyName != null) {
      azaB2bFormUrl = azaB2bFormUrl + "?Aza_Company_Name=" + yourCompanyVisitor.companyName;  
    }
    if (yourCompanyVisitor != null && yourCompanyVisitor.nationalId != null) {
        azaB2bFormUrl = azaB2bFormUrl + "&Aza_National_ID=" + yourCompanyVisitor.nationalId;
    }
    if (yourCompanyVisitor != null && yourCompanyVisitor.naceCode != null) {
    azaB2bFormUrl = azaB2bFormUrl + "&Aza_Nace_Code=" + yourCompanyVisitor.naceCode;
    }
    if (yourCompanyVisitor != null && yourCompanyVisitor.size != null) {
    azaB2bFormUrl = azaB2bFormUrl + "&Aza_Company_Size=" + yourCompanyVisitor.size;
    }
    if (yourCompanyVisitor != null && yourCompanyVisitor.legalForm != null) {
    azaB2bFormUrl = azaB2bFormUrl + "&Aza_Legal_Form=" + yourCompanyVisitor.legalForm;
    }
    if (yourCompanyVisitor != null && yourCompanyVisitor.industry != null) {
    dazaB2bFormUrl = azaB2bFormUrl + "&Aza_Industry=" + yourCompanyVisitor.industry;
    }
    if (yourCompanyVisitor != null && yourCompanyVisitor.employee != null) {
    azaB2bFormUrl = azaB2bFormUrl + "&Aza_Employee=" + yourCompanyVisitor.employee;
    }
    if (yourCompanyVisitor != null && yourCompanyVisitor.website != null) {
    azaB2bFormUrl = azaB2bFormUrl + "&Aza_Website=" + yourCompanyVisitor.website;
    }
    if (yourCompanyVisitor != null && yourCompanyVisitor.city != null) {
    azaB2bFormUrl = azaB2bFormUrl + "&Aza_City=" + yourCompanyVisitor.city;
    }
    if (yourCompanyVisitor != null && yourCompanyVisitor.country != null) {
    azaB2bFormUrl = azaB2bFormUrl + "&Aza_Country=" + yourCompanyVisitor.country;
    }
    if (yourCompanyVisitor != null && yourCompanyVisitor.countryCode != null) {
    azaB2bFormUrl = azaB2bFormUrl + "&Aza_Country_Code=" + yourCompanyVisitor.countryCode;
    }
    if (yourCompanyVisitor != null && yourCompanyVisitor.postCode != null) {
    azaB2bFormUrl = azaB2bFormUrl + "&Aza_Post_Code=" + yourCompanyVisitor.postCode;
    }
    document.getElementById("aza-b2b-form").src = azaB2bFormUrl;
  } 
}, false);
</script>

Your Pardot B2B Web Form is now completed.

Was this helpful?