• Resolved alrioart

    (@alrioart)


    I’m trying to include a Campaign ID in my form and I’m failing.
    I have built a form on my site submitting to Salesforce with the plug-in where the Campaign_ID is set up as “hidden” and “value” is set to “00N44000xxxxx”.

    But testing failed and when viewing the source code of the site I see:
    input type=”hidden” id=”sf_Campaign_ID” class=”w2linput hidden” name=”Campaign_ID” value=”00N44000xxxxx” />

    The developers at Salesforce tell me “I would have expected the id to be 00N44000xxxxx and the value to be something like “Homepage” or whatever other page this lead originated on.”
    I can change the value to Homepage but how do I change the id from “sf_Campaign_ID”?
    How do I get the id to be 00N44000xxxxx?

    See the images I included in the test page linked above.

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Nick Ciske

    (@nickciske)

    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?

    Thread Starter alrioart

    (@alrioart)

    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/

    Plugin Author Nick Ciske

    (@nickciske)

    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…

    Thread Starter alrioart

    (@alrioart)

    Ok – I will check. thanks

    • This reply was modified 6 years, 4 months ago by alrioart.
    Plugin Author Nick Ciske

    (@nickciske)

    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}" />

    Thread Starter alrioart

    (@alrioart)

    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>
    
    Plugin Author Nick Ciske

    (@nickciske)

    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

    Thread Starter alrioart

    (@alrioart)

    I truly thought the Campaign_ID field that came with the plugin was to be used for that purpose. Sorry about that.

    Plugin Author Nick Ciske

    (@nickciske)

    That is the purpose of that field.

    You were passing it the wrong value…

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Campaign_ID field and Value Question’ is closed to new replies.