Embeddable Donation Form

Version 6.x — Drop-in donation form for any website.

Embedding the Form

The Donately embeddable form is a JavaScript-powered donation form that supports credit cards, ACH bank transfers, PayPal, Apple Pay, Google Pay, recurring donations, custom fields, and more.

This documentation covers version 6.x (current production). Version 7.x is a major rebuild and is coming soon.

Method 1: Simple Script (Recommended)

The easiest way to embed your form. Add a single script tag with your account ID, Stripe key, and form ID. The form configuration is fetched automatically from the Donately API. Works on any page builder that allows script embeds (Webflow, Squarespace, Wix, Drupal, etc.).

<script
  src="https://cdn.donately.com/6.0/donately.min.js"
  data-donately-id="act_ba7d12ab27bb"
  data-stripe-publishable-key="pk_live_xxxx"
  data-donately-form-id="frm_xxxx"
  data-donately-fetch-config="true"
  async="async">
</script>
Tip: We recommend re-copying the embed code each time you make changes to your form in the Donately dashboard.

Method 2: Iframe

Perfect for tools that limit your ability to use JavaScript on your site (e.g., WordPress). The iframe is generated automatically from your form configuration.

<iframe
  src="https://cdn.donately.com/6.0/donate-form.html?form_id=frm_xxxx&account_id=act_ba7d12ab27bb&stripe_key=pk_live_xxxx"
  width="100%"
  height="850px"
  frameborder="0"
  allowtransparency="true"
  allow="payment *"
  style="max-width:600px;">
</iframe>

Method 3: Advanced Script

Gives you full control of the embed code. Best for developers with programming experience who want to customize callbacks, handle events, or pass dynamic options.

<div id="dntly-donation-form"></div>
<script src="https://cdn.donately.com/6.0/donately.min.js" async="async"></script>
<script>
  dntlyReady("Donately", function(t) {
    Donately.init({
      selector: '#dntly-donation-form',
      options: {
        "donately-id": "act_ba7d12ab27bb",
        "stripe-publishable-key": "pk_live_xxxx",
        "donately-form-id": "frm_xxxx"
      },
      afterFormLoad: function() {},
      afterNavigateHook: function(stepNumber) {},
      onSuccess: function(donation) {},
      onError: function(error) {}
    });
  });
  function dntlyReady(name, callback) {
    window.setTimeout(function() {
      if (window[name]) { callback(window[name]); }
      else { dntlyReady(name, callback); }
    }, 10);
  }
</script>

Required Options

OptionDescription
donately-idYour Donately account ID (e.g., act_ba7d12ab27bb)
stripe-publishable-keyYour Stripe publishable key (starts with pk_live_ or pk_test_)
donately-form-idYour form ID (e.g., frm_xxxx). Required when using the simple embed method — the form configuration is fetched from the API using this ID.

Donation Options

OptionTypeDescription
amountnumber | objectDefault donation amount, or an object for more control (see below)
presetsstring | objectPreset donation amounts (see below)
campaign-idstringCampaign to attribute donation to
fundraiser-idstringFundraiser to attribute donation to
currencystringISO currency code (default: usd)
dont-send-receipt-emailbooleanSuppress the automatic donation receipt email

Amount Configuration

Pass a number for a simple default, or an object for more control:

// Simple default amount
"amount": 50

// Object with full options
"amount": {
  "default": 50,
  "placeholder": 100,
  "disabled": false,
  "required": false
}
PropertyTypeDescription
defaultnumberPre-filled donation amount in dollars
placeholdernumberPlaceholder text shown when the amount field is empty
disabledbooleanLock the amount field so it cannot be changed by the donor
requiredbooleanSet to false to make the amount field optional

Presets Configuration

Pass a comma-separated string for simple presets, or an object for advanced control:

// Simple comma-separated
"presets": "25,50,100,250"

// Advanced object format
"presets": {
  "presets": [
    { "label": "$25", "amount": 25 },
    { "label": "$50", "amount": 50 },
    { "label": "{{currency_symbol}}100", "amount": 100 },
    { "label": "Other Amount", "amount": "", "type": "input" }
  ],
  "fullWidthPresets": true,
  "presetsAsSelect": false
}
PropertyTypeDescription
presetsarrayArray of preset objects (see below)
fullWidthPresetsbooleanRender preset buttons at full width
presetsAsSelectbooleanRender presets as a dropdown select instead of buttons

