Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom event parameters not visible in GA4 #41

Open
aldos84 opened this issue Jan 9, 2024 · 0 comments
Open

Custom event parameters not visible in GA4 #41

aldos84 opened this issue Jan 9, 2024 · 0 comments

Comments

@aldos84
Copy link

aldos84 commented Jan 9, 2024

When I trigger a event call I can see the eventname, but no parameters and I cant see any issues in my code

index.php

$res = $ga4->sendEvent([
  'action' => 'test_event',
  'category' => 'mock',
  'label' => 'name',
  'value' => 1
]);

ga4.php

public function sendEvent($data) {
    $request = new BaseRequest($this->clientId);

    $event = new BaseEvent();
    $event->setName($data['action']);
    $event->addParam('event_category', new BaseParameter($data['category']));
    $event->addParam('event_label', new BaseParameter($data['label']));
    $event->addParam('event_value', new BaseParameter($data['value']));

    $collection = new EventCollection();
    $collection->addEvent($event);

    $request->setEvents($collection);
    return $this->ga4Service->send($request);
}

In GA4 I can see this event but no parameters
Screenshot 2024-01-09 at 16-13-53 Analytics Realtime overview

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant