Google Tag Manager integration for Checkout modal
Read about how Checkout modal integrates with Google Tag Manager.
Overview
Integrating Google Tag Manager (GTM) into your Checkout modal simplifies tag management for marketing and analytics, providing valuable insights for campaign optimization. It allows you to easily track user interactions without having to change the code of your website.
Prerequisites
Before setting up GTM integration, make sure you have the following:
- Administrative access to your organization's GTM account.
- GTM installed on your website. See Google's documentation for installation instructions.
Quick start for Google Analytics and Meta Pixel
For the most popular tools, we have two pre-built templates for GTM: one for integration with Google Analytics and one for integration with Meta Pixel. These templates include all the triggers and variables supported by Fundraise Up. We recommend that you import the appropriate template container and merge it with your existing container using the instructions below.
How to import and merge a template
- Log in to Google Tag Manager.
- Go to the Admin section in the upper left corner of the screen.
- Select Import Container.
- Select Choose Container file and upload the JSON template file that you’ve downloaded.
- Select the Existing option to import the template file to your existing container.
- Select Merge as your import option.
- Select Rename conflicting tags, triggers, and variables.Ensure that you select the Merge option before continuing. Selecting the Overwrite option will replace your existing configuration with the template’s settings.
Our template contains the Fundraise Up Google tag, which is a general GA4 (Google Analytics 4) tag. If you already use a GA4 tag under a different name, please delete the Fundraise Up Google tag from the Tags tab to avoid duplicating data. - On the import preview screen, select Confirm to finish importing the template file.
The import is now complete and you can use the new triggers and variables with your tags. For configuration instructions, please refer to the following guides:
Set up GTM manually
If you want to use a different analytics tool or set up GTM manually, you can configure the GTM triggers, variables, and tags yourself.
Step 1. Configure GTM’s triggers
Fundraise Up pushes events to Google Tag Manager based on user interactions. For the Checkout modal, we push three events: checkoutOpen, checkoutClose, and donationComplete. This page describes the behavior of these events and sample payloads for each.
To effectively track these events, you should create triggers in GTM:
- Navigate to Triggers: Within your GTM dashboard, click “New” to create a new trigger and select the “Custom Event” type.
- Configure the event: Assign the trigger to listen for events such as
checkoutOpen,donationComplete, orcheckoutClose. To do this, set the “Event name”. For example, useFundraiseUp.donationCompletefor thedonationCompleteevent, orFundraiseUp.checkoutOpenfor thecheckoutOpenevent.To ensure that events can be attributed to specific campaigns, include variables such as
Campaign IDin your trigger conditions. - Save your trigger: Clearly name your trigger for easy identification later on and save it.
Step 2. Configure GTM’s variables (optional)
Configuring additional variables in GTM is optional but useful if you want to track extra data from Fundraise Up events. Variables dynamically populate tags and triggers with values, giving you more detailed insights into supporter interactions.
- In GTM, go to Variables and click New.
- Select Data Layer Variable as the type.
- Enter the Data Layer Variable Name for the data you want to track. Fundraise Up sends multiple values that can be tracked, including:
FundraiseUp.customFields.name_of_the_custom_fieldfor custom fieldsFundraiseUp.campaign.idfor campaign IDsFundraiseUp.donation.amountfor donation amountsFundraiseUp.supporter.idfor supporter IDs
For a full list of available variables and event parameters, see the Fundraise Up parameters guide.
- Give the variable a descriptive name, such as Fundraise Up Campaign ID, and save it.
The variables you create in this step must be included in the relevant tags to be sent with events. See Step 3 for instructions.
Step 4. Test and publish
Before making your GTM container live, it's essential to test the configurations:
- Preview mode: Enable Preview mode in GTM to test your tags, triggers, and variables.
- Verify tags fire correctly: Navigate through your Checkout modal and perform actions that should trigger your tags. Verify that the tags fire as expected.
- Publish: Once you are satisfied with the setup and have verified that everything is working as intended, publish your GTM container changes.
Integrate GTM with Campaign Pages
Integrating Google Tag Manager with your Campaign Pages involves different steps. For more information, please see the dedicated guide.