Tracking Codes for Action Pages
Add Google Analytics 4, Google Tag Manager, Meta Pixel, X Pixel, and X Event ID to Donation Pages, Event Pages, and Lead Pages, and reuse them with presets.
Tracking codes connect your Action Pages to Google Analytics 4 (GA4), Google Tag Manager (GTM), the Meta (Facebook) Pixel, and the X (Twitter) Pixel, so you can measure visits, donations, and signups. You add them in the Page Builder under Setup > Settings > Tracking codes. This article covers adding tracking codes, Settings presets, each tracking tool, embedded pages, UTM parameters, when tracking fires, and testing your setup.
Before You Begin
To add or change tracking codes and Settings presets, you need Action Pages: Edit permissions. Without them, the Page Builder shows a View-only access notice and you can't save. See Permission Sets.
Donation Pages, Event Pages, and Lead Pages all use the same Setup > Settings > Tracking codes section.
Tracking codes are set on each page or on the Settings preset the page uses. There's no account-wide tracking codes screen.
Tracking doesn't run in the Page Builder preview. Test on your live page.
Supported Tracking Codes
Google Analytics 4
Google Analytics and Send e-commerce events to Google Analytics
Page views, donation and lead events, and e-commerce purchase events
Google Tag Manager
Google Tag Manager
Loads your container and pushes donation and lead events to the data layer
Meta Pixel
Facebook Pixel
PageView, Purchase, and Lead events
X (Twitter) Pixel
X Pixel, X Event ID
Page views, plus a conversion after a successful gift, ticket purchase, or sign-up when both fields are set
The fields accept IDs only. You can't paste a pixel script into a page.
There's no built-in field for other tools, such as TikTok, LinkedIn, or Google Ads. Add those tags through your own GTM container. See Add Other Tags Through GTM.
Add Tracking Codes to an Action Page
To add tracking codes:
Go to Action Pages > Action Pages and open your page in the Page Builder.
In the left menu, under Setup, select Settings.
In the Tracking codes section, enter the IDs you use.
Click Save.
Your changes go live when you save. There's no separate publish step, but the live page can take about a minute to show the update.
Tracking Code Fields
Google Analytics: Your GA4 Measurement ID, which starts with G- (for example, G-XXXXXXXXXX). Up to 16 characters.
Send e-commerce events to Google Analytics: Sends a GA4
purchaseevent for each donation on Donation Pages and Event Pages.Google Tag Manager: Your GTM Container ID, which starts with GTM- (for example, GTM-XXXXXXXX). Up to 12 characters.
Google origin allowlist: Fill this in only when the page is embedded on your website. See Embedded Pages.
Facebook Pixel: Your Meta Pixel ID. Up to 17 characters.
X Pixel: Your X Pixel ID.
X Event ID: The event ID from your X Ads conversion event, in the form tw-xxxxx-xxxxx. This field sits directly under X Pixel. You need both fields for Anedot to report conversions to X.
Use Settings Presets
A Settings preset saves your tracking codes so you can reuse them across pages. Every account starts with a preset named Default, and new pages use it. You manage presets in the Settings preset section of Setup > Settings.
Select a preset: Applies that preset to the page. Applying a preset replaces the tracking codes on the page.
Save: Saves your tracking code changes to this page only. The preset and other pages that use it don't change.
Update Preset: Saves your tracking code changes to the preset itself, which updates every page that uses it. Before you confirm, the dialog shows how many pages use the preset.
Save as Preset: Saves the page's current settings as a new named preset. Save the page to attach it to the new preset.
Apply to pages…: Opens Update Pages to Preset, where you choose the pages that should use the preset.
For more on presets, see Presets in the Page Builder.
Change Tracking Codes on Every Page That Uses a Preset
To update a preset:
Go to Action Pages > Action Pages and open any page that uses the preset.
In the left menu, under Setup, select Settings.
In the Tracking codes section, update the IDs.
Click Update Preset.
Review the number of pages that use the preset, then confirm.
The message "Updated "[preset name]"." appears, and every page that uses the preset loads the new tracking codes.
Apply A Preset to Several Pages
To apply a preset:
Open a page that uses the preset, and go to Setup > Settings.
In the Settings preset section, click Apply to pages….
In Update Pages to Preset, select the pages, or select All Pages.
Click Apply.
The message "Applied "[preset name]" to [number] action pages." appears, and the selected pages use the preset's tracking codes.
Google Analytics 4 (GA4)
Send GA4 data one way only. Use either the built-in Google Analytics field or your own GTM container, not both.
Built-in field (recommended for most accounts): Enter your Measurement ID in Google Analytics and check Send e-commerce events to Google Analytics. Anedot sends page views and
purchaseevents for you.Your GTM container: Leave Google Analytics empty and leave the e-commerce box unchecked. Build your GA4 tags in GTM on Anedot's data layer event. See Send GA4 Purchases From GTM.
Set Up GA4
To set up GA4 with the built-in field:
In Google Analytics, go to Admin > Data streams, select your web stream, and copy the Measurement ID.
In the Page Builder, go to Setup > Settings and paste the whole ID, including G-, in Google Analytics.
Check Send e-commerce events to Google Analytics.
Click Save. If your pages use more than one Settings preset, repeat these steps for each preset.
In Google Analytics, go to Admin > Events and make sure
purchaseis marked as a key event.
Use the Measurement ID from a web stream. Don't use a Property ID, a GT- tag ID, a UA- ID, or a GTM- ID in this field.
What Anedot Sends to GA4
page_view
The page loads
Standard GA4 page data
purchase
A donation succeeds on a Donation Page or Event Page, and Send e-commerce events to Google Analytics is on
transaction_id, value, currency (USD), affiliation (page name), and one item (one-time or recurring)
"[Page name] donation"
A donation succeeds on a Donation Page or Event Page
A custom event with the donation value
"[Page name] lead"
A Lead Page signup succeeds
A custom event with no value
All values are in U.S. dollars.
GA4 data is sent from the donor's browser only. Anedot doesn't send GA4 data from its servers.
To tell your pages apart in GA4 reports, use the page path or the
affiliation(page name) on each purchase.
GA4 Cross-Domain Tracking
Cross-domain tracking keeps a donor's GA4 session together when they move from your main website to your Action Page, so donations are credited to the campaign that brought the donor in.
Google Tag Manager (GTM)
GTM lets you add your own marketing and analytics tags, such as Google Ads conversion tags, to your Action Pages.
To add GTM:
In Google Tag Manager, copy your Container ID (for example, GTM-XXXXXXXX).
In the Page Builder, go to Setup > Settings and paste the ID in Google Tag Manager.
Click Save.
Use one container per page. To use the same container on many pages, add it to a Settings preset. See Use Settings Presets.
What Anedot Sends to the Data Layer
When a donation or signup succeeds, Anedot pushes one event to the data layer:
google_analytics_ecommerce_transaction
Donation Pages and Event Pages
generate_lead
Lead Pages
Anedot pushes this event for every successful donation or signup, whether or not Send e-commerce events to Google Analytics is on. Each push includes these fields:
transactionId: The submission ID.
transactionTotal: The donation total in U.S. dollars (donations only).
predictedLtv: An estimated lifetime value in cents, based on the recurring frequency (donations only).
gift_type: One-time or recurring.
fName, lName, city, state, postalCode, and country: The donor's name and location.
The data layer doesn't include email, phone, or UTM fields. To use UTM values in GTM, use GTM's built-in Page URL or Query variables.
Fire A Tag on a Donation or Signup
The receipt opens on the same page without a full page reload, so page view, DOM Ready, and "/receipt" page path triggers don't fire when a donation succeeds. Use a Custom Event trigger on Anedot's data layer event instead.
Step 1: Create the Trigger
To create the trigger:
In GTM, go to Triggers and click New.
Choose Custom Event as the trigger type.
For Event name, enter
google_analytics_ecommerce_transaction. For Lead Pages, entergenerate_lead.Name the trigger and click Save.
Step 2: Create the Variables
To create a variable for the donation amount:
Go to Variables and click New.
Choose Data Layer Variable.
For Data Layer Variable Name, enter
transactionTotal.Name the variable and click Save.
Repeat these steps with transactionId if your tag needs an order or transaction ID.
Step 3: Create Your Tag
To create your tag:
Go to Tags and click New, then choose your tag type, such as Google Ads Conversion Tracking.
Enter the tag's details. For a conversion value, select your
transactionTotalvariable.Under Triggering, select the Custom Event trigger from Step 1.
Click Save, then submit and publish your container.
Send GA4 Purchases From GTM
If you send GA4 data through GTM instead of the built-in field, your own GTM tags must send the purchase event.
To send purchases from GTM:
Create a GA4 event tag with the event name
purchase.Set
transaction_idto yourtransactionIdvariable,valueto yourtransactionTotalvariable, andcurrencyto USD.Under Triggering, select the
google_analytics_ecommerce_transactionCustom Event trigger.Click Save, then submit and publish your container.
Leave the Google Analytics field empty on your Action Pages so purchases aren't counted twice.
Add Other Tags Through GTM
To add a tool without a built-in field, such as TikTok or LinkedIn, add that tool's tag to your GTM container and fire it on the Custom Event trigger from Fire a Tag on a Donation or Signup. Use transactionTotal for the donation value.
GTM Restrictions on Action Pages
Anedot blocks GTM's DOM Element and JavaScript Variable variable types on Action Pages. Use Data Layer Variables for donation details. If a tag needs one of the blocked variable types, contact our Support team about removing the restriction for your account.
Meta (Facebook) Pixel
The Meta Pixel tracks visits, donations, and signups in the donor's browser.
To add the Meta Pixel:
Copy your Meta Pixel ID from your Meta account.
In the Page Builder, go to Setup > Settings and paste the ID in Facebook Pixel.
Click Save.
Meta Events
PageView
The page loads
None
Purchase
A donation succeeds on a Donation Page or Event Page, after the payment is confirmed
Value in U.S. dollars, currency (USD), one-time or recurring, predicted lifetime value, and the donor's email, name, city, state, ZIP code, and country, sent only as hashed codes
Lead
A Lead Page signup succeeds
Hashed email
PageView and Purchase are separate events, so a page view and a donation from the same donor aren't double counted.
X (Twitter) Pixel
The X Pixel and X Event ID fields connect your Action Page to X Ads, so X can count page views and conversions from your page.
To set up X tracking:
Copy your X Pixel ID and the event ID from your X Ads conversion event.
In the Page Builder, go to Setup > Settings.
In the Tracking codes section, enter the pixel ID in X Pixel and the event ID in X Event ID. The event ID looks like tw-xxxxx-xxxxx, with letters and digits in each part.
Click Save.
Your changes go live when you save.
What X Receives
Page views: Recorded whenever X Pixel is set, even if X Event ID is blank.
Conversions: Reported from the donor's browser after a successful gift, ticket purchase, or sign-up, when both X Pixel and X Event ID are set. The conversion includes the amount in U.S. dollars (USD).
Lead Pages: Report a conversion with an amount of 0.
Failed or declined submissions: Send nothing to X.
The Page Builder preview never sends tracking, including X conversions. To test, submit a gift or sign-up on your live page.
X Event ID is part of your page's Settings, like X Pixel and the other tracking codes. Pages that share a Settings preset also share the same X Pixel and X Event ID.
Embedded Pages
Google origin allowlist: Only fill this in if your page is embedded on your own site and you want donation events sent to that site. Enter full addresses like https://www.example.org, separated by commas. If you also use Google Tag Manager on this page, contact Support first.
Leave Google origin allowlist empty on pages that aren't embedded.
For more accurate tracking, link to your Action Page instead of embedding it.
UTM Parameters
UTM parameters are tags you add to the end of an Action Page link to show where your traffic comes from. GA4 reads them from the page URL, and Anedot keeps them on the URL without adding or removing any, so you don't need to set anything up in Anedot.
Add UTM parameters whenever you share an Action Page link, such as in ads, emails, text messages, social posts, partner links, or QR codes. For example:
https://secure.anedot.com/account-url-slug/page-slug?utm_source=facebook&utm_medium=paid&utm_campaign=year_end_appeal
utm_source
Traffic source (for example, facebook)
utm_medium
Channel (for example, email, social, or cpc)
utm_campaign
Campaign name (for example, fall_fundraiser)
utm_content
Ad or test variant (for example, button_a)
utm_term
Search term for paid keyword campaigns
UTM data appears in GA4 Acquisition reports as source, medium, and campaign. For other parameters Action Pages support, see URL Parameters.
When Tracking Fires
Page load: Each tracking code loads and records a page view.
Successful donation or signup: Donation and signup events fire in the donor's browser after the payment is confirmed. Declined or failed payments don't send these events.
Receipt: The receipt opens on the same page without a full page reload. Opening a receipt link directly doesn't send tracking events.
Callback URL: If your page uses a Callback URL, Anedot sends the tracking events before it redirects the donor.
Event Pages: Ticket purchases are tracked as donations, and ticket prices are included in the total.
Lead Pages: Send lead events (
generate_leadin GTM and Lead in Meta) with no value, even when the page collects money.Recurring gifts: Tracking codes run in your donor's browser, so they record a recurring gift once: when the donor signs up and makes the first payment. That event includes the first payment's amount and marks the gift as recurring. Later scheduled payments happen automatically without the donor on your page, so they don't send events to Meta, Google Analytics, Google Tag Manager, or X.
Future pledges: Tracked at signup, with today's charge as the value.
Post-conversion upgrades: Each accepted upgrade sends its own purchase event with its own transaction ID.
Not tracked: Bitcoin checkouts that redirect away from the page, and gifts entered in Finance > Terminal.
Amount, currency, and ID: Amounts are in U.S. dollars, the currency is always USD, and the transaction ID is the submission ID. If one checkout creates more than one submission, the IDs are joined with commas.
Test Your Setup
To test your tracking codes:
Open your live Action Page, not the Page Builder preview, in a private browser window with ad blockers turned off.
Open your testing tools, such as Google Tag Assistant or GA4 DebugView, GTM Preview, and the Meta Pixel Helper browser extension.
Confirm that a page view appears in each tool.
Make a small real donation, or submit a Lead Page signup.
Confirm that the donation or lead events appear in each tool.
Frequently Asked Questions
Where Do I Add Tracking Codes?
You add them in the Page Builder under Setup > Settings > Tracking codes.
Which Tracking Tools Does Anedot Support?
Anedot supports Google Analytics 4 (GA4), Google Tag Manager (GTM), the Meta (Facebook) Pixel, and the X (Twitter) Pixel.
Does Tracking Run in the Page Builder Preview?
Tracking doesn't run in the Page Builder preview. Test on your live page.
When Do Donation and Signup Events Fire?
Donation and signup events fire in the donor's browser after the payment is confirmed. Declined or failed payments don't send these events.
Are Later Recurring Payments Tracked?
Tracking codes run in your donor's browser, so they record a recurring gift once: when the donor signs up and makes the first payment. Later scheduled payments happen automatically without the donor on your page, so they don't send events to Meta, Google Analytics, Google Tag Manager, or X.
Related Articles
Was this helpful?

