• Resolved ryanapr289

    (@ryanapr289)


    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)
  • Plugin Author Jeff Starr

    (@specialk)

    Glad to help.

    With WordPress, it’s not possible to execute PHP code inside of options or post content, etc. So it’s not something the plugin can do at this time.

    Thank you for your interest.

    Plugin Author Jeff Starr

    (@specialk)

    Just FYI, the plugin does provide a couple of shortcuts to get the user ID and user login_name:

    %%userid%%
    %%username%%

    These can be added in the “Custom GA Code” setting, where you will find more information. I hope it is useful for you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Add user meta to Custom GA Code’ is closed to new replies.