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 lead collection for TapLeads on the instance and then activate the TapLeads service for each client:
What is TapLeads?
TapLeads is a TapClicks service that enables the collection of lead data from external sources, such as website forms, landing pages, or third-party form tools, and sends that data into TapClicks for reporting and analysis. TapLeads works by accepting lead information through a secure API endpoint. When a form is submitted, the lead details are passed to TapClicks and associated with the correct client based on a unique Client Lead Code. Collected leads then appear in the lead management and reporting areas of SmartAnalytics. TapLeads does not create or host forms within the TapClicks platform. All forms and form logic are managed externally, and TapLeads functions solely as the lead ingestion and tracking mechanism.
Step 1: Activate TapLeads
1] On the Data menu, click Data Source Settings.
2] On the right side of the page, slide the Activate lead collection service (TapLeads) toggle to the right.
Step 2: Locate the Client
3] On the Admin menu, click Clients.
4] 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).
5] After you locate the client you want to enable lead collection for, on the far right, click the Edit (pencil) icon.
Step 3: Set up Lead Collection via Form Fill
6] In the Settings tab, scroll to the Leads section and slide the Enable Tap Leads? slider to the right.
7] Under the toggle, locate the Client Lead Code. Save this code for use later.
8] Repeat steps 4-7 for each client you would like leads.
Step 4: Construct Your Submission URL
Modify your tracking code
Wherever you manage your lead collection forms (for example, your website CMS, form builder, or backend service), you will need to modify the tracking code to make an API call to the TapClicks platform. This code should include a URL with all required parameters to capture lead details and send them to your SmartAnalytics dashboard.
When a new lead (i.e., an end customer) clicks Submit on your form, the code will 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 JavaScript code 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
9] Replace myagency.tapclicks.com with the URL of your dashboard.
10] 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
Step 5: Implement the Backend Integration
We strongly recommend sending leads from a backend script for security reasons. Do not expose your Client Lead Code or submission URL in any frontend code.
Use a backend process (e.g., PHP, Node.js, Python) to:
- Validate and sanitize form values
- Submit the form data to TapClicks via cURL, Fetch, or HTTPS POST
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);
11] 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);
12] After completing the steps above, the lead management dashboard should display a result similar to this:
Step 6: Test Your Setup
13] Construct your full URL using sample values.
14] Paste it into a new browser tab and hit Return or Enter.
15] 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"}
| Note: 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 SmartAnalytics installation. |
Step 7: Embed the Script
16] Once you've tested and confirmed the URL works, embed your backend submission script into the client’s form. Leads will begin flowing into TapClicks and will appear in your reporting dashboards alongside other sources.
If you need help configuring your Client Lead Code or tracking URL, reach out to TapClicks Support for assistance.