Funraise Giving Form embed code provides an infrastructure for dynamic and scalable donation experiences across your entire site. The unique elements of the form code make that possible.
1 | Funraise Aware Code
The Funraise Aware Code enables Funraise features on your website. Place this in the <head></head> of your pages. Only load this code once on a page.
2 | Form Configuration Code
The Form Configuration Code creates or configures a particular form on a page. Place this in the <head></head> of the page below the Funraise Aware Code. You can add JS configs to the Form Configuration Code to prefill or default items for a particular form instance.
3 | Button Code
A form can be launched with an HTML button. Place this in your page <body></body> where you want the button to appear. You can add attributes to a button to open the form with prefills or defaulted items. You can edit the inline styles of the default button or use your own buttons. Add data-formId="xxxx" to a button to target a particular form.
You can also place a form open on your page; we’ll cover this option below.
Example Form Embed
This complete example follows the steps above for best practices when embedding a form on your page. This form uses the button launcher.
If you're inserting the form into your page layout (and not using an overlay method), the form has no alignment styles. You can align the form by targeting the element inside the placed form container <div></div>. The example below shows a centered placed form.
Much of this documentation details further configurations for your forms. Because there are many ways to configure your forms, the hierarchy of how each level of configuration is applied is important. Configurations at a lower level will not override those at a higher level (1 overrides all, 2 overrides 3 and 4, etc.) Configurations are applied in the following order:
HTML button attributes
Form settings in platform
HTML Button Attributes
Launch a form with custom prefills and defaults using HTML button data attributes. For example, you might want to open the same form with two buttons: donate now and donate monthly. This is easy to accomplish with the frequency attribute.
Default the Allocation by adding data-allocation=“xxxx” to your launch button. Use the Allocation Id for the value. To default an Allocation, the Allocation must be added to the form in platform.
Default the frequency by adding data-frequency=“x” to your launch button. Use o, w, m, q, and y for one-time, weekly, monthly, quarterly, and yearly. To default a frequency selection, the frequency must be added to the form in platform.
Default the payment method by adding data-paymentmethod=“xxxx” to your launch button. Available options include: card, check, paypal, bitcoin. To default a payment method, the payment method must be added to the form in platform.
Add transaction tags to a form with data-tags=“xxxx” in your launch button. Tags added through a button are in addition to tags set in platform.
Launch the form with specific tickets and quantities selected by adding data-tickets=“xxxx|1,xxxx|2” to your launch button. The format for this attribute is “ticket id|quantity,ticket id|quantity,…” To default a Ticket selection, the Ticket must be added to the form in platform.
Good to Know
These examples are using a button launcher to open the form, but you can also use JS configs for a placed form.
Default the Allocation by adding allocation:xxxx to your form config code. Use the Allocation Id for the value. To default an Allocation, the Allocation must be added to the form in platform.
By default, your form uses your platform currency. You can override the default currency or add multiple currencies to your forms. You can also configure the ask string and Operations Tip amount for each currency.
Default the frequency by adding frequency:'x' to your form config code. Use o, w, m, q, and y for one-time, weekly, monthly, quarterly, and yearly. To default a frequency selection, the frequency must be added to the form in platform.
By default, the native Giving Form on a Campaign Site adds Transactions to the appropriate goal progress bars on your site. You can additionally configure any form to impact a site’s progress bar by assigning a Page Id to the form.
Default the payment method by adding data-paymentmethod:'xxxx' to your form config code. Available options include: card, check, paypal, bitcoin. To default a payment method, the payment method must be added to the form in platform.
Default the Transaction tags captured with a Transaction by adding tags:'x' to your config code. Tags added through the config code are in addition to any tags added to the form in platform.
Default the form with specific tickets and quantities selected by adding tickets:'xxxx|1,xxxx|2' to your form config code. The format for this attribute is 'ticket id|quantity,ticket id|quantity,…' To default a Ticket selection, the Ticket must be added to the form in platform.
You can limit the quantity of a particular Ticket that can be purchased with a single Transaction. For example, you might have 10 sponsorship tickets, but you only want to allow one sponsorship ticket to be purchased at a time. Please note: The purpose of this configuration is to limit quantity PER transaction. The overall number of Tickets available is set in platform.
Use Event Handlers, onSetup, onInfo, onSuccess, and onFailure to run custom functions or pass data to other systems. Pass donor and donation properties into your custom functions as arguments, based on the stage of the donation process.
As you’ve probably figured out, PayPal is special. To transact recurring donations with PayPal through the Funraise Giving Form, you’ll need to update configurations to the form code and within your PayPal account.
Enable all API permissions
This step assumes you’ve already implemented PayPal as a payment option
Log in to your PayPal Business Account and find API access settings
Enable ALL permissions for nathaniel_api1.spreedly.com (Yes, every single box needs to be checked.)
Next, contact PayPal support
Click 'Help' in the top navigation bar
Scroll down and select 'Contact Us'
Choose topic: Business solutions
Choose sub-topic: PayPal payment solutions
Choose sub-topic: PayPal Express Checkout
Scroll down and select 'Chat With Us'
When you’re in contact with a PayPal representative: Ask them to enable reference transactions for the account. At this point, PayPal will begin asking a lot of questions. Be sure a team member who has access to answer very detailed questions is available 👍
Funraise Form configuration
After your PayPal account has been configured, you can activate recurring for PayPal with a single configuration line in the form code.
With Event Handlers, you can redirect the donor to a new page after a successful donation. This can be used for a special "Thank You" page or for analytics tracking. Please keep in mind, as with all custom implementations, this is only an example and not all browsers will treat this the same way. Be sure to fully test your unique solution.
PayPal and Bitcoin transactions can not be redirected with this configuration. Because these payment methods conduct processing offsite, a redirection with onSuccess will cause transactions to fail. In the example below, we've applied a redirection rule to all payment methods except PayPal and Bitcoin.
You can add a redirection link for a PayPal transaction from within the Giving Form editor.
You can default form values with URL parameters. Add one or many parameters to the end of your URL to configure form defaults. To default allocation, frequency, payment method or tickets, the item must be added to the form in platform.