How do I pre-fill contact information in KIMBIA forms?

Are you a KIMBIA customer running an email donation or registration fundraising campaign and you already know your donor’s contact information? If you do and can uniquely identify the user when they load the page, you can pre-fill the contact information in KIMBIA forms so the user doesn’t have to type it.

Some examples of fields you can pre-fill:

  • First Name
  • Last Name
  • Email
  • Street Address Line 1
  • Streed Address Line 2
  • City
  • State
  • Zipcode
  • Phone

How to Set Kimbia Contact Profile Values

1) Determine the question.name. Usually, this can be determined by loading the form and getting the name attribute of the input. Do not use other attributes.

Put a Custom Function in the <head> of the web page, using JavaScript.

  1. <script type="text/javascript">
  2. function prefill(widget) {
  3. // do tasks here.
  4. }
  5. </script>

2) In your Custom Function, add calls to the widget API to set desired answer values.

  1. widget.setDefaultAnswerValueByQuestionName("questionName", "desired value");

Examples:

  1. widget.setDefaultAnswerValueByQuestionName("FirstName", "Bart");
  2. widget.setDefaultAnswerValueByQuestionName("_payment.firstName", "PayFirstNameTest");
  3. widget.setDefaultAnswerValueByQuestionName("LastName", "Jones");
  4. widget.setDefaultAnswerValueByQuestionName("ContactEmail", "bartjones@mailinator.com");
  5. widget.setDefaultAnswerValueByQuestionName('MailingAddress|country', 'US');
  6. //NOTE: when working with Addresses, set country first.
  7. widget.setDefaultAnswerValueByQuestionName("MailingAddress|street1", "1234 Testing Avenue");
  8. widget.setDefaultAnswerValueByQuestionName("MailingAddress|street2", "#2");
  9. widget.setDefaultAnswerValueByQuestionName("MailingAddress|city", "Pleasantville");
  10. widget.setDefaultAnswerValueByQuestionName("MailingAddress|state", "AL");
  11. widget.setDefaultAnswerValueByQuestionName("MailingAddress|zipcode", "78704");
  12. widget.setDefaultAnswerValueByQuestionName("Q4J3CDKWLGG", "555-555-5555,");

    ***see notes below

3) Put your snippet in the BODY of the page. Add the &onload= parameter to it that matches the name of your custom function.

<script src="https://widgets.kimbia.com/widgets/form.js?channel=[CAMPAIGN_PREFIX]/[FORM_SUFFIX]&onload=prefill"/>

NOTES:

  • When setting Address values, always set country first.
  • Field names may change from form to form for the items that are optionally added to Contact Information, like Title and Phone Numbers. So, don’t assume that “Phone” will always work as a randomly generated name is just as likely to be given to a field.
Bookmark and Share
KIMBIA empowers nonprofits and other organizations to increase giving and overall participation with the most powerful and flexible online fundraising and event management tools. KIMBIA's modern platform works with any existing Web site, allowing organizations to better utilize their technology investments. KIMBIA can be deployed instantly to optimize current marketing strategies, reach more supporters and drive stronger results.