Skip to main content

How to set up Google Analytics conversion tracking

In this article we'll explain how to set up Google Analytics conversion tracking with Double

Updated over a month ago

You can easily connect Double to your Google Analytics (GA4) account using Google Tag Manager.

What you’ll need

  1. A Google Tag Manager (GTM) container installed on your website

  2. A Google Analytics 4 (GA4) property connected to that same GTM container

  3. A Double embed snippet already added to your site

Step 1 - Enable the donation event from Double

Double automatically triggers a browser event when a donation is completed.

This event is called Double.donationCompleted, and it includes details such as the amount, currency, and transaction ID.

Add this script to your website (ideally right below your Double embed):

<script>
document.addEventListener("Double.donationCompleted", (e) => {
const d = e.detail.donation;
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: "donationCompleted",
value: d.amount,
currency: d.currency,
transaction_id: d.id,
});
});
</script>

Already added this for Google Ads?

You don’t need to add it again! The same event works for both Google Ads and Google Analytics - you’ll just add a new tag in GTM that listens to the same donationCompleted event.

Step 2 - Create a custom event trigger in Google Tag Manager

  1. Go to your GTM workspace

  2. Click Triggers → New → Trigger Configuration → Custom Event

  3. In the Event name, enter:

    donationCompleted
  4. Choose All Custom Events (or add conditions if you prefer)

  5. Save the trigger as Donation Completed

Step 3 - Create a GA4 event tag

  1. Go to Tags → New → Tag Configuration

  2. Select Google Analytics: GA4 Event

  3. Choose your existing GA4 Configuration Tag

  4. Set the Event name to:

    donation_completed

    (you can also use “purchase” if you want GA4 to treat it as a transaction)

  5. Under Event Parameters, add:

    1. value → Data Layer Variable value

    2. currency → Data Layer Variable currency

    3. transaction_id → Data Layer Variable transaction_id

  6. Set the Trigger to your Donation Completed trigger

  7. Save and publish your changes

Step 4 - Test the Integration

  1. Use Preview Mode in GTM to confirm:

  2. A donationCompleted event appears in your data layer

  3. Your GA4 event tag fires successfully

Then make a test donation and verify in Google Analytics → Reports → Engagement → Events that you see donation_completed (or purchase) being tracked.

Did this answer your question?