Don’t believe everything SF support says. Sometimes I think they don’t ever use their own tool, or they would fix some of the more annoying quirks it has…
From the FAQ:
The Campaign_ID field requires the Campaign ID — the name will not work. To find the Campaign_ID, go your the campaign page and look in the URL bar for the ID:
e.g. https://salesforce.com/621U000000IJat
In this example, 621U000000IJat is the Campaign_ID — make sure you use the ID from the campaign you want the lead attached to and not the example ID shown here.
So you’re on the right track.
Either your campaign id is incorrect, or something else is going on…
“But testing failed” – testing meaning… what?
Have you tried enabling debugging via email?
I can’t seem to set an ID for “sf_Campaign_ID”.
See images of my settings and what the code is saying when I “view source”…
https://www.vandykhealthcare.com/sf-test-contact-2/
The field id
is autogenerated from the field name
, you cannot “set” that to anything else.
That looks correct to me, if it’s not working with Salesforce, the issue lies elsewhere…
Ok – I will check. thanks
-
This reply was modified 6 years, 4 months ago by alrioart.
Right now, you’re using the human-readable field name for the Campaign ID field — this works as long as you pass a valid campaign ID as the value. Thus this output is what you get.
<input type="hidden" id=”sf_Campaign_ID” class=”w2linput hidden” name=”Campaign_ID” value="00N44000xxxxx" />
If 00N44000xxxxx is the internal SF ID of your field (not the capmaign, but the web to lead field), then you’d put it in the field name when creating the field in the form builder.
That will result in this:
<input type="hidden" id=”sf_ 00N44000xxxxx” class=”w2linput hidden” name=” 00N44000xxxxx” value="{valid campaign ID goes here}" />
This is the information I was given from the client generated from Salesforce I’m trying to use to build the form. I only assumed the campaign Id was 00N4400000xxxxx based on the code of the form. I’m having the client double check the URL as noted in the instructions to see what the correct Campaign ID is.
I currently have Label and Value set to 00N4400000xxxxx.
It sounds like you are saying to create a new Field (add field) and put 00N4400000xxxxx as the field name and a unique “Campaign ID” field as the Value.
<form action="https://webto.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" method="POST">
<input type=hidden name='captcha_settings' value='{"keyname":"API","fallback":"true","orgId":"00DE0000000eSei","ts":""}'>
<input type=hidden name="oid" value="00DE0000xxxxxx">
<input type=hidden name="retURL" value="https://www.vandykhealthcare.com/thank-you">
<input id="00N4400000xxxxx" name="00N4400000xxxxx" type="hidden" value="Homepage">
<!-- ---------------------------------------------------------------------- -->
<!-- NOTE: These fields are optional debugging elements. Please uncomment -->
<!-- these lines if you wish to test in debug mode. -->
<!-- <input type="hidden" name="debug" value=1> -->
<!-- <input type="hidden" name="debugEmail" -->
<!-- value="kevin@xxxx.com"> -->
<!-- ---------------------------------------------------------------------- -->
<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="80" 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="phone">Phone</label><input id="phone" maxlength="40" name="phone" size="20" type="text" /><br>
Your Message:<textarea id="00N4400000xxxxx" name="00N4400000xxxxx" rows="3" type="text" wrap="soft"></textarea><br>
<div class="g-recaptcha" data-sitekey="6LfRNzEUAAAAACOel9EG9a7iSf26xxxxx"></div><br>
<input type="submit" name="submit">
</form>
Why didn’t you lead with this?!
You set up your field wrong — 00N4400000xxxxx is the internal SF field ID… so that is the field name, not the value.
Field Name = 00N4400000xxxxx
or Campaign_ID
Enabled = (checked)
Type = Hidden
Value = Homepage
I truly thought the Campaign_ID field that came with the plugin was to be used for that purpose. Sorry about that.
That is the purpose of that field.
You were passing it the wrong value…