Answer the question
In order to leave comments, you need to log in
Identifying user actions on a Wordpress site?
Hello! Tell me, please, is it possible to identify the user who performed the action on the site? That is, I have a button on the page that leads to a third-party resource, is it possible to understand which specific registered user clicked on it?
Answer the question
In order to leave comments, you need to log in
Hello!
And how exactly do you want to understand which user clicked on it?
1) Yandex Metrica - Webvisor. Will provide information about the ip, browser and OS of the user.
2) If you need to track actions in the site admin panel, then https://wp-stream.com/
3) As an option, on pressing the button, hang up a js script that, on click, sends information about the click to the server, and then it is identified on the server using PHP user if he is authorized and this or that action is performed, for example, a letter arrives that such and such a user has clicked on such and such a button.
You can use the get_current_user_id() function and use it on all active elements to keep track of:
<?php $user_id = get_current_user_id(); ?>
<a href="/my-plugin-url<?php echo $user_id; ?>">View/Download plugin</a>
https://www.example.com/somepage/?userid=12
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question