Follow

Variables

 

Overview

Certain features in LeadConduit Classic, such as custom scripts and outbound delivery, support variable substitution. This allows you to use lead data and system fields in the configuration for those features.

Example Uses

  • Phone number normalization: Let's say you are collecting a phone number and accepting all formats. In the outbound delivery, you can use the phone number field component variables to always send the phone number in one format.

  • Splitting phone number into its components. Let's say you are collecting phone number as one field and your lead buyer wants to receive it as 3 fields, you can map the phone field component variables to your buyers 3 phone fields.

How does it work?

Any value wrapped in #{...} will be considered a variable and an attempt will be made to substitute the entire expression (including the # symbol and braces) for a variable value. You use an unknown variable name, no substitution can be made and the "#{...}" value will simply be removed. In other words, an unknown variable is replaced with an empty string.

When using the echo fields feature, you must not wrap the variable names in #{...}.

Where can I see a list of Variable Placeholders?

You can see a full list on the Variable Placeholders link that is listed on the campaign delivery destination screen. You can also access a list from the Custom Validation Script page.

System Field Variables

LeadConduit provides a number of system field variables that you may use for substitution. For example, if you were configuring additional parameters for lead delivery and you wanted to send the lead's LeadConduit Classic identifier and the date the lead was collected in LeadConduit Classic =, you would use the following expression:
leadId=#{xxLeadId}&date=#{xxDateCollected}

Assuming the lead's identifier is "123", and it was collected on 10/12/2008, this expression would be interpreted and sent to your delivery destination as:
leadId=1234&date=2008-10-12

Campaign Field Variables

LeadConduit Classic provides all campaign fields as variables in order to include lead data. This is useful in the event that you want to create a string which contains lead data. Some examples which show how variable substitution can be used for lead delivery additional parameters:

Assuming an Account ID of "ABC", and three campaign fields called areaCode, exchange, and lineNumber:

affId=PROVIDER_#{xxAccountId}&phoneNumber=#{areaCode}-#{exchange}-#{lineNumber}

LeadConduit Classic will produce the following additional parameters:

affId=PROVIDER_ABC&phoneNumber=555-555-1212

Any campaign field can be used in this way, but take note if you remove a field from the campaign. After having removed the areaCode field, for example, LeadConduit Classic would start sending the following additional parameters:

affId=PROVIDER_ABC&phoneNumber=-555-1212

Notice that the areaCode is simply omitted from the additional parameters and as a result there is a dangling hyphen in the phone number. In order to correct this behavior, you must adjust your additional parameters to:

affId=PROVIDER_#{xxAccountId}&phoneNumber=#{exchange}-#{lineNumber}

...which would result in the correct additional parameters:

affId=PROVIDER_ABC&phoneNumber=555-1212

Campaign field component variables

Field component variables are an advanced variable substitution feature which can be used to pull apart values that arrive in LeadConduit Classic. If you wanted, for example, to separate a the homePhone field into area code, exchange and line number you could specify the following additional parameters expression:

areaCode=#{homePhone.area}&exchange=#{homePhone.exchange}&lineNumber=#{homePhone.line}

In order for this expression to work as expected, your homePhone campaign field must be defined as a "Phone Type" on the field editor screen in LeadConduit Classic. Component variables are not available for generic field types like "Text" and "Text - List" because those field types don't give LeadConduit Classic enough information about what type of value to expect. Using specialized field types, on the other hand, gives LeadConduit Classic a hint about what sort of data the field holds.

The following component variables are available for use in additional delivery parameters. Remember that each component variable name must be prefixed with the campaign field name. Using #{year} will not work, but #{dob.year} will.

Field TypeComponentDescription
Phone area The first three digits of the telephone number
Phone exchange The second three digits of the telephone number
Phone line The last four digits of the telephone number
Phone extension The extension number (space separated, like: 512-455-1212 999)
Date, Date of Birth month The numeric month of a date value (1-12)
Date, Date of Birth day The numeric day of the month of a date value (1-31)
Date, Date of Birth year The numeric four-digit year of a date value
Debt Amount min The numeric minimum of a debt amount value range ("10000" for the value "$10,000 - $20,000")
note: single value (non-range) Debt Amount inputs also have min, ave & max available.
Debt Amount max The numeric maximum of a debt amount value range ("20000" for the value "$10,000 - $20,000")
Debt Amount ave The numeric average of a debt amount value range ("15000" for the value "$10,000 - $20,000")
Street Address streetnumber The first portion of the street address, up to the first blank ("123" for the value "123 Main St.")
Street Address streetname The second portion of the street address, after the first space ("Main St." for the value "123 Main St.")
Zip Code zip The first 5 digits of a zip code (i.e. "90210" for the value "90210-1234" or the value "90210")
Zip Code four The last 4 digits of a zip code (i.e. "1234" for the value "90210-1234")
Zip Code locality The locality of the zip code - "usa", "uk", "canada"
Zip Code city The city the zip belongs to, according to the LeadConduit reference database
Zip Code state The city the zip belongs to, according to the LeadConduit reference database
State abbr The two letter state abbreviation, always uppercase (i.e. "TX" for the state of Texas)
State name The full state name, always capitalized (i.e "Texas" for the state of Texas)

IMPORTANT NOTE

Variables are based on the name of your campaign fields. When you add a campaign field, you get access to a new variable with the same name as that field. When you remove a field, you lose access to the variable with that name.

When a field has been removed, you may also want to remove references to the corresponding variable in your delivery settings and email templates. If you continue to refer to the variable, keep in mind that it will evaluate to an empty string ("").

Adding a new field to your campaign will automatically add a parameter for that field to your delivery settings for each delivery destination. If a parameter already exists with the same name as the field you're adding, the parameter value will not be overwritten.

If you remove a campaign field from your campaign, you should probably remove its use from each destination. If you leave it in place, then it will be substituted with an empty string, which may or may not be OK, depending on the requirements of the lead recipient.

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

You must be logged in to comment.