Campaign Attribution for Embedded Donation Forms
When your website uses Google Tag Manager (GTM) and Google Analytics 4 (GA4), Google Analytics can show an embedded donation form as a separate session from the webpage that hosts it, with a different Client ID and Session ID, because the form runs in its own frame. Blackbaud can't change these IDs.
To keep campaign attribution consistent, add the Blackbaud attribution script to your website. Donations then report the same source and medium as the visit that brought the donor to your website.
How the Attribution Script Works
On each webpage, the script checks for UTM parameters, paid click IDs, and the referring website. It saves the source, medium, campaign, term, and content in a first-party cookie named bb_attribution that expires 30 minutes after the donor's last page view. Attribution isn't saved for donors who block cookies on your website.
When a donor opens an embedded donation form, Blackbaud adds the saved values to the form as UTM parameters, so Google Analytics events from the form include them. UTM parameters already in your webpage's URL take precedence over the cookie.
Important: The script doesn't replace Google Analytics cross-domain measurement, which doesn't work for embedded donation forms. Keep using cross-domain measurement if you already do.
Prerequisites
Connect donation forms to Google Analytics and Google Tag Manager.
Add the Script with Google Tag Manager
We recommend that you add the script as a custom HTML tag in the Google Tag Manager container for your website.
Important: To preserve donor source information, add the script to every page on your website, not only pages that contain an embedded donation form.
-
From Google Tag Manager, open your website's container and create a new tag.
-
For the tag type, select Custom HTML.
-
Enter the following script:
<script src="https://sky.blackbaudcdn.net/static/donation-form-ga-attribution/1/main.js"></script> -
For the trigger, select All Pages.
-
Select Save, and then publish the container.
Add the Script Without Google Tag Manager
You can also add the script through your content management system, such as WordPress. Place it in the <head> or as close to the start of the <body> as possible on every page.