Getting Started


LeadExec's dynamic consent provider allows you to control and validate what consent text is displayed on a form that you receive leads from.

These requests are logged within LeadExec to provide the tools to verify consent to be contacted with regard to the TCPA laws.


More information regarding TCPA

Step 1: Configure your account to use TCPA options

Using a simple code snippet generated from LeadExec, you can control which consent text is displayed on forms you control as well as 3rd party forms that are sending you leads.

To get started, you must set up TCPA options within LeadExec.


More information on how to setup LeadExec for TCPA

Step 2: Configure your form or supply a 3rd party source with consent code

Once your LeadExec account is TCPA enabled and you have created a campaign to be used with your form. You will need to include the form code snippet in your form's HTML markup.

<!-- LeadExec Consent Provider Script Block -->
<script type="text/javascript">
	const consentKey = '[CONSENT_API_KEY]';
	const consentTextAppendMode = 'default';
	const consentTextLoadOnPageLoad = true;
	const consentTextElementName = 'consentText';
	const consentTextIPElementName = 'consentTextIPAddress';
	(function () {
	    var consentJs = document.createElement('script'); consentJs.type = 'text/javascript'; consentJs.async = true;
	    consentJs.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'consentprovider.leadexec.net/scripts/requestJS.min.js';
	    var consentS = document.getElementsByTagName('script')[0]; consentS.parentNode.insertBefore(consentJs, consentS);
	})();
</script>

The CONSENT_API_KEY is supplied by the software and is used to identify the request with the form.


Step 3: Tell the consent code where in the form you would like the consent text

The consent code will place the text of the consent as HTML into a container called consentText.

You can label any container with the id=consentText, the code will automatically append the consent text within the container.

Important: This container must be visible to the end user, if the container is not visible the consent request will be rejected, and the lead will not be certified.

Step 4: Be sure that the form is sending the user's IP address

The consent provider system works off the user's IP address. When the form is submitted to the processor responsible for processing the field information and forwarding on to LeadExec, that system must include the user's IP address.

Failure to include the user's IP address to LeadExec will result in the consent request being ignored.

If you need to know the IP address reported to the consent provider, create a hidden input called consentTextIPAddress. This hidden field will automatically be populated with the IP address that the consent provider received when sending the text.

Example: <input type="hidden" id="consentTextIPAddress" name="IPAddress" />

You can then submit that field to your backend process and forward that on to LeadExec.


Information regarding modals and single page applications (SPAs)

If the consent text is to be loaded into a modal popup or panel that is initially hidden from the user, change the consentTextLoadOnPageLoad variable to false. This will prevent the consent text from loading when the page is loaded.

When the modal popup or panel is loaded, call leadExecConsentProvider.load(); to initiate the consent text script block and load the text into the designated element.

If the modal is hidden at any time before the lead is submitted, you must call leadExecConsentProvider.unload(); before it is hidden from view to unload the consent provider, and call leadExecConsentProvider.reload(); in the event that the modal popup or panel is reshown to the user. This will initiate a new call to get the consent text and will repopulate the designated element.


When using a single page application (SPA) you must unload the consent provider before navigating away from the page the consent text is displayed on. Call leadExecConsentProvider.unload(); to unload the consent provider, and use the leadExecConsentProvider.reload(); to reshow the consent text when needed.


Note: When submitting a lead you must wait for a response before calling the unload(); function. Failure to wait until a response is given can incorrectly label the lead as not TCPA compliant.