Hello,
those of you who want to apply segmentation tracking in Google Analytics for your forums guests vs. members, you can use __utmSetVar() function for that.
That function sets the cookie for visitors, so it is enough to put this on the login page only, find this in functions_vbseo.php file:
and add above:PHP Code:if(THIS_SCRIPT == 'register')
PHP Code:if(THIS_SCRIPT == 'login' && $GLOBALS['bbuserinfo']['userid'])
{
$newtext = preg_replace('#(</body>)#is','
<script type="text/javascript">
pageTracker._setVar("member");
</script>
'.'\\1',$newtext,1);
}
That will not affect users that are already logged in though (or have "remember me" enabled), so if you want to apply it for every page load for members, the code would be:
PHP Code:if($GLOBALS['bbuserinfo']['userid'])
{
$newtext = preg_replace('#(</body>)#is','
<script type="text/javascript">
pageTracker._setVar("member");
</script>
'.'\\1',$newtext,1);
}
Note: make sure that you applied updated Google Analytics code as described in New Google Analytics Code



LinkBack URL
About LinkBacks





Reply With Quote

