laravel-gamp
laravel-gamp copied to clipboard
setUserId doesnt work
I cannot seem to get setUserId to work.
The package this extend (https://github.com/theiconic/php-ga-measurement-protocol#usage) allows for setUserId as well as setClientId. But it seems using setUserId
doesnt seem to work.
Any idea why this is?
Please share your current code, it'll help in debugging the issue.
Thanks for the reply.
So this works as expected:
$gamp = GAMP::setClientId( $userId );
$gamp->setEventCategory($category)
->setEventAction($request->route()->getName())
->setEventLabel($label)
->setIpOverride($request->getClientIp())
->sendEvent();
But this does not work:
$gamp = GAMP::setUserId( $userId );
$gamp->setEventCategory($category)
->setEventAction($request->route()->getName())
->setEventLabel($label)
->setIpOverride($request->getClientIp())
->sendEvent();