Support Center

Salesforce API Lead Creation

Last Updated: Jul 22, 2013 03:12PM BST
Some people have custom forms, or a form that caches the data on their own server and later uploads the Leads in bulk. Any of these methods might use the API to create your Leads. Please read below for more information on using the API.

Hidden Form fields

Value should be blank

The field value should be blank. It can explicitly state that it is blank, or simply not have the word value in the form. Both of the options below are fine:
<input type=hidden id="Daddy_Analytics_Token" name="00Nd0000005aZ2g" >
<input type=hidden id="Daddy_Analytics_Token" name="00Nd0000005aZ2g" value="" >

Field Name

When using the API, what you call the field name is less important. What matters is that the field name in the hidden input is the same as the four lines of Javascript. The following will work fine, as long as the two pairs of highlighted text match each other exactly.

<input type=hidden id="Daddy_Analytics_Token" name="token_da">
<input type=hidden id="Daddy_Analytics_WebForm_URL" name="url_da">

<script src="//cdn.daddyanalytics.com/w/daddy.js" type="text/javascript"></script>
<script type="text/javascript">var da_data =init('{"da_token":"token_da","da_url":"url_da"}');var clicky_custom = {session: {DaddyAnalytics: da_data,},};</script>
<script src="//hello.staticstuff.net/w/__stats.js" type="text/javascript"></script>
<script type="text/javascript">try{ clicky.init(100601278); }catch(e){}</script>

The first value should be populated with a token that looks similar to 1367435409341-8726588 and the other field will be populated with the URL of the current page.

You can check that this is working with various browser development tools, such as Firebug.

Once those fields are being populated correctly, the the next step is to make sure that you are pushing them to Salesforce, so the Lead you create has those two fields. The API name of those two fields are

DaddyAnalytics__DA_Token__c
DaddyAnalytics__DA_Web_to_Lead_URL__c

As long as those two fields in Salesforce are populated, then our code in Salesforce will pull in the rest of the information, either upon Lead creation or within 15 minutes (we sync against our web analytics servers every 15 minutes).
 

 

Contact Us

d8014172c610382a7b73a54e59d3574e@daddydonkeylabs.desk-mail.com
https://cdn.desk.com/
false
desk
Loading
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
about
false
Invalid characters found
/customer/en/portal/articles/autocomplete