Usage
The page builder allows for custom javascript in two ways; for the Landing Page and separately for the Thank You Page. Both sections support tokens which can be replaced with donor information during the donation process.
This is a very powerful feature which allows you to have full, granular control over the function and features of the Landing Page and Thank You Page.
Custom Javascript should be used for a specific page and that page only. If you find you are making the same Javascript updates to multiple pages (or all pages) - you should consider using the Global Javascript feature.
Configure
Navigate to the Page Builder, select any page and then click on the Design tab.
The first text box allows you to insert custom javascript on the main donation page, where the donor fills in their information. Common situations here are pixel tracking, analytics (we have a custom integration for Google Analytics), behavior monitoring, etc. You need to include the appropriate script tags (ie: <script type='text/javascript'>) and the script will be inserted just before the closing </body> tag.
The second text box is for the thank you page that is only applicable for a successful donation. It's most commonly used to notify external systems of a successful donation. We do have merge-tags that you can leverage, allowing you to insert real data from the donation into your javascript methods. You need to include the appropriate script tags (ie: <script type='text/javascript'>) and the script will be inserted just before the closing </body> tag.
Here are some of the tokens we provide for each script section.
For reference, an example might look like this:
All custom javascript is placed at the end of the HTML page before the closing 'body' tag. Custom javascript for the page builder is placed AFTER the custom Global javascript.
Global Javascript
In addition to providing Custom Javascript in the page builder you can also provide Global Javascript that will be applied to every page. It is OK to have scripts in both the Global and Page Builder locations - so long as they do not conflict with each other.
You can access the Global Javascript settings by navigating to the admin area of RaiseDonors and clicking on Pages & Notifications -> Page Options -> Global Javascript & CSS.
Global Javascript does not apply to the donor portal at this time.