helpful_user_string

This allows you to specify the ID generated by Helpful for the user to identify. This ID is stored in a PHP session if cookies are not allowed. From the ID no user data can be read out, it is therefore GDPR conform.

It is important that you can replace the ID with the logged in user ID by enabling the respective option in Helpful settings. Here it is not necessary to use the filter.

/**
 * Here you can generate your own ID for your users. By default,
 * a unique random string is created. This ID is automatically stored
 * in a cookie or a session, depending on what is currently working.
 *
 * @param string $user_id
 * @return string
 */
add_filter('helpful_user_string', function (string $user_id) {
    $user_id = 'unique_user_id';
    return $user_id;
});

Was this post helpful?

Top