Preset Object Properties

PropertyTypeDescription
labelstringDisplay text for the preset. Supports {{currency_symbol}} placeholder.
amountnumberDonation amount in dollars
amount_in_centsnumberAlternative: specify amount in cents instead of dollars
typestringSet to "input" to render as an editable text field instead of a button

Donor Fields

Control which donor information fields are shown on the form. Most fields accept either true to enable with defaults, or a configuration object for more control.

OptionTypeDescription
emailstringPre-fill the donor's email address
nameobject | booleanShow first/last name fields. See name configuration.
addressobject | booleanShow full address fields (street, city, state, zip, country). See address configuration.
phoneobject | booleanShow phone number field. See phone configuration.
commentbooleanShow comment/message field
onbehalfofbooleanShow "on behalf of" / tribute field
anonymousbooleanShow "make my donation anonymous" checkbox

Field Configuration

Fields that accept objects can be passed as true to enable with defaults, or as an object for granular control.

name

// Enable with defaults
"name": true

// With options
"name": { "required": true }
PropertyTypeDescription
requiredbooleanMake first and last name fields required

phone

// Enable with defaults (required)
"phone": true

// Enable but optional
"phone": { "required": false }
PropertyTypeDescription
requiredbooleanMake the phone field required (default: true). Set to false to make it optional.

address

// Enable with defaults (required)
"address": true

// With full options
"address": {
  "required": true,
  "preselect_country": "US",
  "disabled": false
}
PropertyTypeDescription
requiredbooleanMake all address fields required (street, city, state, zip, country). Set to false to make optional.
preselect_countryboolean | stringSet to true to auto-detect the donor's country, or pass a country code (e.g., "US", "CA", "GB") to pre-select a specific country.
disabledbooleanLock the country dropdown so it cannot be changed. Only applies when preselect_country is set.

Donor Pays Fees

The donor-pays-fees option lets donors opt in to covering transaction fees so the nonprofit receives the full donation amount. This option supports multiple configuration formats depending on how much control you need.

Simple Boolean

Enable with default fee calculations for all payment methods:

"donor-pays-fees": true

Simple Percentage

Apply a single percentage across all payment methods:

"donor-pays-fees": "0.042"

Per-Payment-Method Configuration

For full control, pass an object with fee settings for each payment method:

"donor-pays-fees": {
  "preselected": true,
  "cc": {
    "processor_percent": 0.029,
    "processor_fixed": 0.30,
    "dntly_percent": 0.04,
    "complex_calc": true
  },
  "ach": {
    "processor_percent": 0.008,
    "processor_fixed": 0,
    "processor_cap": 5.00,
    "dntly_percent": 0.04,
    "complex_calc": true
  },
  "paypal": {
    "processor_percent": 0.029,
    "processor_fixed": 0.30,
    "dntly_percent": 0.04
  }
}

Top-Level Properties

PropertyTypeDescription
preselectedbooleanPre-check the "cover fees" checkbox when the form loads (default: false)

Payment Method Properties

Each payment method key (cc, ach, paypal, wallet, cash) accepts these properties:

PropertyTypeDefault (CC)Default (ACH)Description
processor_percentnumber0.0290.008Processor percentage fee as a decimal (e.g., 0.029 = 2.9%). Must be between 0 and 1.
processor_fixednumber0.300Fixed per-transaction fee in dollars (e.g., 0.30 = 30 cents)
processor_capnumber | nullnullnullMaximum cap on processor fees in dollars (e.g., 5.00 for ACH). Set to null for no cap.
dntly_percentnumber0.040.04Donately platform percentage fee as a decimal (e.g., 0.04 = 4%). Must be between 0 and 1.
complex_calcbooleantruetrueUse the precise fee calculation algorithm. When false, uses a simpler calculation.

Common Examples

// Flat 3% fee on credit card donations
"donor-pays-fees": {
  "cc": {
    "processor_percent": 0.03,
    "processor_fixed": 0,
    "dntly_percent": 0,
    "complex_calc": false
  }
}

