I am trying to connect usetiful to my WordPress Backend.
I need to tag the users and pass information to Usetiful for further personalization.
After going through various similar Q/A threads, I managed to retrieve and pass the User ID to Usetiful, but having trouble getting the User First Name.
Here is the Code Snippet that I am using (Adding code to the Code Snippets Plugin)
<script>
window.usetifulTags = { userId : <?=get_current_user_id() ?>, firstName : <? $user_info = get_userdata(get_current_user_id());$first_name = $user_info->first_name;return $first_name;?>;};
The get_current_user_id() works well, but unable to get the User First Name/Display Name