You want people to give without leaving your site, or at least without feeling like they left. ActBlue gives you three ways to do that: a link to a hosted form, an embedded form, and a button that opens a donation modal.
Which one you use depends on what kind of organization you are and how much control you need. This guide walks through each, then covers refcodes, conversion tracking, and getting contributions into your CRM.
1. Check Whether You Can Embed
ActBlue only offers embeddable forms and buttons to federal campaigns, federal PACs, and 501(c)(3) and 501(c)(4) nonprofits. State and local campaigns can't embed. They link to a hosted form instead, which still works well with the URL parameters in the next section.
If you're not sure which entity type your account is, ask whoever manages ActBlue for your organization before you plan the page around an embed.
2. Link to a Hosted Form With URL Parameters
Every ActBlue contribution form lives at a URL like https://secure.actblue.com/donate/your-form. You can add parameters to that link to preset amounts, prefill donor details, and tag where the visit came from.
https://secure.actblue.com/donate/your-form?refcode=homepage_hero&amounts=10,25,50,100&amount=25
The parameters you'll use most:
refcodeandrefcode2tag the source. Refcodes show up on the form's Stats page.refcode2only appears in the exported spreadsheet.amountssets the button amounts.amountpreselects one. Leave out the dollar sign.firstname,lastname,email,zip,city,state, andphoneprefill the donor's details. Use the two-letter, capitalized state abbreviation.recurringandexpress_lanepreselect a recurring gift or an Express Lane amount. Both need ActBlue staff to turn them on for your account first.
ActBlue has a URL builder for this. Open the form in Contribution Forms, then choose More and Promote.
Give each placement its own refcode: nav_donate, footer, blog_sidebar, email_0412. Don't reuse a refcode for two placements on the same form, or you won't be able to tell them apart.
3. Embed a Form on the Page
For eligible accounts, an embedded form keeps the donor on your page.
- In the ActBlue dashboard, choose Create form, then Embed form.
- In the form editor, open the Embed Generator tab.
- Under Allowed URLs, list every domain that will show the form, separated by commas. They must be
httpsURLs. Add your staging domain too, or you won't be able to test it. - Publish the form, choose form as the embed type, and click Generate Embed.
The generated code has two parts. A script tag that loads once per page, in the <head>:
<script src="https://secure.actblue.com/cf/assets/actblue.js"></script>
And a <div> wherever the form should appear:
<div
data-ab-form
data-ab-token="YOUR_EMBED_TOKEN"
data-ab-amounts="1000,2500,5000,10000"
data-ab-refcode="homepage_embed"
></div>
Embedded form amounts are in cents, so 2500 is $25. You can also prefill donor details with data-ab-donor-email, data-ab-donor-firstname, and similar attributes, and point the form at your own stylesheet with data-ab-stylesheet-href.
A few limits to plan around:
- The form renders inside an iframe. Your site's CSS won't reach it, which is why
data-ab-stylesheet-hrefexists. - Embeds don't show titles, donation asks, goal thermometers, or branding. Put that content on your page around the form.
- Apple Pay isn't available in embeds.
- If the embed fails to load, ActBlue falls back to a backup form you set in Backup Form Settings. That backup doesn't support tracking or splitting donations between recipients.
If your site runs on WordPress, ActBlue's official ActBlue Contributions plugin adds "ActBlue Embed" and "ActBlue Buttons" blocks to the editor, so editors don't have to paste code.
4. Open a Donation Modal From Your Own Button
Sometimes you want your own button, styled like the rest of your site, that opens ActBlue in a modal. The actblue.js script exposes a small JavaScript API for this.
<button type="button" class="donate-button" data-amount="2500">Give $25</button>
<script>
document.querySelector('.donate-button').addEventListener('click', function (event) {
actblue.requestContribution({
token: 'YOUR_EMBED_TOKEN',
amount: Number(event.currentTarget.dataset.amount),
refcodes: { refcode: 'nav_button' },
})
.then(function (contribution) {
// The donor gave. contribution.amount is in cents.
})
.catch(function () {
// The donor closed the modal without giving.
});
});
</script>
requestContribution returns a promise. It resolves when the donor gives and rejects when they close the modal. It also accepts amounts, donor details, locale ('en' or 'es'), and callbacks like onContribute and onComplete.
If you'd rather not write JavaScript, ActBlue's Embed Generator can produce a button embed instead (<div data-ab-button>). Check the generated amounts carefully. ActBlue documents button amounts in dollars, while embedded forms use cents.
5. Track Conversions
Refcodes are your first layer of tracking and they work on every option above. For ad platforms and analytics, ActBlue supports Meta, X, Google Ads, and Google Analytics 4. You configure them in the dashboard under Settings and the Tracking tab, with separate codes for the landing page and the conversion page. Each form can use the global code, no code, or its own.
For embeds and modals, you can also send the conversion to your own analytics. The contribute event fires when the donor submits, before any upsell screens:
actblue.addEventHandler('contribute', function (contribution) {
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'actblue_contribution',
value: contribution.amount / 100,
recurring: contribution.recurring,
refcode: contribution.refcode,
});
});
Two gaps to know about. Recurring installments after the first gift don't fire any tracking. Donors who don't finish don't fire it either. Your ActBlue reports will always show more than your ad dashboards, and that's expected.
6. Get Contributions Into Your CRM
A donation that never reaches your CRM can't be thanked, segmented, or asked again. ActBlue has two ways to move the data.
Webhooks. In the dashboard, open the Integrations tab under Tools, then Webhooks, and create a new webhook. There are self-serve integrations for tools like Action Network, ActionKit, NationBuilder, and NGP VAN, plus ActBlue's default format and an OSDI format for anything custom. Webhooks cover contributions, refunds, and recurring cancellations, and you can request a backfill of past donations when you set one up.
The CSV API. Under Settings, the API Credentials tab issues a client ID and secret. Use these to pull contribution reports on a schedule, which suits a data warehouse or a nightly sync better than a live webhook.
If your list lives in Action Network, the Action Network API guide covers what happens on that side. If it lives in EveryAction, see connecting your website to EveryAction and NGP VAN.
Which Option Should You Use?
- Link with refcodes if you're a state or local campaign, or you want the fastest setup.
- Embedded form on a dedicated donate page where the form is the point of the page.
- Modal from your own button in the header, on event pages, and anywhere a full form would crowd the content.
Most organizations end up using all three. The work is in keeping refcodes consistent and making sure every gift lands in the right place afterward.
The same thinking applies to your other forms. If you also use Action Network for signups, our guide to integrating Action Network forms covers the design side, and styling EveryAction forms covers EveryAction.
Want Help Wiring It Up?
We build donation pages and the integrations behind them for nonprofits and campaigns, from refcode plans to the webhook that puts each gift in your CRM. Tell us what you're trying to do.




