br33f / php-GA4-Measurement-Protocol

PHP GoogleAnalytics4 Measurement Protocol Library
88 stars 19 forks source link

Debugging with Google Analytics DebugView #38

Closed joerg-thode closed 1 year ago

joerg-thode commented 1 year ago

Does anyone have a tip on how to use the DebugView in GoogleAnalytics-Account with this repro?

My Problem is that no errors occur by ... (purchase)

$baseRequest->addEvent($eventData);
$debugResponse = $ga4Service->sendDebug($baseRequest); $ResponseCode = $debugResponse->getStatusCode(); $ResponseMsg = $debugResponse->getValidationMessages(); $ResponseData = $debugResponse->getData();

ResponseCode 200

I tried to set this before, but i can see nothing @ DebugView

$eventData = new PurchaseEvent(); $eventData->setParamValue("debug_mode", "1");

FabianoLothor commented 1 year ago

I didn't dig into this yet, but you probably need to specify the debug_mode in the list of parameters.

image

br33f commented 1 year ago
$eventData = new PurchaseEvent();
$eventData->setParamValue("debug_mode", "1");

What you mentioned in your comment is a correct way to set a param "debug_mode" in event parameters. If it does not work, you should look for the problem elsewhere, but the code itself is correct.

I belive you can also set a debug_mode globaly in Google Analytics data source configuration.