1 (edited by lament 2007-06-12 18:34)

Topic: Punbb and Reinvigorate stats tracking

Hey all,

I'm trying to get Reinvigorate's Name Tag function working.

Here's info about how Name Tags work:

Name Tags are an easy way to identify exactly who your visitors are.

It works by associating information your site manages (username, e-mail, account ID, etc..) with the session ID Reinvigorate uses to track visitors on your site/blog.

It's extremely simple to setup, even if your site uses its own proprietary user account system. 1-2 extra lines of code and we take care of the rest.

Reinvigorate uses two global JavaScript variables which let you customize your visitors Name Tags, re_name_tag and re_context_tag. The re_context_tag variable is optional and may be left out. It's provided in case you want to associate additional information with your visitors (ie- Username/Email, Username/Website, etc..). If you use re_context_tag, e-mail and website addresses should be respectively prefixed with mailto: or http://

Name Tag Code

You will need to write server-side code to output a visitor identifier, something like the code below. This code must be placed above the function call to re_("...");

var re_name_tag = "Username/Identifier";

For example, the following pseudo PHP code shows how one might use re_name_tag. The code is based on two assumptions. First, the PHP variable $is_logged_in is set to true if a user is logged in. Second, the variable $username contains a users username.

var re_name_tag = "<?php
echo $is_logged_in ? $username : "";
?>";

After installing code like above, Reinvigorate will automatically detect the change and display name tags on any applicable report.

So I'm wondering what the punbb session variable for user is, and what the $is_logged_in variable is actually named?

Thanks!

Re: Punbb and Reinvigorate stats tracking

User information is stored in the $pun_user array. To check if a user is logged in, use $pun_user['is_guest'].

Re: Punbb and Reinvigorate stats tracking

great thanks.. and for the actual username variable, that would be $pun_user['username'] correct?

Re: Punbb and Reinvigorate stats tracking

Yes

Moved to Integration

5 (edited by lament 2007-06-13 01:15)

Re: Punbb and Reinvigorate stats tracking

thanks Smartys and elbekko.. i also figured out that i should be using if(!$pun_user['is_guest']) and not if($pun_user['is_guest']) . wink

Re: Punbb and Reinvigorate stats tracking

You could also check PunSAPI, it simplify (it's already quite simple, as I've discovered, but still) many number of things in those area.

Re: Punbb and Reinvigorate stats tracking

Cool. Any luck with this? I've been wanting to do the same with my board since I also have a Reinvigorate account. Do you have any code examples? Thanks!

Re: Punbb and Reinvigorate stats tracking

NetworkShadow wrote:

Cool. Any luck with this? I've been wanting to do the same with my board since I also have a Reinvigorate account. Do you have any code examples? Thanks!

<script type="text/javascript" src="http://include.reinvigorate.net/re_.js"></script>
<script type="text/javascript">
//<![CDATA[
var re_name_tag = "<?php
if(!$pun_user['is_guest']) 
{
    echo $pun_user['username'];
}
?>
";
re_("your-reinvigorate-code");
//]]>
</script>

Re: Punbb and Reinvigorate stats tracking

Thanks so much!

Re: Punbb and Reinvigorate stats tracking

This code doesn't seem to be working. It hasn't been tracking. Any ideas?