Increment user meta data by 1 each time a page is visited

This line is wrong.

if(!get_user_meta(bp_displayed_user_id(), 'page_visits', true) >= 0){

That is “not value greater than or equal to zero”. The NOT operator has precedence over the greater than comparison.

So, assuming the value is a number, then NOT a number evaluates to false. Then you are comparing false to greater than or equal to zero. False == zero, so this evaluates to true, which means that in your next line, you set it explicitly to zero.

So, the operator precedence is likely screwing you up. Try adding parentheses around your comparison before negating it.

if ( !( get_user_meta( bp_displayed_user_id(), 'page_visits', true ) >= 0 ) ) {

Also, counting page visits in user meta like this is fairly horrible for performance. Best to use some other real analytics solution.