thomasbachem / php-ga

Server-Side Google Analytics PHP Client
Other
317 stars 100 forks source link

FIX Notice: Undefined property: page #5

Closed jorgetutor closed 11 years ago

jorgetutor commented 11 years ago

Test: $tracker = new UnitedPrototype\GoogleAnalytics\Tracker($ua, $host); $visitor = new UnitedPrototype\GoogleAnalytics\Visitor(); $visitor->setIpAddress($_SERVER['REMOTE_ADDR']); $visitor->setUserAgent($_SERVER['HTTP_USER_AGENT']); $session = new UnitedPrototype\GoogleAnalytics\Session(); $event = new UnitedPrototype\GoogleAnalytics\Event(); // Required: $event->setCategory('category'); $event->setAction('action');

// Optional: $event->setLabel('label'); $event->setValue(1);

$tracker->trackEvent($event, $session, $visitor);

Error (Notice):

UnitedPrototype\GoogleAnalytics\Internals\Request\EventRequest::$page in UnitedPrototype\GoogleAnalytics\Internals\Request\EventRequest->buildParameters() (line 91 of /{my_site}/sites/all/libraries/php-ga/src/GoogleAnalytics/Internals/Request/EventRequest.php).