// Flat $2.50 fee on all donations
"donor-pays-fees": {
  "cc": {
    "processor_percent": 0,
    "processor_fixed": 2.50,
    "dntly_percent": 0,
    "complex_calc": false
  }
}

// ACH with $5 cap
"donor-pays-fees": {
  "ach": {
    "processor_percent": 0.008,
    "processor_fixed": 0,
    "processor_cap": 5.00,
    "dntly_percent": 0.04
  }
}

Recurring Donation Options

Configure how recurring donations are presented to donors.

Using recurring-options (Recommended)

"recurring-options": {
  "frequencies": ["false", "1.month", "3.month", "12.month"],
  "type": "toggle"
}
PropertyDescription
frequenciesArray of frequency options to display. "false" = one-time option.
typeDisplay style: "toggle" or default radio buttons

Available Frequencies

ValueDescription
falseOne-time donation
1.dayDaily
7.dayWeekly
14.dayBi-weekly
1.monthMonthly
2.monthBi-monthly
3.monthQuarterly
6.monthSemi-annually
12.monthAnnually

Legacy Options

OptionDescription
recurring-frequencyLegacy: comma-separated frequencies or JSON array
recurring-startStart date for the recurring schedule
recurring-stopEnd date for the recurring schedule

Payment Methods

Control which payment methods are available on the form.

"payment-options": "cc,wallet,ach,paypal"
ValueDescription
ccCredit / debit card via Stripe
walletApple Pay / Google Pay via Stripe
achACH bank transfer via Stripe
paypalPayPal (requires PayPal merchant ID)
OptionDescription
payment-optionsComma-separated list of enabled payment methods
payment-options-layoutLayout style: horizontal or vertical
paypal-merchant-idPayPal merchant ID (required for PayPal)

Custom Fields

Add custom form fields that are stored as metadata on the donation. Pass as a JSON array.

"custom-fields": [
  {
    "type": "text",
    "label": "Company Name",
    "name": "company_name",
    "required": true
  },
  {
    "type": "select",
    "label": "How did you hear about us?",
    "name": "referral_source",
    "options": ["Google", "Social Media", "Friend", "Event", "Other"]
  },
  {
    "type": "checkbox",
    "label": "Add me to the mailing list",
    "name": "mailing_list"
  },
  {
    "type": "section",
    "label": "Additional Information"
  },
  {
    "type": "hidden",
    "name": "source",
    "value": "website-homepage"
  }
]

Field Types

TypeDescription
textSingle-line text input
emailEmail input with validation
textareaMulti-line text area
selectDropdown select. Provide options array.
radioRadio button group. Provide options array.
checkboxSingle checkbox
select_stateUS state dropdown (pre-populated)
select_countryCountry dropdown (pre-populated)
select_campaignDropdown of account campaigns
select_fundraiserDropdown of campaign fundraisers
hiddenHidden field with preset value
sectionVisual section divider / heading
cart_itemsMerchandise / cart item selector

Styling & Themes

Pre-built Themes

"theme": "clean"

Available themes: clean, minimal, and more.

Custom Theme (CSS Variables)

Override specific CSS variables to match your brand:

"custom-theme": {
  "-PrimaryColor": "#4A90D9",
  "-PrimaryFontFamily": "Helvetica, Arial, sans-serif",
  "-PrimaryFontSize": "16px",
  "-FormBackgroundColor": "#ffffff",
  "-FormOuterPadding": "20px",
  "-FieldBorderColor": "#cccccc",
  "-FieldBorderWidth": "1px",
  "-FieldBackgroundColor": "#fafafa",
  "-FieldFontColor": "#333333",
  "-LabelFontColor": "#555555",
  "-ErrorTextColor": "#dc3545"
}

Available CSS Variables

VariableDescription
-PrimaryColorMain brand / button color
-PrimaryFontFamilyFont family for all form text
-PrimaryFontSizeBase font size
-FormBackgroundColorForm container background
-FormOuterPaddingPadding around the form
-FieldBackgroundColorInput field background
-FieldFontColorInput field text color
-FieldBorderColorInput field border color
-FieldBorderWidthInput field border width
-LabelFontColorLabel text color
-ErrorTextColorError/validation message color

Custom CSS

For full control, inject custom CSS:

"custom-css": ".dntly-form .dntly-submit-btn { border-radius: 50px; }"

Internationalization

