- Creating a tag
- Add a new tag
- Insert tag name
- Select tag type
- Pick configuration tag
- Enter event and parameter names
- Variables setup
- Create a variable for each parameter
- Add a trigger
- Add a new trigger
- Set the trigger
- Test and publish tags
- Register event parameters in GA4
- How can I verify if my settings are correct?
- A/B tests
- Register the user property in GA4 custom variables.
In order to track events from Luigi’s Box Search and Recommender in GA4, your website must contain the dataLayer variable.
To start tracking events in your GA4 property, you need to create a new GA4 tag in Google Tag Manager (GTM).
Creating a tag
Add a new tag
- Create a new tag in GTM by clicking Add new tag.
Insert tag name
- Enter a tag name, for example, “GA4 – Luigi’s Box Event”
Select tag type
- In the Tag Configuration section, select Google Analytics tag type: GA4 Event
Pick configuration tag
- In the Configuration tag dropdown menu, select the configuration tag of your account. If you do not have one, enter the Tracking ID of your GA4 property.
Note: If you are not sure, if you have a configuration tag in your GTM, you can find out by simply searching the tag type “Google Analytics: GA4 Configuration” in the list of tags. GA4 Configuration”. (image below)
Enter event and parameter names
Event:
- luigisbox
Event Parameters:
- service
- interaction
- result_type
- result_id
See the Description of parameters section below for an explanation of individual parameters.
Variables setup
Create a variable for each parameter
In the Value column, click the + icon on the right side. Click + to add a new variable.
You will see a list of variables in your GTM. Click the + icon at the top right.
Enter the variable name, e.g. “DL – service”. (DL stands for a Data Layer.)
Select the Data Layer Variable type.
For Data Layer Variable Name, enter the variable name exactly as shown in this tutorial: “luigisbox.” + a variable name, e. g. luigisbox.module_type. You need to add “luigisbox.” before the variable name.
If the value entered in the field is different from the table below, values will not be recorded.
Variable name – Value in the DataLayer Variable Name field
- service – luigisbox.service
- interaction – luigisbox.interaction
- result_type – luigisbox.result_type
- result_id – luigisbox.result_id
Add a trigger
Your event parameters are now set.
Now, create a trigger for the tag. In this case, you want to trigger the tag each time that “luigisbox” event is pushed in datalayer. To do this, click at triggering.
Add a new trigger
- Click + to add a new trigger.
Select a trigger type “Custom event”
Set the trigger
- Add a name for your trigger, for example “Event – luigisbox”
- Set trigger event “luigisbox”
Test and publish tags
Your tracking is now set. Save the tag and publish the container changes.
We recommend testing settings before publishing via the “Preview” tool.
Register event parameters in GA4
To see all event values in GA4 reports and create segments based on Luigi’s Box events values, you’ll have to register the event parameters as custom dimensions in GA4.
To do that, navigate to admin, choose custom definitions, and create a new custom dimension.
Set custom dimensions for all the parameters
- dimension name: preferably the same name as the event parameter
- scope: event
- description: optional – describe the custom dimension
- event parameter: set the parameter name (service, interaction, result_type)
How can I verify if my settings are correct?
You have two options: quick check in standard report or comprehensive overview in Exploration section. In both cases please wait for 24-48 hours after GTM configuration.
A/ Quick check in standard report:
1. Navigate to the Events report (Reports > Engagement > Events)
2. In the list of events select “luigisbox”
3. Now you can see the overview for a “luigisbox” event.
4. On the bottom of the page you can see tables based on custom dimensions: service, interaction, result_type and result_id
B/ Comprehensive overview in Exploration section
1. Navigate to the Exploration section and create new Free form (Explore > Free-form)
2. In Variables section scroll down to DIMENSIONS and import dimensions Event name, service and interaction
3. Build a table, with:
- Dimensions (Event name, service, interaction)
- Metric (Active users, Event count)
- Filter (Event name exactly matches “luigisbox”
A/B tests
In case you want to launch an A/B test of Luigi’s Box features, you need to add additional user property ‘ab_test’ to your GA4 event tag.
Open your tag and add the new user property ab_test
Create a new dataLayer variable for ab_test
Register the user property in GA4 custom variables.
To do that, navigate to admin, choose custom definitions, and create a new custom dimension.
Create a new dataLayer variable with value luigisbox.ab_test
- dimension name: preferably the same name as the event user parameter
- scope: user
- description: optional – describe the custom dimension
- event parameter: ab_test