Web Lead Form (Advanced Options)

Jump to: Privacy Mode | Return Status | Advanced Error Handling


Privacy Mode

By default, In Touch will append all parameters (first name, last name, mobile no, etc) to the return URL (identified as successPage in the form). Some tools like Google Analytics, have a problem with this. To avoid this issue, add following to the form:

<input name="enablePrivacyMode" id="enablePrivacyMode" type="hidden" value="true">

Return Status

With the successPage and failurePage, the response is encoded in URI in the following form

result=<STATUS_MESSAGE>&resultCode=<STATUS_CODE>

Possible codes are:

Description Result Code Result & Meaning
Success 1 Success: Lead was successfully created
Error looking up club -1, -2, -3 UUID (Club identifier) and/or GGCLUBID is missing or invalid: The Club UUID listed in your HTML form not correct. You can find your Club UUID in your InTouch site(s) under Admin > Club. GGCLUBID is for corporate Gold's Gym website forms only.
Validation error -4 Depends on field or fields that failed validation. Double check field requirements to ensure they are formatted correctly.
System error -5, -7, -8 A system internal error occurred. Please report the resultCode to InTouch Support for assistance.
Account disabled -11 Your web lead form has been disabled by InTouch. Contact InTouch Support.

 

Advanced Error Handling

When an error occurs, the lead's browser is redirected to the failure page. This page can be a generic page but most often it is more useful to display an error message to the user so that they can make corrections and re-submit the form. This section outlines how to output the returned error message using JavaScript.

This sample code uses a free online JavaScript library called CSJSRequestObject.

In the failure HTML page, the following JavaScript code is required:

<script type="text/javascript" src="CSJSRequestObject.js"> </script>
<script type="text/javascript" >
<!--
function urldecode(psEncodeString)
{
// Create a regular expression to search all +s in the string
var lsRegExp = /\+/g;
// Return the decoded string
return unescape(String(psEncodeString).replace(lsRegExp, " "));
}
// -->
</script>

And then, to output the returned error use the following code:

<body>
<h2>Lead creation failed</h2>
<script type="text/javascript">
document.write(urldecode(Request.QueryString("result")));
</script>
</body>

Here is what the resulting page looks like when the Web Lead Form Service returns an error about a missing or invalid first name:

result.png