Log in to Google Analytics (https://analytics.google.com/analytics/web/) and navigate to the GA4 account with which you want to track the donations.
Click on Admin in the left-hand menu.
Go to Data Streams, and click on the stream under the Web tab.
(If there are no streams under the Web tab, create one by selecting Add stream > Web.)
Click on "View tag instructions"
Choose "Install manually", and copy the Google tag script
Go to the Donorbox campaign editor for which you wish to enable Google Analytics Tracking.
Click on the "Tracking & Analytics" link
Paste the script in the "Analytics tracking codes" field which was copied in step 5. Set the cookie_flags property in the config line as highlighted below.
Click Update. Your campaign form is now enabled for tracking donations in your GA4 account.
Cross-domain tracking with GA4
If you want to set up cross-domain tracking for your donation forms with GA4, please refer to our guide here.
To verify that the analytics tracking code is installed correctly:
1. Go to https://tagassistant.google.com/
2. Click on "Add domain"
3. Enter the URL of your donation form or the page on your website where the donation form is embedded
4. Click "Connect". This will open the URL in another tab and the tag assistant starts recording the events triggered from that page.
5. Click "Continue" in the tag assistant window.
6. Based on the actions you perform in the donation form, you should see eCommerce hits being tracked in the tag assistant window as shown below.