Google Analytics 4 gtag Custom dimension not set

706 Views Asked by At

<script async src="https://www.googletagmanager.com/gtag/js?id=G-XXXX"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());
      
 
  gtag('config', 'XXXX',{
    'user_id' : 'sfId11111',
    'custom_map': {
        'dimension1': 'user_type'
    }
  });
 gtag('set', 'user_properties', {
  user_type: 'user type from user prop'
});
  
 gtag('event', 'page_view', {  'user_type': 'user type from custom dimension' } );
 gtag('send', 'page_view');
</script>
I am trying to pass custom user scope dimensions with Gtag.js (user_type) but this always comes as "not set". I have added it as a dimension as well as user properties. I have waited a couple of days to reflect the value.. but it always comes as not set The value is available in Debuggerenter image description hereenter image description here

0

There are 0 best solutions below