Adrien Kouyate
Adrien Kouyate

Reputation: 11

Struggled with Measurement protocol to send purchase event through GTM

I'm completly lost !I started to use Google Ads for my B2C Saas and I need to send conversion event to it.

I use stripe as payment provider. So I use webhook on my backend to handle payment.success event and trigger an event 'purchase' with Google Measurement Protocol. It's working half of the time and and I don't see events in real time in the debugview.

🤔 My first question is Measurement Protocol the good way to do in this context ?

🤔 Secondly, is it possible to use Google Tag Manager to fetch purchase events from HTTP requests done with Google Measurement Protocol and relay them to Google Ads?

Backend -- (purchase event) --> GTM --> Google ADS (Conversion) & GA4

Here a payload example I use to test :

{
    "client_id": "1770912193.1700571402",
    "user_id": "***************",
    "timestamp_micros": "1700585815945000",
    "non_personalized_ads": true,
    "events": [
        {
            "name": "purchase",
            "params": {
                "items": [],
                "currency": "EUR",
                "transaction_id": "123456789",
                "value": 6.60,
                "debug_mode": 1
            }
        }
    ]
}

Upvotes: 0

Views: 894

Answers (1)

ali izadi
ali izadi

Reputation: 549

  1. Using Google Measurement Protocol: Yes, it's a good approach for your scenario. It's designed for server-side tracking and fits well with your setup. The inconsistency in tracking might be due to implementation issues or data processing delays.

  2. It's important to include the ga_session_id in your payload to ensure accurate session tracking and attribution in Google Analytics 4. This will help in correctly attributing the purchase to a session source/medium like Google Ads and also reducing issues like "not set" in your reports.your final payload should be sth like this :

events":[{"name":"purchase","params":{"items":[],"currency":"USD","transaction_id":"rte2319","value":1.001,"ga_session_id":1696098149}}]

Upvotes: 0

Related Questions