Track WordPress User First Name
-
Hey,
Is there a way I can push user first name in the data layer?
I tried adding this in functions.php but this doesn’t work<?php
function my_filter( array $dataLayer ): array {
global $current_user; get_currentuserinfo();
$first_name = $current_user->user_firstname;
$dataLayer[“visitorName”] = ‘$first_name’;
return $dataLayer;
}
?>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Track WordPress User First Name’ is closed to new replies.