I am tracking a goal (actually, just the page view) in a PHP redirect (HTTP 302) script using the PHP API with the following code:
PiwikTracker::$URL = 'http://'.$_SERVER['HTTP_HOST'].'/piwik/'; $piwikTracker = new PiwikTracker(1); $piwikTracker->setUrl($_SERVER['REQUEST_URI']); $piwikTracker->doTrackPageView('<Page Title>');
This works fine so far. The Problem now is, that the users leave site for one page view before calling this PHP redirect page, like in the following diagram:
'Entrypage X, Piwik-enabled Site' -> 'Custom Page Y, Piwik-enabled Site' -> ... -> 'Custom Page Z, Piwik-enabled Site' -> 'External Page View' -> 'PHP Redirect Page, Piwik-enabled Site'
That means, that all the session information (referer, viewing time, …) from the piwik tracking is lost, and the users are recorded as a new visit coming from ‘External Page’. Is there any way to pass or re-attach the previous visiting session in the PHP redirect page?