URL Parameters: Key-Value Pairs

We currently support four URL Parameters using Key-Value pairs, as well as other Key-Value pairs you're able to define.

With Key-Value pairs, one of the components is designated to be a “Key” and the other is designated to be the “Value” that are added to the end of your form link URL. Think of them like tokens in an email to personalize someones name, but in your URL. 

Using Key-Value pairs allows you to pass in information to a Donate2 form. You can use these values to make the Donation form more personalized. For example, you can autofill email address, first name, last name for the credit card or to dynamically set a donation request amount based on what you know about the donor in your CRM. The value needs to be populated from some database, such as your email system, CRM, or other platform. It's common for the value to be a token that will allow you to generate the values unique to each donor.

Lets say the default ask on your Donate2 form is 100 but you want to send the form to 1,000 of your "core" donors. You can use the Key-Value pairs to change what ask amount is displayed on the form, making it so that each donor will receive a personalized ask based on their relationship with you. One donor may be asked d2pa=250 another d2pa=1500 and so on. 

Example URL with URL Parameter Key-Value pairs:
https://donate2.app/xxxxxx?d2pa=250&d2fn=Stephen&d2ln=Lynch&d2em=stephen@lynch2.com
https://donate2.app/ = the base URL
xxxxxx = your Donate2 form ID
? = The start of the URL parameters placed just after the Donate2 form ID
d2pa” = Key
250” = Value (remember, this value has to come from somewhere!)
& = Indicates another Key-Value pair will follow
“d2fn” = Key
“Stephen” = Value (remember, this value has to come from somewhere!)
& = Indicates another Key-Value pair will follow
“d2ln” = Key
“Lynch” = Value  (remember, this value has to come from somewhere!)
& = Indicates another Key-Value pair will follow
d2em” = Key
stephen@lynch2.com” = Value  (remember, this value has to come from somewhere!)

The following are the four specific Key-Value pairs Donate2 supports. We have configured these Key-Value pairs to allow the fields within the form to be pre-filled if there is a value present.

Donate2 Personalized Ask (this could be used to pass in a subscription or membership amount or renewal amount)
d2pa=175 (where d2pa is the “Key” and 175 is the “Value”)
Using this would set a personalized ask amount of 175. If the Value 175 does not exist in your donation amount choices, it will be added and set as the default automatically.
Valid amounts are from 1 to 99,999

Donate2 Suggested Donation (use to to suggest a donation amount above and beyond their renewal)
d2psd=120 (where d2sd is the “Key” and 120 is the “Value”)
Using this would set a suggested donation amount of 120. This value will go into the Other amount field.
In order for this to work, Other amount must be set to YES and the Behavior drop down must be set to "In Addition"
Valid amounts are from 1 to 99,999

Donate2 First Name
d2fn=Stephen (where d2fn is the “Key” and Stephen is the “Value”)
Using this Key-Value pair would set the first name field on the credit card to autofill with “Stephen”

Donate2 Last Name
d2ln=Lynch (where d2ln is the “Key” and Lynch is the “Value”)
Using this Key-Value pair would set the last name field on the credit card to autofill with “Lynch”

Donate2 Email Address
d2em=Stephen@lynch2.com (where d2em is the “Key” and Stephen@lynch2.com is the “Value”)
Using this Key-Value pair would set the email address field on the credit card to autofill with “Stephen@lynch2.com”

Donate2 Donation Type
d2dt=monthly (where d2dt is the “Key” and Monthly is the “Value”)
Using this Key-Value pair would set the recurring frequency on the form will  select with “Monthly”

Custom URL Parameters
You are also able to pass in any URL Parameter Key-Value pairs that you define. These wont map to the form fields like the four we have built in. A custom URL Parameter Key-Value pair follows the same format as above where you have the key=value. This might look like WhateverYouWant=ValueYouWant. WhateverYouWant is the “Key” and ValueYouWant is the “Value”. state=Illinois and lastdonationamount=125 are two examples.

The sky is the limit with this! One thing to keep in mind, when you are including spaces, they will need to be encoded as %20 rather that an actual space in order for the URL to work.