The form supports multiple languages out of the box.

OptionDescription
i18n-localeLanguage/locale code
show-language-selectShow a language selector dropdown on the form
custom-translations-urlURL to a custom translation JSON file

Supported Locales

  • en_US — English (US) — default
  • es_ES — Spanish
  • fr_CA — French (Canadian)
  • de_DE — German
  • it_IT — Italian
  • sv_SE — Swedish
  • zh_HK — Chinese (Hong Kong)

Confirmation Screen

Customize what donors see after a successful donation. You can change the thank-you message, enable social sharing, or redirect to an external page.

"confirmation-config": {
  "thank_you_message_header": "Thank you for your {{formatted_amount}} donation!",
  "thank_you_message_subheader": "A receipt has been sent to {{email}}.",
  "display_social_icons": true,
  "social_share_message": "I just donated to {{social_share_account_title}}!",
  "social_share_account_title": "Our Nonprofit",
  "social_share_url": "https://example.org/donate",
  "twitter_hashtags": "donate,giveback"
}

Message Options

PropertyTypeDescription
thank_you_message_headerstringMain heading shown after donation. Supports {{formatted_amount}} placeholder.
thank_you_message_subheaderstringSecondary message (e.g., receipt info). Supports {{email}} placeholder.

Social Sharing Options

PropertyTypeDescription
display_social_iconsbooleanShow social share buttons (Facebook, Twitter, Email) on the confirmation screen
social_share_messagestringMessage used when sharing. Supports {{social_share_account_title}} placeholder.
social_share_account_titlestringOrganization name displayed in share messages
social_share_urlstringURL shared on social media (e.g., your donation page)
twitter_hashtagsstringComma-separated hashtags for Twitter shares (e.g., "donate,giveback")

Redirect Options

PropertyTypeDescription
redirect_urlstringURL to redirect the donor to after a successful donation. When set, the confirmation screen is skipped.
redirect_with_payloadbooleanInclude the full donation data as a query parameter in the redirect URL
disable_confirmationbooleanSkip the confirmation screen entirely without redirecting

Redirect with Payload Example

When redirect_with_payload is true, the donor is redirected with the complete donation object appended as a query parameter. This includes the donation ID, amount, donor email, subscription details, and metadata.

"confirmation-config": {
  "redirect_url": "https://example.org/thank-you",
  "redirect_with_payload": true
}

Form Navigation

Configure multi-step form navigation to break the form into logical steps. Pass a JSON object with step definitions:

"form-navigation": {
  "steps": [
    {
      "label": "Amount",
      "sections": ["presets", "amount", "donorpaysfees", "recurringgroup"]
    },
    {
      "label": "Payment",
      "sections": ["paymentmethods"]
    },
    {
      "label": "Your Info",
      "sections": ["namegroup", "email", "phone", "addressgroup", "comment"]
    },
    {
      "label": "Review",
      "sections": ["summary", "submit"]
    }
  ]
}

Available Sections

SectionDescription
presetsPreset amount buttons
amountCustom amount input
donorpaysfeesDonor covers fees checkbox
recurringgroupRecurring frequency selector
paymentmethodsPayment method selection (card, ACH, PayPal, etc.)
authnameCard holder name
namegroupFirst and last name fields
emailEmail field
phonePhone number field
addressgroupStreet address fields
citygroupCity, state, zip fields
countrygroupCountry selector
billingzipBilling zip code only
commentComment / message field
onbehalfOn behalf of / tribute field
anonymousAnonymous donation checkbox
ecardE-card configuration
dtdDouble the Donation employer match
summaryDonation summary/review
submitSubmit / donate button

URL Parameter Prefill

You can pre-populate form values by appending query parameters to the donation page URL. This works on hosted Donately pages (pages.donately.com) and on any page where the form is embedded directly (HTTPS required).

There are two types of URL parameters:

  • Form Option — Sets a form configuration option (e.g., default amount, campaign, recurring frequency). Uses short parameter names like amount, campaign-id.
  • Field Prefill — Directly sets the value of a form input field after the form loads. Uses donately- prefixed parameter names that match the field element IDs (e.g., donately-first-name, donately-email).

Example

https://pages.donately.com/yourorg/form/frm_xxxx?campaign-id=cmp_7ce279325f9e&recurring-frequency=1.month&amount=55

