You are here

protected function FacebookEvent::addSessionEvent in Facebook Pixel 8

Adds an event for sessioned users.

Parameters

string $event: The event type.

string|array $data: The data to send with the event.

Throws

\Drupal\Core\TempStore\TempStoreException

1 call to FacebookEvent::addSessionEvent()
FacebookEvent::addEvent in src/FacebookEvent.php
Register an event.

File

src/FacebookEvent.php, line 96

Class

FacebookEvent
Helper methods for facebook_pixel module.

Namespace

Drupal\facebook_pixel

Code

protected function addSessionEvent($event, $data = '') {
  $storage = [];
  $storage += (array) $this->privateTempStore
    ->get('facebook_pixel');
  $storage[] = [
    'event' => $event,
    'data' => $data,
  ];
  $this->privateTempStore
    ->set('facebook_pixel', $storage);
}