Visitor Stats 2 logo Useful Variables. Visitor Stats 2

Handy code to use on your website

 

Here is a list of all the different variables (var) you can get out of Visitor Stats, most of them on any page at any time.

E.g. you might want to show returning visitors a special, so if $visit>1, show special!

Name PHP Example
What this var does The code to use An example using your details
Visitor     1st Visit 2nd + Session
First visit: $first_visit Y yes yes yes
User id: $vistats_user 110879 yes yes yes
User visit no: $visit 1 yes yes  
User ip: $user_ip yes    
User language: $my_user_language en-us,en;q yes    
User country: $my_user_country United States yes    
User country code: $my_user_country_code US yes    
User computer: $my_user_computer Other yes    
User browser: $my_user_browser Other yes    
User OS: $my_user_os Other yes    
           
Robot          
Is robot: $my_robot Y yes    
Robot info: $my_robot_info yes    
           
Pages          
Page number: $my_page_visit_order 1 yes    
Page name: $my_page_name /support/features_code.php yes    
Page from: $my_page_from yes    
Page started: $my_page_start_time 1210362532 yes    
Time on page: $tmp_total_time yes    
           
Referrer / Search Engine          
Page from: $my_page_from yes yes  
Short referrer: $my_se_url yes yes  
Referrer is search engine: $my_se yes yes  
Search engine name: $my_se_name yes yes  
Search engine url: $my_se_url yes yes  
Search engine keywords: $my_se_keywords yes yes  

KEY
1st Visit: This var will only show up on the users 1st visit, mostly on the 1st page of the first visit (see Session).
After this, the user has a cookie and a session set which identifies the user to their profile in the database

2nd +: This var will show up on the users second 2nd and subsequent visits. Again, mostly on the 1st page of the visit (see Session).

Session: This var will show up every page, of every visit.