How do I customize my lead sources?

In this tutorial you’ll learn how to take a normal webform with a hardcoded lead source and make it recognize lead source dynamically while also storing the Referring URL.

Step 1

Add a custom field called ReferringURL. Add another one called LeadSourceName.

Check out the User Guide for help:

Step 2

Add those custom fields as hidden fields on the form in Campaign Builder. Also add LeadSourceID.

Leave the fields blank.

Check out the User Guide for help on adding a hidden field:

Step 3

Add a second hidden field called Lead Source ID. Leave it blank.

Step 4

Get the HTML version of your form from the Code tab.

Step 5

Add this code verbatim above that HTML:


Step 6

Then replace this
<input name=”inf_custom_ReferringURL” type=”hidden” value=”null” />

with this
<input name=”inf_custom_ReferringURL” type=”hidden” value=”<?php echo “$ref”; ?>” />

Step 7

Then replace this
<input name=”inf_custom_LeadSourceName” type=”hidden” value=”null” />

with this
<input name=”inf_custom_LeadSourceName” type=”hidden” value=”<?=$_REQUEST[‘inf_field_LeadSourceName’]?>” />

Step 8

Then replace this
<input name=”inf_field_LeadSourceId” type=”hidden” value=”null” />

with this
<input name=”inf_field_LeadSourceId” type=”hidden” value=”<?=$_REQUEST[‘inf_field_LeadSourceId’]?>” />

Step 9

Save this form, with the extra PHP code above the HTML, to your page. Save the page as .PHP.

Step 10

Format any links leading to this page like this

Where 1234 is the lead source ID and NAMEOFLEADSOURCE is the specific name of the lead source.

Step 11

Now you can search for activity and revenue on Lead Source ID, Referring URL, and your chosen name for each lead source.


Thanks Christian Wiles, Paul Sokol, and Tyler Garns for help with getting the PHP down right.