Membership Plugin - Page views counter

By claire - November 12, 2014

Hey there - this is actually relatively simple. All you should need to do is create the field in the member record section - page visits, let's say, and give it a default value of 0 - and then add a piece of code to load on every page that you want to track that detects the $CURRENT_USER['num'] and increments the page visits count if it exists.

It'd look something like this:

if(isset($CURRENT_USER['num'])) {
    mysql_update('members', $CURRENT_USER['num'], null, array('page_visits' => $CURRENT_USER['page_visits']+1));
}

This assumes that your members table is called 'members', of course.

Does that help? You would also probably want to do some data analysis on the page visits info later, but that would require more custom code. This will just record the visits so you can see the count when you look at an individual user.

--------------------

Claire Ryan
interactivetools.com

Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By zip222 - November 13, 2014

Perfect. Easy and exactly what I was looking for. Thanks!