Form Option Parameters

These parameters set form configuration options. Values are validated and only whitelisted parameters are accepted.

ParameterTypeDescriptionExample
amountForm OptionPre-set the donation amount (in dollars)amount=55
campaign-idForm OptionAttribute the donation to a specific campaigncampaign-id=cmp_7ce279325f9e
fundraiser-idForm OptionAttribute the donation to a specific fundraiserfundraiser-id=fun_xxxx
currencyForm OptionSet the currency (3-letter ISO code)currency=usd
recurring-frequencyForm OptionPre-select a recurring frequencyrecurring-frequency=1.month
presetsForm OptionSet preset donation amounts (comma-separated)presets=25,50,100,250
commentForm OptionShow or hide the comment fieldcomment=true
onbehalfofForm OptionShow or hide the "on behalf of" fieldonbehalfof=true
anonymousForm OptionShow or hide the anonymous checkboxanonymous=true
addressForm OptionShow or hide the address fieldsaddress=true
phoneForm OptionShow or hide the phone fieldphone=true

Field Prefill Parameters

These parameters directly set the value of form input fields after the form loads. Use the field's element ID as the parameter name.

ParameterTypeDescription
donately-amountField PrefillDonation amount input
donately-emailField PrefillEmail address
donately-first-nameField PrefillFirst name
donately-last-nameField PrefillLast name
donately-phone-numberField PrefillPhone number
donately-commentField PrefillComment / message
donately-anonymousField PrefillAnonymous checkbox (true / false)
donately-onbehalfField PrefillOn behalf of / tribute name
donately-street-addressField PrefillStreet address line 1
donately-street-address-2Field PrefillStreet address line 2
donately-cityField PrefillCity
donately-stateField PrefillState / Province
donately-zip-codeField PrefillZIP / Postal code
donately-countryField PrefillCountry
donately-donor-pays-feesField PrefillDonor pays fees checkbox (true / false)

Example: Multiple Parameters

https://pages.donately.com/yourorg/form/frm_xxxx?amount=100&recurring-frequency=1.month&campaign-id=cmp_xxxx&donately-email=jane@example.com&donately-first-name=Jane&donately-last-name=Doe
Tip: URL-encode special characters in parameter values. Spaces should be encoded as %20. Checkbox fields accept true or false as values.
Note: URL parameter prefill only works when the form is rendered directly on the page (HTTPS). Forms that fall back to iframe rendering (HTTP) do not support URL parameter prefill.
Tracking codes: Any URL parameters that are not recognized as form options are automatically stored as tracking codes on the donation. This is useful for attribution (e.g., ?utm_source=email&utm_campaign=spring2025).

Callbacks & Events

Callbacks are passed in the Donately.init() configuration:

CallbackDescription
afterFormLoadFires when the form has fully rendered and is ready
onSuccessFires after a successful donation. Receives the donation object.
onErrorFires on a donation error. Receives the error object.
afterNavigateHookFires after step navigation. Receives the current step number.

Example

Donately.init({
  selector: '#my-form',
  options: { ... },
  onSuccess: function(donation) {
    // Redirect to a thank-you page
    window.location.href = '/thank-you?amount=' + donation.amount_in_cents;
  },
  onError: function(error) {
    console.error('Donation failed:', error.message);
  }
});

3rd Party & Analytics

The form supports built-in tracking for Google Analytics and Facebook Pixel, as well as integrations with third-party services.

OptionDescription
google-analytics-idGoogle Analytics property ID (e.g., UA-XXXXX-X or G-XXXXX)
facebook-pixelFacebook Pixel ID for conversion tracking
double-the-donation-public-keyDouble the Donation public key for employer matching

Iframe Mode

When the form is embedded cross-domain or needs additional security isolation, it runs inside an iframe automatically. You can control iframe dimensions:

OptionDescription
iframe-heightCustom iframe height in pixels (default: auto-resize)
iframe-widthCustom iframe width (default: 100%)

The form automatically communicates resize events to the parent page so the iframe height adjusts to fit the content.

Additional Options

OptionTypeDescription
ecardJSONE-card configuration for tribute/memorial donations
tracking-codesJSONCustom tracking codes stored with the donation
Last updated: March 18, 2026