What is it?
How do I configure it?
You must be the campaign owner to use it. A custom script can be set up on each campaign. From the campaign page, access the script editor by clicking the "edit custom script" link.
Invalidating lead data
If a lead should need to be invalidated by the script, the script can invoke the function "lead.invalidate()", which takes a single string parameter: the reject reason.
In this example, the campaign includes a field called "program_of_interest" and another called "education_level". This script will invalidate the lead if program_of_interest is "EMS" but education_level is not one those listed:
Altering the lead data
If you use the custom script to alter lead data, the data will be stored in your LeadConduit account in its altered state. In addition, if the lead was submitted from a Seller Account, the account that provided the lead will also see it in its altered state. Invalid leads will not be altered.
The following script sets the
program_of_interest field to "Nursing Degree" and strips punctuation characters out of the city field.
When does it run?
The custom script runs after the lead passes the initial validation that has been configured for the campaign (based on each of the individual fields). It also runs after duplicate checking. In other words, it only runs on leads that would be considered valid if there was no custom script.
Handling String fields
In order to allow string functions, such as
length, to work on your lead fields, your script should explicitly cast those fields as strings. This also prevents errors that occur when handling missing fields.