2

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.

Community
  • 1
  • 1
Nick
  • 129
  • 1
  • 12
  • If yours social plugin runs the native social platform api, maybe you can use its events. Check: https://developers.facebook.com/docs/plugins/login-button#settings I think it's better to maintain the event trigger at the client side. – Diego ZoracKy May 06 '15 at 21:56
  • i am using ONEALL wordpress plugin for Social Netwrok connection ,, found some hook's that happens after new user registered function oa_social_login_do_after_user_insert ($user_data, $identity) tried to add some basic javasript to see if it's working but it's not probably because it's running on the server side too.... i am kinda despaired because can't find any solution about this issue ... – Nick May 07 '15 at 15:01

1 Answers1

0

This may be of use to you: Track event in google analytics upon clicking form submit

I know there is tracking for on-click submissions, I didn't see much on the resource link you provided.

edit: By creating a callback on the submit button, you can track your registers that way.

Community
  • 1
  • 1
chronotrigga
  • 589
  • 1
  • 10
  • 33
  • 1
    this is not enough because I don't have access to the social login button that provided with plugin ,, I need somehow to trigger it through the "user_register" hook ... – Nick May 06 '15 at 13:40