gtag multiple custom dimensions

后端 未结 1 1303
梦谈多话
梦谈多话 2021-01-13 07:38

I searched the web for the solution to send multiple custom dimensions to google analytics.

the old tag ga was easy to configure like so :

ga(\'crea         


        
相关标签:
1条回答
  • 2021-01-13 08:01

    You can still use the Legacy version of the code but you have to send it inside a JSON instead, as the example

    --Option I-- 
    -- Set Option -- 
    
    gtag( 'set' , {'dimension1' : "yxz"} );                      // Set a Single Element
    gtag( 'set' , {'dimension2' : "abc",'dimension3' : "123"} ); // Set multiple Elements
    gtag('config', 'UA-1-1');                             // Pageview with 3 cd
    
    --Option II--
    -- Map Function--
    
    
    gtag('config', 'UA-ID', {
     'custom_map': {'dimension1': 'value',
                    'dimension2': 'value2',
                    'dimension3': 'value3'}
    });
    gtag('event','eventname', {'value1':"1",'value2':"2",'value3':"3"});
    
    0 讨论(0)
提交回复
热议问题