Does Double the Donation Integrate with NationBuilder?
This article walks through Double the Donation's integration with NationBuilder.
Step-by-Step: Integrate Double the Donation Matching into NationBuilder
NationBuilder - Double the Donation FAQs
Double the Donation is the industry-leading matching gifts automation solution for nonprofits and educational institutions to identify more matching gift revenue opportunities and drive more matches to completion. You’ll need a Double the Donation account to activate the matching gift functionality within this partner platform. Not a Double the Donation client? Schedule a demo at https://doublethedonation.com/demo-request/.
Step-by-Step: Integrate Double the Donation Matching into NationBuilder
These instructions require you to edit the code in the template of your donation page. If you are not comfortable doing this, the NationBuilder team would be happy to implement these changes for you. For assistance with this, please send an email to Brian Palmer at bpalmer@nationbuilder.com.
Add the employer search field to your donation page
Step 1 — Open the Donation Page
In NationBuilder:
-
Navigate to Website.
-
Open the donation page you want to update.
Step 2 — Edit the Template
-
Click Template on the donation page.
-
Switch to code view to edit the page template.
Step 3 — Insert the Employer Search Container
Paste the following inside the <form> tag where you want the employer search to appear:
<div id='dd-company-name-input'></div>
<script>var DDCONF = {API_KEY: "360MATCHPRO_PUBLIC_KEY"};</script>
You should replace 360MATCHPRO_PUBLIC_KEY with your actual Double the Donation Public API key, found in your Double the Donation account settings.
Recommended placement: Directly below the billing address fields
<div class="form-group col-md-6">
<div class="float-label">
<label for="donation_last_name">{{ t_forms_last_name }}</label>
{% text_field "last_name", class:"form-control" %}
</div>
</div>
</div>
<div class="form-row">
<div class="form-group col-md-6">
<div class="float-label">
<label for="donation_email">{{ t_forms_email }}</label>
{% email_field "email", class:"form-control" %}
</div>
</div>
<div class="form-group col-md-6">
<div class="float-label">
<label for="donation_billing_address_phone_number">{{ t_forms_phone }}</label>
{% phone_field "billing_address.phone_number", class:"form-control" %}
</div>
</div>
</div>
{% include "donation_billing_address_inputs" %}
<div id='dd-company-name-input'></div>
<script>var DDCONF = {API_KEY: "360MATCHPRO_PUBLIC_KEY"};</script>
You should replace 360MATCHPRO_PUBLIC_KEY with your actual Double the Donation Public API key, found in your Double the Donation account settings.
Step 4 — Load the Double the Donation Script and Styles
Add the following anywhere on the page template:
<script src="https://doublethedonation.com/api/js/ddplugin.js"></script>
<link href="https://doublethedonation.com/api/css/ddplugin.css" rel="stylesheet" />
Add the matching gift plugin to your confirmation page
In order for the integration to work, donors must land on a basic page after their donation processes. This can be called a donation confirmation page, a thank you page or something along those lines.
Step 1 — Create a Confirmation Page
-
Navigate to Website → New Page.
-
Create a Basic Page (this will be your donation confirmation page).
Step 2 — Update Donation Settings
On the donation page:
-
Go to Donation Settings → Advanced.
-
Set “After donating, what page should they land on next?” to the slug of your new confirmation page.
-
(Optional) Disable social share prompts to ensure donors see the matching-gift content.
Step 3 — Edit the Confirmation Page Template
-
Open the confirmation page.
-
Click Template.
-
Insert the following code below the page content:
<div id="dd-container"></div>
It is recommended to place this code directly below the {{ page.basic.content }} liquid tag, like so:
{% if page.basic.content.size > 0 %}
<div class="page-content">
{{ page.basic.content }}
<div id="dd-container"></div>
</div>
{% endif %}
NOTE: The if/then liquid conditional statement in the example above means that the added code will only work if there is some content in the page's content editor. Thus, you should either add some content to the WYSIWYG editor (e.g. "Thank you for contributing!") or remove the liquid "if" and "endif" tags that surround the page-content div.
Step 4 — Add the Confirmation Page Script
At the bottom of the confirmation page template, add the JavaScript below and replace all instances of the placeholder with your Public API Key:
<script src="https://doublethedonation.com/api/js/ddplugin.js"></script>
<link href="https://doublethedonation.com/api/css/ddplugin.css" rel="stylesheet" />
<script>
const dtd = localStorage.getItem('doublethedonation');
const obj = JSON.parse(dtd);
const companyId = obj.doublethedonation_company_id;
const enteredText = obj.doublethedonation_entered_text;
if (window.doublethedonation) {
doublethedonation.integrations.core.register_donation({
"360matchpro_public_key": "360MATCHPRO_PUBLIC_KEY",
"partner_identifier": "NATIO-3EJAQWTM1IY6vJsi",
"campaign": "{{ request.current_signup.last_donation.tracking_code_slug }}",
"donation_identifier": "{{ request.current_signup.last_donation.id }}",
"donation_amount": {{ request.current_signup.last_donation.amount_format | remove:'$' }},
"donor_first_name": "{{ request.current_signup.first_name }}",
"donor_last_name": "{{ request.current_signup.last_name }}",
"donor_email": "{{ request.current_signup.email }}",
"donor_address": {"zip": {{ request.current_signup.billing_address.zip }},
"city": "{{ request.current_signup.billing_address.city }}",
"state": "{{ request.current_signup.billing_address.state }}",
"address1": "{{ request.current_signup.billing_address.address1 }}",
"address2": "{{ request.current_signup.billing_address.address2 }}",
"country": "{{ request.current_signup.billing_address.country_code }}"},
"donor_phone": "{{ request.current_signup.phone }}",
"donation_datetime": "{{ request.current_signup.last_donation.succeeded_at | date:'%Y-%m-%dT%H:%M:%S%z' }}",
"anonymous": "{{ request.current_signup.last_donation.is_private? }}",
"recurring": "{{ request.current_signup.last_donation.is_recurring? }}",
"doublethedonation_company_id": companyId,
"doublethedonation_entered_text": enteredText
});
};
var dtd_selected_company = companyId;
var DDCONF = {API_KEY: "360MATCHPRO_PUBLIC_KEY", COMPANY: dtd_selected_company};
if (window.doublethedonation) {
doublethedonation.plugin.load_config();
doublethedonation.plugin.set_donation_identifier("{{ request.current_signup.last_donation.id }}");
doublethedonation.plugin.set_donation_campaign("{{ request.current_signup.last_donation.tracking_code_slug }}");
if (dtd_selected_company) {
doublethedonation.plugin.set_company(dtd_selected_company);
} else {
var domain = doublethedonation.integrations.core.strip_domain("{{ request.current_signup.email }}") ;
doublethedonation.plugin.email_domain( domain );
}
}
</script>
Result
-
Donations are sent to Double the Donation Matching
-
Matching-gift instructions appear on the confirmation page
NationBuilder - Double the Donation FAQs
Q: I don’t have a Double the Donation account. How do I get one?
A: Visit the Double the Donation demo request page to schedule a demo. Mention that you use SimplyFundraisingCRM in your demo request form.
Q: Where can I embed Double the Donation's matching gift search plugin?
A: We recommend creating a dedicated matching gift page on your website. This page will help all website visitors, not just those on your donation form, understand matching gift programs and easily find their company’s matching gift guidelines and forms.
To embed the matching gift search tool, locate your embed code from your matching module. Full instructions are available here.
