Documentation

We now assume that events are pushed to the data layer.

What happens from here?

Logic must now be built in for the events in GTM.

Step 1. GTM: Creating variables

We call these data layer variables. The variables we defined in the push should now be revealed.
We take the reservation number as an example. "details.i-res bookingnumber". Do we remember what we had set?

'details': {
  'i-res bookingnumber': booking.booking_id,
  'game': booking.object_desc,
  'date': booking.fromdate,
  'starttime': booking.fromtime,
  'endtime': booking.tilltime,
  'price': booking.price,
  'location': booking.object_short_desc
  }

In itself, the space between i-res and bookingnumber is "dangerous" but in the data layer it works fine in the data layer.
Other relevant variables are price and location. But these too could have been given a different name at will.

Back to the GTM. By the way, we don't even have to list all the variables here, just the ones we are interested in.
We do this by adding details with a dot like this: ""details.i-res bookingnumber"". However, it is important that the name matches *exactly*.

Give the vars a name in GTM. For example dlv-bookingnumber.
From this moment on, the GTM name will be used and not the original name.

Step 2. Create GTM Trigger

In this step we create a trigger in GTM. This is a "Custom event". Not a complex step, but it does require the right name,
In addition to the object with details, we have also added an event in the data layer.

'event': 'bookingMade',

This name must be copied exactly into the logic.
It is useful to keep the event name the same, but that is not necessary.

The definition also states "This trigger fires on". Choose "Some custom Events" and

Step 3. Create GTM Tag

Now the previous steps may be combined.

We create a Tag based on GA4 Event.

We also enter an Event Name here and here we call up the previously created data layer variables.
We specify this via Event Parameter + Value. Where the Event Parameter is the "new name" that will be visible in GA.

The result: