So basically On My WordPress site I have 3 different ways to register (std Reg. Form, Social Media Plugin, Membership Reg.) this way I am tracking new user registration through "user_register" Wordpress hook and sending notification by email to CEO,
add_action( 'user_register', 'new_registration_email_notification', 10, 1 );
function new_registration_email_notification( $user_id )
{
global $current_user;
wp_mail( $multiple_recipients, $subject, $body, $headers );
}
In addition I need to add Google Analytics event in "user_register" hook in order to "catch" all 3 registration ways, I have already understood from here that it supposed to be GA client written in PHP but I don't really see that it will do the work like std GA javascript.
var Register= document.getElementById("Register");
Register.onclick = function() {
ga('send', 'event', 'Register', 'Click/Touch');
Didn't find much info about it, so if somebody could help with some explanation it would be great.