theiconic / php-ga-measurement-protocol

Send data to Google Analytics from the server using PHP. Implements GA measurement protocol.
MIT License
655 stars 135 forks source link

Verify events in realtime? #35

Closed timbroder closed 7 years ago

timbroder commented 7 years ago

Hello,

Trying to track down where my issue might be. Should I be able to see events I send in the real-time part of GA?

I'm using laravel-gamp and sending:

$gamp = GAMP::setClientId($clientId);
        $gamp->setEventCategory($category)
            ->setEventAction($eventAction)
            ->setEventValue($value)
            ->sendEvent();

But not seeing over anything in GA.

I've verified I'm using the right tracking id. $value is an int, not sure if that's a problem.

The response I get is:

TheIconic\Tracking\GoogleAnalytics\AnalyticsResponse {#1296
  #httpStatusCode: 200
  #requestUrl: "https://ssl.google-analytics.com/collect?v=1&tid=UA-######-2&aip=1&cid=kidfund.local&ec=BackendMetric&ea=users_full_num_total&ev=15&t=event"
  #responseBody: b"GIF89a\x01\x00\x01\x00€ÿ\x00ÿÿÿ\x00\x00\x00,\x00\x00\x00\x00\x01\x00\x01\x00\x00\x02\x02D\x01\x00;"
}

Is that expected?

Thanks

timbroder commented 7 years ago

Nevermind. I was looking at a dashboard that was bound to unique user id and these events don't specify a user