function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
TheRiddlerTheRiddler 

Populating lead_source field via Google Adwords

It was my understanding that if you had the Google Adwords app installed and had the appropriate javascript coding loaded on each of your website pages and had the appropriate sfga coding on the web-to-lead form, when the lead was created it would populate the lead_source field with one of four values, depending on where the web link orginally came from.

Unfortunately that isnt happening for me! I have used the Adwords tool to check that everything is setup ok and salesforce reports back that it is happy with both the page and the form. However, whenever a form is completed, the lead is created with an empty lead_source.

I tried creating a vanilla form with just the basic components and had the same issue.

Anyone else come across this before? Any ideas?
ksks
TheRiddler - Your understanding of how the lead_source field will populate is quite accurate.  Just to be clear, and for others coming across this post, let me restate:

For any leads that are generated from web-to-lead forms that contain the salesforce javascript snippet, the lead_source field will automatically populate approximately 5-10 minutes after the lead is created with one of the following 4 values

  1. Google AdWords - the lead originated from a click on a Google Ad
  2. Organic {SearchEngine} - The lead originated from organic search
  3. Web Referral - The lead orginated from a clickthrough via a referring website (non searchengine)
  4. Web Direct - The lead orginated from someone who had bookmarked your site or typed in your URL
There is more information available at the learning center on our blog:
http://blogs.salesforce.com/adwords/2007/06/salesforce-for-.html

Now, to your probelm specifically, there are a few common reasons your lead_source value might not be populating:
  • Make sure that you are waiting the necessary 5-10 minutes after the lead is created to look for the presence of the auto-completed lead source value. 
  • Check your website to make sure that any custom javascript you may have created (for example, validation routined) is not calling form.submit() directly.  Calling form.submit() is not supported with the salesforce javascript and there are other supported methods of javascript form validation which I will post in a subsequent message
  • You have private sharing turned on for leads and the system user (called license manager) who is attempting to update the lead objects does not have the required permissions to do so.  Simply place the license manager user at the top of the role hierarchy.
For additional assistance with your specific situation, please contact the SFGA product team at anytime.  You can reach us directly at sfga@salesforce.com and one of our product managers will contact you via phone or email.

Thanks,
-Kraig
kswensrud@salesforce.com
sfga@salesforce.com
ksks
The following is an explanation of salesforce supported client side validation of web-to-lead forms:


Unsupported scenario
Calling form.submit() directly in standard web-to-lead forms

Some javascript form validations call form.submit() directly This function is currently not supported for use with standard web-to-lead forms. Doing so bypasses the correlation engine and you will be unable to correlate your leads (even though you will still see the leads in Salesforce). The solution to this is to replace the form.submit() with the more standard onsubmit validation as shown above.


Supported scenario
Using the onSubmit() function for client-side form validation

There are numerous ways to validate form submissions with client-side javascript. Salesforce supports client side javascript validation using the form onsubmit function as shown below. 

Form element:

...

<form action="http://www.salesforce.com..." onsubmit="return validation(this);" method="POST">

...


Validation function:

function validation(form) {


if(form.first_name.value == '') {

alert('Please enter your first name');
form.first_name.focus();
return false;
}


if(form.last_name.value == '') {

alert('Please enter your last name');
form.last_name.focus();
return false;
}

if(form.email.value == '') {

alert('Please enter your email address');
form.email.focus();
return false;
}


if(form.company.value == '') {

alert('Please enter your company');
form.company.focus();
return false;
}

return true;
}




Message Edited by ks on 08-07-2007 07:10 AM

TheRiddlerTheRiddler
Thanks for your responses. I wasnt aware of the 10-15 minute delay and thought that might have been the issue, but sadly not! As we are not using javascript in the form, I dont think that is the problem either.

Pasted below is the vanilla version of the form I have been using to try and sort out where the issue lies (minus our account data). Whilst this form successfully creates and populates a salesforce.com lead, it doesnt create any lead_source data. I am running this on my own local machine in case there was an evironment issue with the webserver but the same situation occurs in both instances.

Anything obvious missing or in the wrong place?


<HTML>
<HEAD> <META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"> </HEAD>
<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"></script>
<script type="text/javascript">
    _uacct = "UA-xxxxxxx-1";
    urchinTracker();
</script>


<BODY>


<FORM action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">

<INPUT type="hidden" name="oid" value="00D2xxxxxxxxxxx">
<INPUT type="hidden" name="sfga" value="00D2xxxxxxxxxxx">
<INPUT type="hidden" name="retUrl" value="http://website address">
<INPUT type="hidden" id="00N2xxxxxxxxxxx" name="00N2xxxxxxxxxxx" title="website_form" value="newsletter signup">

<LABEL for="first_name">First Name</LABEL>
<INPUT id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br>

<LABEL for="last_name">Last Name</LABEL>
<INPUT id="last_name" maxlength="40" name="last_name" size="20" type="text" /><br>

<LABEL for="email">Email</LABEL>
<INPUT id="email" maxlength="80" name="email" size="20" type="text" /><br>

<LABEL for="company">Company</LABEL>
<INPUT id="company" maxlength="40" name="company" size="20" type="text" /><br>

<INPUT type="submit" name="submit">
</FORM>

<SCRIPT type="text/javascript" src="https://lct.salesforce.com/sfga.js"></SCRIPT>
<SCRIPT type="text/javascript">__sfga();</SCRIPT>
</BODY>
</HTML>
ksks
TheRiddler -

I would be happy to explore your situation iin greater depth.
At first glance, your form and web page setup look fine.
However, your SFDC org must be bound correctly to Google AdWords.
Please email me your Company Name and OrgID.

Thanks,
-Kraig
mailto:kswensrud@salesforce.com