Skip to main content

CharityEngine GTM Event Listener

Track CharityEngine donation form interactions in GTM. Monitor donation started, payment step, and successful gift events with ce_event_name and donationAmount variables.

charityenginedonationsnonprofitfundraisinggtmga4giving

Event fired

ce_quick_action_form_event

Key variable

ce_event_name

CharityEngine

Overview

CharityEngine is an all-in-one nonprofit CRM and fundraising platform with embeddable donation forms. This listener tracks the full donation funnel, from form view through completed gift, using CharityEngine's native JavaScript event API.

Event fired: ce_quick_action_form_event Variable: ce_event_name

Common Use Cases

  • Track completed donations as GA4 purchase events with donation amount
  • Measure donation funnel drop-off at each step
  • Fire Google Ads conversion tags on successful gift
  • Build remarketing audiences from donors vs. form viewers

Tracked Events

ce_event_nameDescription
donation form viewedEmbedded form loaded and visible
donation startedDonor begins filling out form
payment step reachedPayment details section opened
donation completedGift successfully processed
donation failedPayment attempt failed
recurring selectedDonor opts into recurring giving

Installation

html
<!-- GTM Custom HTML Tag: CharityEngine Donation Listener -->
<script>
(function() {
  function cePush(action, extra) {
    window.dataLayer = window.dataLayer || [];
    window.dataLayer.push(Object.assign({
      'event': 'ce_quick_action_form_event',
      'ce_event_name': action
    }, extra || {}));
  }

  // CharityEngine fires events on the window object
  window.addEventListener('message', function(e) {
    if (!e.data || typeof e.data !== 'object') return;
    if (!e.data.type || e.data.type.indexOf('ce_') !== 0) return;

    var data = e.data;

    switch (data.type) {
      case 'ce_form_loaded':
        cePush('donation form viewed', {
          ceFormId: data.formId,
          ceCampaign: data.campaign
        });
        break;

      case 'ce_gift_started':
        cePush('donation started', {
          ceFormId: data.formId,
          ceDonationAmount: data.amount,
          ceFrequency: data.frequency || 'one-time'
        });
        break;

      case 'ce_payment_step':
        cePush('payment step reached', {
          ceFormId: data.formId,
          ceDonationAmount: data.amount
        });
        break;

      case 'ce_gift_complete':
        cePush('donation completed', {
          ceFormId: data.formId,
          ceTransactionId: data.transactionId,
          ceDonationAmount: data.amount,
          ceDonorEmail: data.email,
          ceFrequency: data.frequency || 'one-time',
          ceCampaign: data.campaign,
          ceFund: data.fund
        });
        break;

      case 'ce_gift_failed':
        cePush('donation failed', {
          ceFormId: data.formId,
          ceErrorCode: data.errorCode
        });
        break;

      case 'ce_recurring_selected':
        cePush('recurring selected', {
          ceFormId: data.formId,
          ceFrequency: data.frequency,
          ceDonationAmount: data.amount
        });
        break;
    }
  });
})();
</script>

Data Layer Output

Donation Completed

json
{
  "event": "ce_quick_action_form_event",
  "ce_event_name": "donation completed",
  "ceFormId": "form_abc123",
  "ceTransactionId": "txn_987654",
  "ceDonationAmount": "50.00",
  "ceDonorEmail": "donor@example.com",
  "ceFrequency": "monthly",
  "ceCampaign": "spring-fundraiser-2024",
  "ceFund": "general-fund"
}

Donation Started

json
{
  "event": "ce_quick_action_form_event",
  "ce_event_name": "donation started",
  "ceFormId": "form_abc123",
  "ceDonationAmount": "25.00",
  "ceFrequency": "one-time"
}

Triggers to Create

TriggerEventCondition
CE – Donation Completedce_quick_action_form_eventce_event_name = donation completed
CE – Donation Startedce_quick_action_form_eventce_event_name = donation started
CE – Donation Failedce_quick_action_form_eventce_event_name = donation failed
CE – Recurring Selectedce_quick_action_form_eventce_event_name = recurring selected

Variables to Capture

Variable NameDL KeyExample
DLV – CE Eventce_event_name"donation completed"
DLV – CE AmountceDonationAmount"50.00"
DLV – CE Transaction IDceTransactionId"txn_987654"
DLV – CE FrequencyceFrequency"monthly"
DLV – CE CampaignceCampaign"spring-fundraiser-2024"
DLV – CE EmailceDonorEmail"donor@example.com"

GA4 Mapping

GA4 EventTriggerParameters
purchasedonation completedtransaction_id, value, currency, items
begin_checkoutpayment step reachedvalue
add_to_cartdonation startedvalue (donation amount)
sign_uprecurring selectedmethod: "recurring_donation"

GA4 Purchase Tag Configuration

javascript
// GA4 Configuration tag, Donation as Purchase
// Trigger: CE – Donation Completed
{
  transaction_id: {{DLV - CE Transaction ID}},
  value: {{DLV - CE Amount}},
  currency: "USD",
  items: [{
    item_name: "Donation - " + {{DLV - CE Campaign}},
    item_category: {{DLV - CE Frequency}},
    price: {{DLV - CE Amount}},
    quantity: 1
  }]
}

Google Ads Conversion

For Google Ads, create a conversion action for "Donation" and fire it on the CE – Donation Completed trigger:

Conversion Value: {{DLV - CE Amount}} Currency: USD Transaction ID: {{DLV - CE Transaction ID}}

Debugging

ProblemCauseFix
No events in dataLayerForm in iframe, wrong origin filterCheck e.origin matches CharityEngine domain
ce_event_name undefinedWrong event keyLog e.data.type to confirm event format
Amount shows as undefinedAPI version differenceAdd console.log to inspect e.data structure
Events fire twiceListener added twiceWrap in a guard: if (window._ceListenerAttached) return;

Best Practices

  1. Track recurring vs. one-time separately, recurring donors have 3-5x higher lifetime value; segment them in GA4 from day one
  2. Pass transaction ID to avoid duplicate conversions, CharityEngine may send confirmation on multiple page loads
  3. Use Enhanced Conversions, hash ceDonorEmail for better Google Ads attribution on donation completions
  4. Create a GA4 custom dimension for ceFrequency, enables recurring vs. one-time analysis in Explore reports

Related Listeners

  • Calendly, for tracking fundraising calls scheduled via Calendly
  • HubSpot Form, for capturing donation interest forms before the gift