StatCounter User Forum  
StatCounter Free web tracker and counter

Go Back   StatCounter User Forum > > Help

Closed Thread
Thread Tools Display Modes
Old 04-24-2012, 01:13 PM
jpastor jpastor is offline
Junior Member
Join Date: Apr 2012
Posts: 1
Default Session Cookie lifetime - Statcounter doesn't count every visit to my website?

I've set up an interstitial ad on my website (WordPress 3.3.2 on Nginx+PHP-FPM+MySQL) through the use of a little trick:

The index.php file checks if there is a new session, and in this case we load the interstitial and we set up a session cookie lifetime of 300 seconds (5 mins) in order to display the ad from time to time. The code is as follows:


if (!empty($_SESSION['count']) || stristr($_SERVER['REQUEST_URI'], 'feed')) {
   define('WP_USE_THEMES', true);

} else if(empty($_SESSION['count'])){
    $_SESSION['count'] = 1;
... here goes the interstitial script ...
This makes the ad appear if there was a new session, or go to the content straight away if the session was still active and the counter is below that 300 seconds.

There's a little problem with this, though: Statcounter is counting much less pageviews and uniques that we really have, and I think there's some problem with the session.cookie_lifetime parameter.

I wonder if this is really the reason, or if you may know why the statistics aren't real... it's like if statcounter only is updated each 5 mins??? I really don't understand why is this happening.
Old 04-25-2012, 01:43 AM
Rory_A's Avatar
Rory_A Rory_A is offline
Active Member
StatCounter Team
Join Date: Apr 2008
Posts: 385


Strange situation! What's the url for your site?

Knowledge Base - Open Support Ticket - Twitter - Blog - Email : support (at) statcounter (dot) com
Closed Thread

advertising, cookies, nginx, statistics, wordpress

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT. The time now is 08:33 AM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2017, vBulletin Solutions, Inc.