Issue
Understand how you can set up GA4 Custom Dimensions in TraceDock.
Product
- Mobile Marketing Cloud
- Tracedock
Resolution
In GA4, you can create custom dimensions. This can be done on three different levels: ‘user’, ‘event’ and ‘item’.
In order to create a new custom dimension in GA4, you can go to the ‘Settings’ page of your GA4 by clicking on the settings-icon in the bottom left.
You can then click on ‘Custom definitions’ under ‘Data display’. Here you can click on ‘Create custom dimension’.
Specify the following things:
Dimension name
The name of the custom dimension that will be visible while using the custom dimension as a filter in GA4.
Scope
The type of custom dimension (‘user’, ‘event’ or ‘item’).
Description (optional)
Describe what the custom dimensions means and/or what it is used for.
Event parameter
The name of the property that you send along with the event. You can choose one of the existing properties or you can fill in your own name. We suggest to always fill in a unique name, so the value does not get matched with existing properties.
Click ‘Save’ and the custom dimension is now created.
This is an example of a custom dimension with an ‘Event’ scope.
Using GA4 custom dimensions in TraceDock
To set up GA4 custom dimensions in TraceDock, navigate to ‘Client side events’ or ‘Server side events’ and click on the pencil-icon to edit an event. When you open the ‘To Google Analytics 4’ tab on the right and scroll down, you will see a ‘Custom Dimensions’ section, as shown below.
To add a new custom dimension, click ‘+ add new’. The setup is the same for the normal fields.
At ‘Field’, you fill in the name of the ‘Event parameter’ that you specified in GA4 when creating the custom dimension.
You select the type of value (lookup, constant, array or object) and then fill in either the actual value (in case of a constant) or the property from the datalayer you want to get the value from (in case of lookup, array or object). After that, you can select a PropertyType.
This is the ‘Scope’ that you specified in GA4 when creating the custom dimension. Choose ‘event_params’ if the scope is ‘event’ and ‘user_properties’ if the scope is ‘user’. The last thing you can do is add a script (just like with the normal fields) to modify the data.
(For now, we don’t understand the ‘item’ scope yet, as we don’t see a usecase for this. If you would like to have this feature, please talk to support.)
Once that is all filled in, you can click ‘Save changes’. Changing the custom dimensions does not require a publish for the changes to take effect (even though it will say ‘not yet published’).
That’s it! You have now set up custom dimensions in TraceDock and GA4.
Here is an example of a custom dimension setup in TraceDock with the ‘Event’ scope.