im trying to get this script running only if the session is not started yet. The page reload it self after the user click in some options. But the infor to google analytics must be send only the first time when the session start. The script is working but the analytics are wrong, 'cause it send several times the same session.
PHP SCRIPT:
if (session_id() === "") {
echo time();
session_start();
include('ss-ga.class.php');
$ssga = new ssga( 'UA-10536XXXX-1', 'www.site.com' );
//Set a pageview
$ssga->set_page( 'b1.php' );
$ssga->set_page_title( 'b1' );
// Send
$ssga->send();
$ssga->reset();
}
the IF(SESSION_ID==="") and if (session_status() == PHP_SESSION_NONE)