Forums » Help & Troubleshooting



Tracking Wordpress Registrations

Hey,

I'm trying to get Clicky to track registrations on my wordpress site. Right now, I have a goal configured with the goal URL as "/wp-login.php?action=register". Unfortunately, this goal has never been completed, despite many people registering for the site.

I believe the issue is that Clicky cannot put a tracking code on that page. Does anyone have any advice for how to fix this? It seems like a common use case for a wordpress site

Posted Mon Sep 7 2015 4:03p by VRtub***


I believe you're right. What page do you have the user go to after they register? You might be able to use that as a goal, if it is part of your theme. That said, there are ways to modify the registration page, you may just have to write the code yourself rather than use a standard plugin.

Posted Mon Sep 7 2015 11:53p by intellisp***


So the registration page is [my domain]/wp-login.php?action=register and once registration is completed they go to [my domain]/wp-login.php?action=rp&key=*. I have both set up as goals, but neither appear to be registering. Do you know how I'd go about adding the clicky code to those pages? It doesn't appear that either of these pages is in my theme

Posted Tue Sep 8 2015 12:21p by VRtub***


Looks like it can be done with the registation_form hook via plugin. More info here: https://codex.wordpress.org/Customizing_the_Registration_Form

Posted Tue Sep 8 2015 5:19p by intellisp***


Thanks for the info intellisphere.

Unfortunately I have very little experience in php, so I'm a bit hesitant to make something like that for a live site.

Are there any other options? It really seems like something that would be supported by Clicky

Posted Wed Sep 9 2015 12:42a by VRtub***


I ended up getting it to work by putting the following code in the functions.php file of my active child theme.

add_action('login_enqueue_scripts', 'clicky_tracking_code');
function clicky_tracking_code(){
if ( !is_admin()){
?]
[script src="//static.getclicky.com/js" type="text/javascript"][/script]
[script type="text/javascript"]try{ clicky.init(XXXXXXX); }catch(e){}[/script]
[noscript][p][img alt="Clicky" width="1" height="1" src="//in.getclicky.com/XXXXXXX.gif" /][/p][/noscript]
[?php

}
}

Where XXXXXXX is my tracking ID and all "[" & "]" are a replacement for the correct character (ASCII 60 & 62) which I can't write because of this forum's html restrictions. Unfortunately is_admin() is entirely superfluous here as it always returns false when trying to access the wp-login page according to https://codex.wordpress.org/Function_Reference/is_admin, not sure how to fix that

Thanks for the advice intellispire (I spelled your name incorrectly last post--sorry about that)

Posted Tue Sep 15 2015 12:37p by VRtub***


You must be logged in to your account to post!