Add user meta to Custom GA Code
-
Hi, I tried adding this to the Custom GA Code field:
<?php $group = get_user_meta(
get_current_user_id(),
$key = ‘pflgroup’,
$single = true); ?>
gtag(‘set’, ‘user_properties’, {
‘crm_id’ : ‘USER_ID’,
‘group_id’ : ‘<?php echo $group; ?>’
});
but when I save changes, it removes the php. Is there a way to retrieve user meta and send it back to google analytics?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Add user meta to Custom GA Code’ is closed to new replies.