Google Analytics 4: custom dimensions in gtag.js

Viewed 521

I am trying to send some custom dimension together with my event. This is my code:

gtag('config', 'G-XXXXXXXXXX', {
  'custom_map': { 'dimension1': 'age' }
});
gtag('event', 'age_dimension', {
  'event_category': category,
  'event_label': action,
  'value': data(),
  'nonInteraction': 1,
  'age': '666'
});

This is my dimension on UI: enter image description here

I am sending my events together with my custom dimension, on UI I see all my data as parameters in the event,

enter image description here

but when I try to make something with my dimension GA just says me that there is no data for this dimension.

enter image description here

I don't know, probably I configured the map incorrectly or probably something wrong with the dimension which I created. So the question, is my configuration and dimension correct? and if no, what is wrong? thanks!

0 Answers
Related