This plugin utilizes an API to post additional events or page-views manually. Used mainly for goal and coversion tracking.
To use it, first you have to create GoogleAnalytics a service object:
<?php $gaService = \Plugin\GoogleAnalytics\JsService::instance(); ?>
<?php $gaService = \Plugin\GoogleAnalytics\PhpService::instance(); ?>
Track a pageview
<?php $gaService->trackEvent('/example.html'); ?>
'/example.html' may event not exist. But it has to start with a slash.
see https://developers.google.com/analytics/devguides/collection/analyticsjs/pages for more details
Track an event
<?php $gaService->trackEvent('Category', 'acttion', 'label', 'value'); ?>
see https://developers.google.com/analytics/devguides/collection/analyticsjs/events for more details
<<< IT MAY TAKE SEVERAL HOURS FOR NEW DATA TO APPEAR IN GOOGLE ANALYTICS! >>>