StatCounter User Forum  
StatCounter Free web tracker and counter

Go Back   StatCounter User Forum > StatCounter.com > Help

Closed Thread
 
Thread Tools Display Modes
  #1  
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:

Code:
<?php
ini_set('session.cookie_lifetime','300');
session_start();

if (!empty($_SESSION['count']) || stristr($_SERVER['REQUEST_URI'], 'feed')) {
   define('WP_USE_THEMES', true);
   require('./wp-blog-header.php');

} 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.
  #2  
Old 04-25-2012, 01:43 AM
Rory_A's Avatar
Rory_A Rory_A is offline
Member
StatCounter Team
 
Join Date: Apr 2008
Posts: 251
Default

Hi,

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

Regards
__________________
Rory
StatCounter Team


- Knowledge Base -
Help Forum - Getting Started Guide - Open Support Ticket - Service Status - Twitter - Blog -
Closed Thread

Tags
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 01:17 AM.


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