Forums » Help & Troubleshooting



Tracking custom data

Hello,
I have access to php code of my site (Guppy cms),
with the variable $userprefs[1] I can grab the login name of the users but i don't know how customize the example code i find in the help page (Tracking custom data)

It's possible have the login name in my logs?
Thanks,
Zadok

Posted Mon Sep 15 2008 12:53p by italiam***


How about like this? Use php to echo the javascript and this line should work if $userprefs[1] returns the logged in users name.

var clicky_custom_session = { username: '".$userprefs[1]."' };

Posted Mon Sep 15 2008 1:26p by punko***


Yeah, just be sure to wrap that with a <script> tag, and it also has to go BEFORE your tracking code.

Posted Mon Sep 15 2008 1:28p by Your Friendly Clicky Admin


i try adding this code but seems dont work, no login name appear...
what's wrong?


[?php
if( isset( $_SESSION['user']['username'] )) {
echo "
[script type='text/javascript']
var clicky_custom_session = { username: '".$userprefs[1]."' };
[/script]n";
}
?]
[script src="http://static.getclicky.com/12345.js" type="text/javascript"][/script]

Posted Tue Sep 16 2008 4:07p by italiam***


please note that in the code above i used
[ and ]
to not be blocked ;)

Posted Tue Sep 16 2008 4:12p by italiam***


ok solved deleting

if( isset( $_SESSION['user']['username'] )).

really cool.

Posted Tue Sep 16 2008 4:21p by italiam***


Glad you got it working.

Posted Tue Sep 16 2008 9:21p by Your Friendly Clicky Admin


Hi,
I need to track my users's information(name, email, mobile etc), but I get this entire data on submit of a form. This submit is handled by a Javascript function. SO I put the "var clicky_custom_session = { .... " in that function by assigning all my values to your clicky variable. But the visitor info does not show up on clicky. Pls help

Thanks,
Vidya

Posted Wed Oct 22 2008 2:32a by TrilogyIn***


That won't work. The variable need to be declared before the tracking code runs, which it wouldn't in this case. What you could do is after the submit, direct them to a new page, and then output those values on that page instead, before the tracking code.

Posted Wed Oct 22 2008 9:07a by Your Friendly Clicky Admin


OK. I'll try that. Many thanks for your reply.

Vidya

Posted Thu Oct 23 2008 7:49a by TrilogyIn***


Hi,
I did as you directed me, I put the "var clicky_custom_session = { .... " code in my Thank You page where the data for the parameters comes from the "request.getParameter("")' object.

My clicky script is at the end of the page. But my custom data is still not recorded in Clicky.
However, if I directly write the following, my data reflects in Clicky

" var clicky_custom_session = {username: 'ABC'};"

Pls suggest.

Vidya

Posted Tue Nov 4 2008 9:40a by TrilogyIn***


Can I get the tracking code again

Posted Sun Mar 1 2015 12:05a by agr***


You must be logged in to your account to post!