0

Is it possible to track revenue for a custom GA4 event that is triggered through GTM? Custom events overview in GA4

The custom GA4 event is fired through GTM where I am able to get the revenue value through a custom parameter. Tag Assistant

  1. Event name, event_value parameter
  2. I've also tried wrapping an ecommerce object, while ticking the "Send eCommerce data" checkbox which should in theory send the eCommerce data from the datalayer to GA4 but nothing is shown in the debugger. GTM Tag setup

Google documentation recommends to use "purchase" or recommended events to track revenue but the issue here is understanding if it's possible to have a custom GA4 event with a valid revenue in it?

I've tried adding an "ecommerce" object to the dataLayer with no success. Given that this custom event is fired through GTM, it's slightly tricky to get the values over to GA4.

1
  • If you mean track revenue as in see that data in the GA4 interface then you can only use the ecommerce events. If you want to use the revenue value to report on as parameter value then you can just add it as a parameter to your custom event. (and build a report in GA4).
    – Christoph
    Commented Jul 25, 2023 at 18:18

2 Answers 2

0

If you use Google tag manager and you can see that value in the data layer, for example, the price of that product in that event, you can add it manually to your Tag.

For example, after a purchase, you click on your custom purchase event

GA4 Custom value Image

and you will see these stuff in the data layer,

    {
      event: "purchase",
      gtm: {
        uniqueEventId: 5,
        start: 1675465507193,
        allowlist: undefined,
        blocklist: undefined,
        whitelist: undefined,
        blacklist: undefined,
        priorityId: undefined
      },
      tagTypeBlacklist: undefined,
      eventModel: {
        transaction_id: "ORD12543",
        affiliation: "Aff",
        **mycustomvalue: "6.18",**
        currency: "CAD",
        tax: "3.14",
        shipping: "2.00",
        items: [
          {
            id: "1234",
            name: "Your Product",
            currency: "CAD",
            brand: "Good",
            variant: 123456,
            price: "118.00",
            quantity: 1
          }
        ],
        event_label: "Order placed",
        event_category: "Shopping",
        source: "review/"
      }
    }

then you need to make a data layer variable in Google Tag Manager, put mycustomvalue as the Data Layer Variable Name, and add it your Tag manually like this

Add your value to your tag like this

0

Took me ages to realize this myself: GA4 doesn't report on revenue/value for ecommerce unless you have a unique transaction_id, value, currency, and items, as these are all required parameters. Your ecommerce data seems to be missing a transaction_id. (I also suspect setting the items in your GA4 tag is redundant since you're already including the item information in the ecommerce data layer object.)

I believe if you add a transaction_id GA4 should start showing revenue for your custom event. If not, then a workaround you could try would be making them purchase events, setting item_category or item_variant to your chosen types, then using Data Display > Events > Modify Event in GA4 to capture purchases with certain categories/variants and recast their event names.

2
  • It doesn't report even if you have all of those (unless the event name is purchase, but then that's not a custom event), although the documentation suggests otherwise. The GA tech support is absolute trash, I have to say. Commented Apr 18 at 10:01
  • 1
    @MarkoBonaci Nice catch, I missed that it was a custom event. Agreed on the tech support.
    – Boxbot
    Commented Apr 19 at 12:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.