I am implementing offline call tracking using PHP library of Google Analytics measurement protocol.
I am sending a call as an event with the following configuration:
EVENT CATEGORY:'CallTracking'
EVENT ACTION: 'Call'
EVENT LABEL: 'Caller: %CallerPhone%; Tracking: %TrackingPhoneNumber%; Destination: %DestinationPhone%'
All events are showing up in the stats but my problem is that when I send the same EVENT CATEGORY + EVENT ACTION + EVENT LABEL the number of unique event equals the number of total events, so no grouping is happening. E.g.: I am sending 3 event with the same EVENT CATEGORY + EVENT ACTION + EVENT LABEL combination, in the stats I have 3 total and 3 unique events. I expected to be 3 total and 1 unique.
Ultimately, what I am trying to achieve is that the unique events would be grouped by the CALLER PHONE. Also, I am wondering if the same caller calls twice, does the time interval count in grouping these events?
This is my tracking code:
// Initialize GA Tracker
$tracker = new GoogleAnalytics\Tracker(%ANALYTICS_ID%, %ANALYTICS_HOST%);
// Assemble Visitor information
$visitor = new GoogleAnalytics\Visitor();
$visitor->setIpAddress(%CALLER_IP%);
// Assemble Session information
$session = new GoogleAnalytics\Session();
// Assemble Campaign information
$campaign = new GoogleAnalytics\Campaign();
// ...adding here all the utm stuff and what needed for campaigns
// add campaign information to tracker
$tracker->setCampaign($campaign);
// GA Event Tracking
// This is how eventLabel must look: 'Caller:01234567890; Tracking:01234554321; Destination:01234567899'
$eventLabel = 'Caller: %CallerPhone%; Tracking: %TrackingPhoneNumber%; Destination: %DestinationPhone%';
$eventAction = 'Call';
$eventCategory = 'CallTracking';
$event = new GoogleAnalytics\Event($eventCategory, $eventAction, $eventLabel, $value);
// Track the event
$tracker->trackEvent($event, $session, $visitor);
Thank you!
--Steve
"Unique Events" means "unique events per Session" (so if a visitor triggers an event twice during a session you will have two events and one unique event).
Your code (presumably) starts a new session for every call, which means you only have one event per session. That in turn means the number of events is identical to the number of unique sessions.