Skip to content

Custom event parameters not visible in GA4 #41

@aldos84

Description

@aldos84

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions