TeamRaiser - Building a new url based on the donation form URL parameters
Options
Hi all,
Convoluted question here, so I'll try my best to explain what I am trying to do...
Some background - Here at the foundation, we do not receipt gifts from Organizations, we give them "Business Acknowledgement Letters". Because of this, we have to always have 2 of every donation campaign form; one for orgs, one for Individuals.
In TeamRaiser, for an event, you can only attach one donation form to a TeamRaiser Event, but I need to be able to dynamically create a URL on the attached donation form (which is set up for individual donations) so that if the donor is donating on behalf of a business, they can click a link at the top which points to the org form, but with the required url parameters needed to ensure that the donation is directed to the correct proxy_type, proxy_id and fr_id.
Has anyone done anything like this before? Not sure if I'm even being clear.
Thanks,
ali
Convoluted question here, so I'll try my best to explain what I am trying to do...
Some background - Here at the foundation, we do not receipt gifts from Organizations, we give them "Business Acknowledgement Letters". Because of this, we have to always have 2 of every donation campaign form; one for orgs, one for Individuals.
In TeamRaiser, for an event, you can only attach one donation form to a TeamRaiser Event, but I need to be able to dynamically create a URL on the attached donation form (which is set up for individual donations) so that if the donor is donating on behalf of a business, they can click a link at the top which points to the org form, but with the required url parameters needed to ensure that the donation is directed to the correct proxy_type, proxy_id and fr_id.
Has anyone done anything like this before? Not sure if I'm even being clear.
Thanks,
ali
Tagged:
0
Comments
-
As long as you pass the FR_ID, PROXY_TYPE, and PROXY_ID to the second donation form, it'll work, even though the form isn't the one associated with the TeamRaiser.2
-
But I don't know how to get that information out. I've found some jQuery snippets but I can't seem to pull that information from the linked url form in order to build out the string correctly.
0 -
NM, I got it! Just had to add some jquery and build it out on the fly.
Once I've tested I can share in case anyone else is interested.0 -
I'm pretty sure the proxy_type is always 20 and the proxy_id is the ID of the event, team or participant that gets the credit, so you should be able to build the url with S-Tags.
Edit: and if this link appears on the regular donation form, there's an s-tag (S334) to pull query string params.
https://secure#.convio.net/ABC/site/Donation2?df_id=12345&FR_ID=[[S334:FR_ID]]&mfc_pref=T&PROXY_ID=[[S334:PROXY_ID]]&PROXY_TYPE=20&[[S334:FR_ID]].donation=form10 -
The proxy_type changes depending on if its a participant, team or directly to the event
20 is participant
21 is event
22 is team
I didn't even consider using s-tags, I'm now annoyed with myself...3 -
Actually, jQuery is the right solution. Using S334 for this sort of thing to pull information out of the URL is unreliable, since there are a number of cases when the URL changes to drop all query strings (e.g. when an error is encountered on submit).3
-
Ugh, right. I hate that. But where would jQuery get these values if not from the QString?
What about sticking them in a session variable, and then build the URL from that, or just store the whole URL? Something like...
[[? x[[S334:FR_ID]]x:: xx :: :: [[U0:altUrl=https://secure#.convio.net/ABC/site/Donation2?df_id=12345&FR_ID=[[S334:FR_ID]]&mfc_pref=T&PROXY_ID=[[S334:PROXY_ID]]&PROXY_TYPE=20&[[S334:FR_ID]].donation=form1]]
/ Not sure about that U0 tag and all the = signs in the full url.0 -
But where would jQuery get these values if not from the QString?
Hidden inputs. Dumb me.
<input type="hidden" name="df_id" id="df_id" value="11041" />
<input type="hidden" name="FR_ID" id="FR_ID" value="1620" />
<input type="hidden" name="mfc_pref" id="mfc_pref" value="T" />
<input type="hidden" name="PROXY_ID" id="PROXY_ID" value="1620" />
<input type="hidden" name="PROXY_TYPE" id="PROXY_TYPE" value="21" />1 -
I "borrowed" the function. Then called the function to build the url, and then finally dropped into a div tag.
I don't know if this is "correct" from a web standard perspective, but it works...I should probably add something in the function to account for null values, but I didn't
<script type="text/javascript">// <![CDATA[
jQuery(document).ready(function ($) {
//parse url to get the paramters
function getParameterByName(name) {
var match = RegExp('[?&]' + name + '=([^&]*)')
.exec(window.location.search);
return match && decodeURIComponent(match[1].replace(/\\+/g, ' '));
}
//build out the url by calling the getParamterByName function to fill in the needed bits. (note, if you use this
//elsewhere or to another form, you have to update the df_id manually...
var orgURL = '<a href="https://secure2.convio.net/srhcf/site/Donation2?df_id=2363&mfc_pref=T&2363.donation=form1&PROXY_ID=' + (getParameterByName('PROXY_ID')) +'&PROXY_TYPE='+(getParameterByName('PROXY_TYPE'))+ '&FR_ID='+(getParameterByName('FR_ID'))+'">Click here to make this donation on behalf of an Organization</a>';
//put the new url where you want it (see next HTML caption area)
document.getElementById('OrgURL').innerHTML=orgURL;
})
// ]]></script>0 -
This solution is using the querystring variables, just like my S-Tag idea did. But as Noah pointed out, if there is a validation error the page will postback and all those variables in the URL disappear - and your url will be broken.
However, the donation form itself has those values stored in hidden inputs. You can safely grab those instead.
var orgFormId = '2363';
var orgURL =
'<a href="https://secure2.convio.net/srhcf/site/Donation2' +
'?df_id=' + orgFormId +
'&mfc_pref='+ $('#mfc_pref').value() +
'&' + orgFormId + '.donation=form1' +
'&PROXY_ID=' + $('#PROXY_ID').value() +
'&PROXY_TYPE=' + $('#PROXY_TYPE').value() +
'&FR_ID=' + $('#FR_ID').value() +
'">Click here to make this donation on behalf of an Organization</a>';
0 -
Thanks, I'll update it now. This will also make it easier moving forward if someone else has to take over the maintenance of these pages.
Ali0 -
Anyone know if there's an S-Tag that would return the current form's df_id? I'm thinking about the canonical tag here, where JS isn't going to work.
EDIT2: Just found something that could be promising! I didn't realize that there's an [[S42:0:form-ID]], so there's half the equation. For the org ID, we could do something like [[?xx::x[[S334:df_id]]x::::[[U0:dfID=[[S334:df_id]]]]]] to capture the ID for situations where the form is submitted in error. Could even add some JS to rewrite the URL (for cases where the user submits the form in error, then copies the URL and sends it to someone, such as calling us because they couldn't figure out the problem).
Would that make it reliable enough to grab the ID without resorting to JS, or are there still other situations where the form would load the first time without the right URL variable?
One other thought; if it's already known which donation forms go with which teamraiser, you could do set up a reusable that basically makes a pseudo-table matching different df_ids to fr_ids. Something like...
[[U0:corpFRID=[[E130: [[S80:trID]]
1234 5678 replaceall
2345 6789 replaceall
3456 7890 replaceall
]]
[[?x[[U80:corpFRID]]x::x[[S80:trID]]x::[[E42:[[S80:trID]]:form-ID]]::]]
...where the first number is the trID and the second is the corporate form's ID.
It'll grep through the table and return whatever matches. If no match exists, that second statement will set the form to the event ID as a fallback (or you could make it anything you want). Also assuming in those that you've captured the teamraiser ID into a trID variable. If not, you'd swap those out with [[S42:0:fr-id]].0 -
Hi Jeremy,
Nice tinkering, but I think the Javascript approach (those steps discussed above) would be a much stable approach compared to S-tag, due to- truncated URL behavior on LO Donation form esp. when one did not fill up the form completely and the form ask you to rectify the thing at which points the page seems to refresh itself no longer without the DF_ID on the URL parameter -- rendering the S334 unusable
- What if a donation is not a teamraiser based donation in which the S42:0 won't be applicable.
- Now with session variable storing through that U0, that is a step forward; however there is another loophole that potentially could mess that thing which is "what if someone opens up different donation forms as new tabs within a single browser where those forms happen to have that same session variable storing mechanism" -- that would turn into value override to whatever donation form opens up last.
- We got to remember that Javascript is a client-end while S-tag is server-side when it comes to writing/rewriting values or communicating back-and-forth (i.e JS can't dynamically re-assign S-tag session variable initial values post page load)
2 -
Good timing on the questoin and the proposed solution seems to have worked for me!
Thansk for all your help my Luminate Peoples!0 -
Hi all,
Just wanted to say that I had to make a small change to Brians code to get it to work for me.
I had to change the .value to .val
Thanks!
ali1
Categories
- All Categories
- Shannon parent
- shannon 2
- shannon 1
- 21 Advocacy DC Users Group
- 14 BBCRM PAG Discussions
- 89 High Education Program Advisory Group (HE PAG)
- 28 Luminate CRM DC Users Group
- 8 DC Luminate CRM Users Group
- Luminate PAG
- 5.9K Blackbaud Altru®
- 58 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 409 bbcon®
- 2.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- donorCentrics®
- 1.1K Blackbaud eTapestry®
- 2.8K Blackbaud Financial Edge NXT®
- 1.1K Blackbaud Grantmaking™
- 527 Education Management Solutions for Higher Education
- 1 JustGiving® from Blackbaud®
- 4.6K Education Management Solutions for K-12 Schools
- Blackbaud Luminate Online & Blackbaud TeamRaiser
- 16.4K Blackbaud Raiser's Edge NXT®
- 4.1K SKY Developer
- 547 ResearchPoint™
- 151 Blackbaud Tuition Management™
- 1 YourCause® from Blackbaud®
- 61 everydayhero
- 3 Campaign Ideas
- 58 General Discussion
- 115 Blackbaud ID
- 87 K-12 Blackbaud ID
- 6 Admin Console
- 949 Organizational Best Practices
- 353 The Tap (Just for Fun)
- 235 Blackbaud Community Feedback Forum
- 55 Admissions Event Management EAP
- 18 MobilePay Terminal + BBID Canada EAP
- 36 EAP for New Email Campaigns Experience in Blackbaud Luminate Online®
- 109 EAP for 360 Student Profile in Blackbaud Student Information System
- 41 EAP for Assessment Builder in Blackbaud Learning Management System™
- 9 Technical Preview for SKY API for Blackbaud CRM™ and Blackbaud Altru®
- 55 Community Advisory Group
- 46 Blackbaud Community Ideas
- 26 Blackbaud Community Challenges
- 7 Security Testing Forum
- 1.1K ARCHIVED FORUMS | Inactive and/or Completed EAPs
- 3 Blackbaud Staff Discussions
- 7.7K ARCHIVED FORUM CATEGORY [ID 304]
- 1 Blackbaud Partners Discussions
- 1 Blackbaud Giving Search™
- 35 EAP Student Assignment Details and Assignment Center
- 39 EAP Core - Roles and Tasks
- 59 Blackbaud Community All-Stars Discussions
- 20 Blackbaud Raiser's Edge NXT® Online Giving EAP
- Diocesan Blackbaud Raiser’s Edge NXT® User’s Group
- 2 Blackbaud Consultant’s Community
- 43 End of Term Grade Entry EAP
- 92 EAP for Query in Blackbaud Raiser's Edge NXT®
- 38 Standard Reports for Blackbaud Raiser's Edge NXT® EAP
- 12 Payments Assistant for Blackbaud Financial Edge NXT® EAP
- 6 Ask an All Star (Austen Brown)
- 8 Ask an All-Star Alex Wong (Blackbaud Raiser's Edge NXT®)
- 1 Ask an All-Star Alex Wong (Blackbaud Financial Edge NXT®)
- 6 Ask an All-Star (Christine Robertson)
- 21 Ask an Expert (Anthony Gallo)
- Blackbaud Francophone Group
- 22 Ask an Expert (David Springer)
- 4 Raiser's Edge NXT PowerUp Challenge #1 (Query)
- 6 Ask an All-Star Sunshine Reinken Watson and Carlene Johnson
- 4 Raiser's Edge NXT PowerUp Challenge: Events
- 14 Ask an All-Star (Elizabeth Johnson)
- 7 Ask an Expert (Stephen Churchill)
- 2025 ARCHIVED FORUM POSTS
- 322 ARCHIVED | Financial Edge® Tips and Tricks
- 164 ARCHIVED | Raiser's Edge® Blog
- 300 ARCHIVED | Raiser's Edge® Blog
- 441 ARCHIVED | Blackbaud Altru® Tips and Tricks
- 66 ARCHIVED | Blackbaud NetCommunity™ Blog
- 211 ARCHIVED | Blackbaud Target Analytics® Tips and Tricks
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- Luminate CRM DC Users Group
- 225 ARCHIVED | Blackbaud eTapestry® Tips and Tricks
- 1 Blackbaud eTapestry® Know How Blog
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)
- 1 Blackbaud K-12 Education Solutions™ Blog
- 280 ARCHIVED | Mixed Community Announcements
- 3 ARCHIVED | Blackbaud Corporations™ & Blackbaud Foundations™ Hosting Status
- 1 npEngage
- 24 ARCHIVED | K-12 Announcements
- 15 ARCHIVED | FIMS Host*Net Hosting Status
- 23 ARCHIVED | Blackbaud Outcomes & Online Applications (IGAM) Hosting Status
- 22 ARCHIVED | Blackbaud DonorCentral Hosting Status
- 14 ARCHIVED | Blackbaud Grantmaking™ UK Hosting Status
- 117 ARCHIVED | Blackbaud CRM™ and Blackbaud Internet Solutions™ Announcements
- 50 Blackbaud NetCommunity™ Blog
- 169 ARCHIVED | Blackbaud Grantmaking™ Tips and Tricks
- Advocacy DC Users Group
- 718 Community News
- Blackbaud Altru® Hosting Status
- 104 ARCHIVED | Member Spotlight
- 145 ARCHIVED | Hosting Blog
- 149 JustGiving® from Blackbaud® Blog
- 97 ARCHIVED | bbcon® Blogs
- 19 ARCHIVED | Blackbaud Luminate CRM™ Announcements
- 161 Luminate Advocacy News
- 187 Organizational Best Practices Blog
- 67 everydayhero Blog
- 52 Blackbaud SKY® Reporting Announcements
- 17 ARCHIVED | Blackbaud SKY® Reporting for K-12 Announcements
- 3 Luminate Online Product Advisory Group (LO PAG)
- 81 ARCHIVED | JustGiving® from Blackbaud® Tips and Tricks
- 1 ARCHIVED | K-12 Conference Blog
- Blackbaud Church Management™ Announcements
- ARCHIVED | Blackbaud Award Management™ and Blackbaud Stewardship Management™ Announcements
- 1 Blackbaud Peer-to-Peer Fundraising™, Powered by JustGiving® Blogs
- 39 Tips, Tricks, and Timesavers!
- 56 Blackbaud Church Management™ Resources
- 154 Blackbaud Church Management™ Announcements
- 1 ARCHIVED | Blackbaud Church Management™ Tips and Tricks
- 11 ARCHIVED | Blackbaud Higher Education Solutions™ Announcements
- 7 ARCHIVED | Blackbaud Guided Fundraising™ Blog
- 2 Blackbaud Fundraiser Performance Management™ Blog
- 9 Foundations Events and Content
- 14 ARCHIVED | Blog Posts
- 2 ARCHIVED | Blackbaud FIMS™ Announcement and Tips
- 59 Blackbaud Partner Announcements
- 10 ARCHIVED | Blackbaud Impact Edge™ EAP Blogs
- 1 Community Help Blogs
- Diocesan Blackbaud Raiser’s Edge NXT® Users' Group
- Blackbaud Consultant’s Community
- Blackbaud Francophone Group
- 1 BLOG ARCHIVE CATEGORY
- Blackbaud Community™ Discussions
- 8.3K Blackbaud Luminate Online® & Blackbaud TeamRaiser® Discussions
- 5.7K Jobs Board