1. Help Center
  2. Analytics and Reports
  3. Google Analytics and Tag Manager

Managing Fundraise Up on SPA websites

Single Page Applications can sometimes be tricky. Here are some tips on how to best use Fundraise Up with SPAs.

If your website is a Single Page Application and uses #fragment for navigation, the Fundraise Up installation code must be installed on webpage directly, rather than using Google Tag Manager to load the Fundraise Up installation code.

Why can this be problematic?

Fundraise Up uses #fragment to open the campaign checkout flow.

Website uses #fragment for navigation options (anchors).

Suppose a user visits your website https://website.org/**#donate**, where #donate is the custom hash for Fundraise Up Checkout. The browser starts loading all javascript defined on the webpage.

  • If it loads Fundraise Up library first — all good. Our library detects #donate in URL and opens Checkout.
  • If it loads your website scripts first, they detects there is no "#donate" anchor or part of the webpage and just removes the fragment from URL. Once Fundraise Up library will be loaded, it won't find any #fragment in URL and won't open the Checkout.

Solution

When the Fundraise Up library is installed directly on the webpage, it reserves all #fragment internally before it can be changed by website scripts. Once the library is loaded, it will use reserved #fragment instead existing value in any URLs.

This will not slow down your website and allows everything to work correctly, and co-exist. correctly.

Why Google Tag Manager is not a solution?

GTM script loads asynchronously after scripts of your website. Once the Fundraise Up library is loaded on page, it is already too late - your website scripts already delete fragments from the URL.

In the case your website may change #fragment, the Fundraise Up library should be installed on page directly in <head> section.