Custom events on blocks

Setting up custom event

Setup event on blocks

On each block, including the global blocks - we have a new section - called GTM. In this section - you can setup custom events on clicks of buttons within the block.

  1. Use custom event - enables the function
  2. Event name - field to enter the event name which should match with the event name on GTM and GA4
  3. Sign up / Sign in / All links - manages which type of buttons to track.

Alongside with the event - a DataLayer will send more information to GTM:

  1. Pagetype
  2. Locale
  3. AID
  4. Inpage_location
  5. Label (of button - en-gb version)
  6. Page_ID
Setup event on blocks

Configurations in GTM

In GTM - you have to operate with the following elements:

  1. Tags
  2. Triggers
  3. Variables

Variables

All required and used variables are already created in GTM, but you can add new ones if you will need (but for this - we have to send them also from the CMS via DataLayers. For now - you do not have to make anything here.

Variables

Setup triggers

Your first step is to setup a trigger in GTM - which will match with the event name you created in the CMS

Setup triggers

Custom events on blocks

Choose Trigger type - Custom event and fill in the title and the event name you used on the CMS for the block

Custom events on blocks

Custom events on blocks

Tags

And the final step in GTM is to setup you tags. You will have flexibility here to choose where to send the information (GA4 / Mouseflow / etc.)
Let's take the first example with the GA4.

  1. You will go to the Tags tab and create a new tag.
  2. Give it a distinctive name
  3. Click on Tag Configuration
  4. Select Google Analytics
  5. Select GA4 Event
  6. Fill in the Measurement ID (you can find it also in other GA4 Tags - G-WE8EG3WKD3)
  7. Fill in your event name you used in the CMS and in the trigger
  8. Fill in the Event Parameters you want to use (from the variables we mentioned in the first step.
  9. Click on Triggers and select the Trigger you created on second step.
  10. Save the tag.
  11. Go to the main page and Publish the changes on the Container.
Tags

Custom events on blocks

Custom events on blocks

Custom events on blocks

Custom events on blocks

GA4

In the GA4 - events are coming in by default. The only thing you need to configure is the Custom dimensions / metrics.

Custom dimensions are used for text values (variables) and Custom metrics for digits values (variables) (as currency).

You can add them by going to Settings -> Custom dimensions

Custom events on blocks

Custom events on blocks

Here you have to enter your variable name in Dimension name and Event parameter.

Custom events on blocks