theiconic / php-ga-measurement-protocol

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

DebugResponse return null and no data send to GA #98

Open jripmeester opened 3 years ago

jripmeester commented 3 years ago

Hi,

I've have a weird problem that some orders of our webshop aren't send to GA. I've managed to find out when the data isn't send but then when i try to get the debug response it's null. When an order is sent to GA the response is nicely though. So the sending is failing somewhere butt i can't debug where.

This is my sending line of code $analytics->setProductActionToPurchase(); $response = $analytics->setDebug(true)->setEventCategory('Checkout') ->setEventAction('Purchase')->sendEvent();

Can you point me in the direction to debug this? I can't add var_dumps in the code as the method are not physically in the code.

piotrknapik commented 3 years ago

@jripmeester I have the same issue - it looks like the library doesn't work with GA4 (vide: https://github.com/theiconic/php-ga-measurement-protocol/issues/94).

jripmeester commented 3 years ago

@piotrknapik Except we are not using GA4

sblawrie commented 1 year ago

@jripmeester I'm also having this issue (with Universal Analytics, not GA4). Did you ever figure out what was wrong?

jripmeester commented 1 year ago

@sblawrie No i didn't. Ended doing the implementation on JS side.