Easily embed the Donor Fuse donation form on your website with just a few steps. This guide walks developers through the process.
1. Add the Donor Fuse Embed Script
Place this script tag inside your website’s <head> section:
HTML
<script src="https://donate.donorfuse.com/assets/embed.js"></script>
2. Trigger the Donation Popup
To open the donation form, call the DonorFuseClient.ShowPopup(options, callback) function on any button click or event.
Example Button Integration:
HTML
<button onclick="donate()">Donate</button>
<script>
function donate() {
var options = {
link: 'your-donation-link', // required
campaign: 123, // required
// --- Optional parameters below ---
amount: 180,
disableAmount: false,
firstName: 'John',
lastName: 'Doe',
email: 'john@example.com',
phone: '+1234567890',
addressLine1: '123 Main St',
addressLine2: 'Apt 4B',
addressCity: 'New York',
addressState: 'NY',
addressZip: '10001',
message: 'Thank you!',
sponsorship: 1834,
sponsorshipDate: '2025-06-12',
disableInfo: false
};
DonorFuseClient.ShowPopup(options, function(success) {
console.log('Donation completed:', success);
// Optionally close popup: DonorFuseClient.ClosePopup();
});
}
</script>3. Options Reference
Required fields:
link(string): Your donation linkcampaign(number): The campaign ID
Optional fields:
amount(number): Pre-filled donation amountdisableAmount(boolean): If true, donor cannot change the amountfirstName,lastName,email,phone: Pre-fill donor infoaddressLine1,addressLine2,addressCity,addressState,addressZip: Pre-fill address fieldsmessage: Pre-fill a messagesponsorship(number): Pre-fill sponsorship IDsponsorshipDate(string, YYYY-MM-DD): Pre-fill sponsorship datedisableInfo(boolean): If true, all info fields are disabled
4. Handling the Callback
The callback receives a success parameter indicating if the donation process was completed.
JavaScript
DonorFuseClient.ShowPopup(options, function(success) {
if (success) {
// Donation was successful
} else {
// Donation was cancelled or failed
}
});
Notes:
- The popup closes automatically 3 seconds after a successful donation, but you can close it sooner with
DonorFuseClient.ClosePopup(). - Use the production script for live donations; use the test script for development.
- Replace all placeholder values with your actual data.
For advanced usage or troubleshooting, please contact Donor Fuse support.