Before you begin: This user guide details the steps for setting up TapLeads to collect leads via a filled in form. Before you can do that however, you must first enable TapLeads for the client and activate leads collection. If you not sure how to do that, see How to use Leads Management.
Locate the Client
1] Login to TapClicks and on the Admin menu, click Clients.
2] To locate the client for whom you want to collect leads, either scroll through the list of clients or enter the client name in the search box (results appear automatically).
3] After you locate the client, on the far right, click the edit (i.e., pencil) icon.
Set up Leads Collection via Form-fill
4] On the Settings tab, scroll down to the Leads section where you will see a Client Lead code. Copy the code.
Modify your tracking code
In the backend of your form, you need to make an API call to the TapClicks platform and you are ready to modify the tracking code on your webpage/form. That code should contain a URL with all the necessary parameters to capture the lead details and send them to your TapAnalytics dashboard.
When the new lead (i.e., end customer) hits Submit on your form, this code should execute. For example, if your dashboard URL is myagency.tapclicks.com and the client code from the previous section is 4-d1196f, then the sample URL for form submission should look like this:
https://myagency.tapclicks.com/app/dash/leadRecorder/record_lead?client_lead_code=4-d1196f&lead_name=REPLACE-STRING&email=REPLACE-STRING&phone=REPLACE-STRING&comments=REPLACE-STRING
5] Replace myagency.tapclicks.com with the URL of your dashboard.
6] Replace the client_lead_code parameter, above, with the client lead code you copied earlier.
NOTE: Other parameters have a placeholder REPLACE-STRING. These will be replaced by values entered into the form by the lead. The tracking code will need to be modified for each web page/form for each of your clients. |
Additional parameters that the URL can accept are shown in the list below. The details about the leads that can be captured include the following:
- lead_name
- first_name
- last_name
- email phone
- address_1
- address_2
- city
- state
- zip
- company
- url
- comments
- third_party_id
- timestamp
Sample PHP code sending leads through cURL
$lead_name = urlencode("john smith"); // If the form field name is lname - $lead_name = urlencode("john smith");
$email = urlencode("mathieu@tapclicks.com");
$phone = urlencode("514-555-2525");
$comments = urlencode("test message");
// At this point, make sure all the form values are validated based on your business logic
$url = "https://tapsteve.tapclicks.com/app/dash/leadRecorder/record_lead?client_lead_code=38-afa540&lead_name=".$lead_name."&email=".$email."&phone=".$phone."&comments=".$comments;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch); curl_close($ch); $email = urlencode("mathieu@tapclicks.com");
$phone = urlencode("514-555-2525"); $comments = urlencode("test message");
$url = "https://myagency.tapclicks.com/app/dash/leadRecorder/record_lead?client_lead_code=38-afa540&lead_name=".$lead_name."&email=".$email."&phone=".$phone."&comments=".$comments; $ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch)
7] If you have completed the earlier steps successfully, you should see PHP code that looks something like this when you go to the lead management dashboard:
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
$email = urlencode("mathieu@tapclicks.com");
$phone = urlencode("514-555-2525");
$comments = urlencode("test message");
$url = "https://myagency.tapclicks.com/app/dash/leadRecorder/record_lead?client_lead_code=38-afa540&lead_name=".$lead_name."&email=".$email."&phone=".$phone."&comments=".$comments;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
8] If you have completed the earlier steps successfully, you should see screen results that look something like this when you go to the lead management dashboard:
Test the feature
9] To test this feature further, replace myagency.tapclicks.com with the URL of your dashboard.
10] Replace the client_lead_code field with the client lead code you copied earlier.
11] Fill in the other parameters as you see fit or leave them blank.
12] When you have the URL parameterized, copy it.
13] Open a new tab in your browser.
14] Paste the URL in the address bar and hit return. The API endpoint returns a JSON string. The JSON will always have a status parameter equal to success or error. You can use that status to validate your API call and implement your business logic.
A sample success message
{"status":"success","lead_id":"1"}
On your leads management screen, you should see "Form" as the lead type showing in the Type column, and you’re done. You are now ready to embed your tracking code on your client’s web page/form and begin sending leads to your client’s TapAnalytics installation.