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, you must first enable TapLeads for the client and activate lead collection. If you are not sure how to do that, see How to use Leads Management.
Locate the Client
1] Log in 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 Lead 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 will need to make an API call to the TapClicks platform and modify the tracking code on your webpage or 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 a new lead (i.e., an end customer) clicks Submit on your form, the 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 contain placeholder values (REPLACE-STRING), which will be replaced with the actual values submitted through the form. The tracking code will need to be modified for each web page/form for each of your clients. |
The URL can accept additional parameters to capture more details about the lead, including 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 the earlier steps were completed successfully, your PHP code should look similar to the following when viewed in your 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] After completing the steps above, the lead management dashboard should display a result similar to this:
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.
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 are 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.