Analytics
Google Tag Manager (GTM DataLayer Setup)
4Site's ENgrid automatically takes all of the available data from your Engaging Networks pages and pushes it to Google Tag Manager's as GTM Custom Events and GTM Custom Variables. In order to take advantage of this data and use it in your reporting in Google Analytics, Google Ads, Meta, and more, you'll need to create a set of variables, triggers, and tags in your Google Tag Manager (GTM) container that will capture the data when a user lands on and interacts with your page.
When your Engaging Networks page loads on a user's screen, it pushes the entire Engaging Networks pageJson
into the DataLayer as GTM Custom Events and GTM Custom Variables. This allows you to see details like donation amount, donation frequency, currency, and more in GTM, GA4, Meta, and other analytics platforms you might use.
Key Benefits:
- Automatic Data Pushing: ENgrid automatically pushes all available data from Engaging Networks pages to the Data Layer
- Comprehensive Tracking: Capture donation amounts, supporter ID's, transaction IDs, and more
- Multi-Platform Support: Use data in Google Analytics, Google Ads, Meta, and other analytics platforms
This guide walks you through all of the variables, triggers, and tags you'll need to set up in GTM if you're using ENgrid.
Prerequisites
Before setting up GTM with ENgrid, ensure you have:
- ENgrid Enabled: Your Engaging Networks pages must be using ENgrid
- Transaction Details Exposed: In your Engaging Networks Account Settings > Account Preferences, check the box to "Expose transaction details" to enable the
pageJson
object - GTM Container: Access to your Google Tag Manager container
- Meta Pixel ID (if using Meta ads): Your Facebook/Meta Pixel ID for conversion tracking
- GA4 Configuration (if using Google Analytics): Your GA4 Measurement ID
Google Tag Manager Setup for EN Variables, Triggers & Tags
Naming Conventions Best Practices:
In your Google Tag Manager account:
- Ensure all variables you create start with
"EN"
- Ensure all triggers you create start with
"EN"
- Ensure the tags you will set up are descriptive of their functions, so something like:
- Meta Pixel (if you're using Meta ads in your marketing)
- Meta - Conversion - EN Successful Donation
- GA4 - Conversion - EN Successful Donation
Step 1: Add EN Variables
In GTM, variables are used to pull dynamic values from your site—like donation amounts, supporter ID's, and transaction IDs.
Important Notes:
- All of the variables listed below are already being pushed into the Data Layer as part of various events (like successful donations, recurring page loads, and errors)
- You do not need to write custom JavaScript to define them—they're there, and we're just telling GTM how to listen for them
- You will create "Data Layer Variable" types, setting the Data Layer Variable Name exactly as provided
To add each EN variable:
- In your GTM container, go to Variables from the left-hand menu.
- Scroll down to User-Defined Variables, and click New.
- Choose "Data Layer Variable" as the type.
- Set the Data Layer Variable Name exactly as shown in the table below.
- Save.
Here are the variables you need to create:
GTM Variable Name | Data Layer Variable Name |
---|---|
ENgrid pageJson - Transaction ID | EN_PAGEJSON_TRANSACTIONID |
ENgrid pageJson - Supporter ID | EN_PAGEJSON_SUPPORTERID |
ENgrid pageJson - Recurring Frequency | EN_RECURRING_FREQUENCIES |
ENgrid pageJson - Recurring | EN_PAGEJSON_RECURRING |
ENgrid pageJson - Receipt Number | EN_PAGEJSON_RECEIPTNUMBER |
ENgrid pageJson - Payment Type | EN_PAGEJSON_PAYMENTTYPE |
ENgrid pageJson - Page Type | EN_PAGEJSON_PAGETYPE |
ENgrid pageJson - Page Redirect Present | EN_PAGEJSON_REDIRECTPRESENT |
ENgrid pageJson - Page Number | EN_PAGEJSON_PAGENUMBER |
ENgrid pageJson - Page Name | EN_PAGEJSON_PAGENAME |
ENgrid pageJson - Page Count | EN_PAGEJSON_PAGECOUNT |
ENgrid pageJson - Locale | EN_PAGEJSON_LOCALE |
ENgrid pageJson - Gift Process | EN_PAGEJSON_GIFTPROCESS |
ENgrid pageJson - Fee Cover Amount | EN_PAGEJSON_FEECOVER |
ENgrid pageJson - Donation Frequency | EN_PAGEJSON_TRANSACTIONTYPE |
ENgrid pageJson - Donation Currency | EN_PAGEJSON_CURRENCY |
ENgrid pageJson - Donation Amount | EN_PAGEJSON_AMOUNT |
ENgrid pageJson - Country | EN_PAGEJSON_COUNTRY |
ENgrid pageJson - Client ID | EN_PAGEJSON_CLIENTID |
ENgrid pageJson - Campaign Page ID | EN_PAGEJSON_CAMPAIGNPAGEID |
ENgrid pageJson - Campaign ID | EN_PAGEJSON_CAMPAIGNID |
Step 2: Add EN Triggers
Triggers tell GTM when to run a tag—like right after a successful donation or when a form loads.
These are Custom Event Triggers, meaning they fire based on named events your EN page is already sending to the GTM Data Layer.
To create each EN trigger:
- Click "Triggers" in the left menu.
- Click "New", and give it the name listed below.
- Select Trigger Type: Custom Event.
- Enter the Event Name exactly as shown.
- Leave "This trigger fires on" set to All Custom Events.
- Save.
Here are the EN triggers to add:
Trigger Name | Event Name |
---|---|
EN Successful Donation | EN_SUCCESSFUL_DONATION |
EN_SUBMISSION_SUCCESS_* | ^EN_SUBMISSION_SUCCESS_(.+)$ |
Each of these events also sends the EN variables listed above into the Data Layer—so the triggers and variables work hand in hand depeding on your need.
Step 3: Add These Tags
Let's connect everything together using tags that fire when someone completes a donation (and beyond, in the case of the Meta Pixel).
1. Meta Pixel
This tag fires on every page to track page activity within your Meta Events Manager.
Instructions:
- Go to Tags > New
- Name it:
Meta Pixel
(or something similar if you already had an old Meta Pixel tag prior to moving onto ENgrid) - Choose Tag Type "Facebook Pixel" from the Gallery of built-in tags.
- Paste in your Meta Pixel base code (tip: create a variable with your Meta Pixel ID and enter it into this tag as a variable. That way, if your Pixel ID ever changes, you can update it on the variable and not have to do so across all your tags in GTM). Screenshot: https://cln.sh/FPdS6SnV
- Under "Advanced Settings" > "Tag firing options," select "Once per event."
- Add the Trigger:
All Pages
- Save
2. Facebook - Conversion - EN Successful Donation
This tag tells Facebook when someone completes a donation.
Instructions:
- Go to Tags > New
- Name it:
Facebook - Conversion - EN Successful Donation
(or something similar if you already had an old Meta Pixel tag prior to moving onto ENgrid) - Choose Tag Type "Facebook Pixel" from the Gallery of built-in tags.
- Paste in your Meta Pixel base code (tip: create a variable with your Meta Pixel ID and enter it into this tag as a variable. That way, if your Pixel ID ever changes, you can update it on the variable and not have to do so across all your tags in GTM).
- Make sure object properties "value" and "currency" are added (screenshot: https://cln.sh/660bJHLP)
- Make sure this tag is associated with the firing trigger "EN Successful Donation" as in the screenshot above.
3. GA4 - Conversion - EN Successful Donation
This tag sends a conversion event to Google Analytics 4 whenever a donation is successful.
Instructions:
- Go to Tags > New
- Name it:
GA4 - Conversion - EN Successful Donation
(or something similar within your naming conventions). - Choose Tag Type:
GA4 Event
- Select your GA4 Configuration Tag (or enter the Measurement ID manually, ideally as its own variable so it's easier to swap out if it changes down the line).
- Set Event Name to:
purchase
- Under Event Parameters, create a new variable called
"EN Donation - GA4 Event Parameters"
(or something similar in your naming convention). - Add the following event parameters by clicking the lego icon and selecting the variables you just created. Full list below for reference:
Parameter Name | Value |
---|---|
ENgrid pageJson - Locale | {{ENgrid pageJson - Locale}} |
ENgrid pageJson - Page Name | {{ENgrid pageJson - Page Name}} |
ENgrid pageJson - Page Number | {{ENgrid pageJson - Page Number}} |
ENgrid pageJson - Page Redirect Present | {{ENgrid pageJson - Page Redirect Present}} |
ENgrid pageJson - Page Type | {{ENgrid pageJson - Page Type}} |
ENgrid pageJson - Payment Type | {{ENgrid pageJson - Payment Type}} |
ENgrid pageJson - Receipt Number | {{ENgrid pageJson - Receipt Number}} |
ENgrid pageJson - Recurring Donation Made | {{ENgrid pageJson - Recurring}} |
ENgrid pageJson - Recurring Frequency | {{ENgrid pageJson - Recurring Frequency}} |
ENgrid pageJson - Transaction ID | {{ENgrid pageJson - Transaction ID}} |
ENgrid pageJson - Supporter ID (note: this can be listed under "User properties) | {{ENgrid pageJson - Supporter ID}} |
For the Trigger, choose:
EN Successful Donation
Click Save
Tip: The variables listed above are already being pushed to the data layer when the EN_SUCCESSFUL_DONATION
event fires, so this tag will automatically pull the correct values at the right time.
Testing and Validation
After setting up your GTM configuration:
- Preview Mode: Use GTM's Preview mode to test your setup
- Data Layer Inspection: Check the browser console to see events being pushed
- Real-Time Reports: Verify data appears in GA4 and Meta Events Manager
- Test Transactions: Complete test donations to ensure conversion tracking works
Troubleshooting
Common Issues:
- Variables not populating: Ensure the Data Layer Variable Names match exactly
- Events not firing: Check that triggers are set to "All Custom Events" (when applicable)
- Missing data: Verify "Expose transaction details" is enabled in Engaging Networks
- GTM not loading: Ensure GTM is properly installed on your pages and you're not running an Ad Blocker
pageJson Properties
The pageJson
object may include the following properties (not all are always present):
amount
: The amount of the donation (if made)appealCode
: The Appeal Code (if applicable)campaignId
: The master campaign IDcampaignPageId
: The page-builder’s campaign ID, as seen in the URLclientId
: Your organisation’s (subaccount) unique IDcountry
: The supporter’s tagged Country valuecurrency
: The currency of the donation (if made), e.g. USDdonationLogId
: The unique ID of the donation, if madegiftProcess
: Boolean (true or false) – whether a donation has been made or notlocale
: The locale code, e.g. en-USpageCount
: The number of pages in the campaignpageName
: The internal name of your page-builder campaignpageNumber
: The page number of the campaignpageType
: The page type, one of advocacypetition, click2call, datacapture, donation, e-card, e-commerce, event, emailsubscribeform, emailtotarget, membership, peer-to-peerevent, premiumgift, splitpage, staticpage, supporterhub, survey, tweetpage, unsubscribepaymentType
: The payment type of a donation if applicable, e.g. VISAreceiptNumber
: The receipt numberrecurring
: Boolean (true or false) – whether the donation was recurring or not, if applicableredirectPresent
: Boolean (true or false) – whether a redirect is present in the page structuresupporterId
: The unique ID of the supporter, generated after submissiontrackingId
: The tracking ID seen in the URL (if applicable)transactionType
: The three-letter campaign type of the donation, if made, e.g. FCRupsell
: Details on upsell lightbox include originalAmount (donation amount originally selected by supporter), name (lightbox name), and conversion (single to recurring or recurring upgrade)transactionId
: The unique ID of the donation, generated after submission- E-commerce fields:
cartItems
,productVariants
,index
,productVariantId
,quantity
,bestPrice
,quantitySold
,optionNames
,price
,salesPrice
, etc.
Not all properties are always present. For example, supporterId
and country
are only available after submission.
For a full list of possible pageJson
properties, see EN's documentation Expose transaction details (pageJson).
Field Exclusion and Hashing
Some fields are excluded from the DataLayer for privacy/security reasons:
Excluded fields:
- Credit Card:
transaction.ccnumber
,transaction.ccexpire.delimiter
,transaction.ccexpire
,transaction.ccvv
,supporter.creditCardHolderName
- Bank:
supporter.bankAccountNumber
,supporter.bankAccountType
,transaction.bankname
,supporter.bankRoutingNumber
Hashed fields: (values are base64-encoded before being pushed)
- Supporter contact/address:
supporter.emailAddress
,supporter.phoneNumber
,supporter.phoneNumber2
,supporter.address1
,supporter.address2
,supporter.address3
- In Honor/Memory:
transaction.infemail
,transaction.infadd1
,transaction.infadd2
,transaction.infadd3
- Billing address:
supporter.billingAddress1
,supporter.billingAddress2
,supporter.billingAddress3
Event Value Transformations
- String values are transformed to uppercase, spaces replaced with dashes, and
:-
replaced with-
. - Boolean values are transformed to
"TRUE"
or"FALSE"
.
Premium Gift Handling
When the field name is en__pg
(premium gift), the EN_FORM_VALUE_UPDATED
event includes:
enFieldName
enFieldLabel
(always "Premium Gift")enFieldValue
(gift name)enProductId
(fromtransaction.selprodvariantid
)
End of Gift Process Events (Advanced)
ENgrid stores certain events in sessionStorage at the end of the gift process and replays them on the next page load. This is an advanced feature for tracking multi-step flows and ensuring all events are captured.
Comprehensive Examples
Example: pageJson on a Petition Page
Page 1 (before submission):
var pageJson = {
clientId: 94,
pageCount: 2,
pageName: 'ENCC17 petition',
giftProcess: false,
campaignId: 4757,
campaignPageId: 6565,
pageNumber: 1,
locale: 'en-GB',
}
Page 2 (after submission):
var pageJson = {
clientId: 94,
pageCount: 2,
pageName: 'ENCC17 petition',
giftProcess: false,
campaignId: 4757,
campaignPageId: 6565,
supporterId: 2259636,
country: 'GBR',
pageNumber: 2,
locale: 'en-GB',
}
Example: pageJson on a Donation Page
Page 1 (before donation):
var pageJson = {
pageName: 'ENCC17 Donation page',
clientId: 94,
giftProcess: false,
pageCount: 2,
pageNumber: 1,
campaignId: 4789,
campaignPageId: 6665,
locale: 'en-GB',
}
Page 2 (after donation):
var pageJson = {
pageName: 'ENCC17 Donation page',
clientId: 94,
giftProcess: true,
donationLogId: 550154,
pageCount: 2,
pageNumber: 2,
amount: 30,
receiptNumber: 0,
campaignId: 4789,
campaignPageId: 6665,
paymentType: 'TEST: VISA',
recurring: false,
supporterId: 2259636,
country: 'GBR',
locale: 'en-GB',
currency: 'GBP',
transactionType: 'FCS',
}