You are here

private function Telemetry::createEvent in Lightning Core 8.4

Same name and namespace in other branches
  1. 8.3 modules/acquia_telemetry/src/Telemetry.php \Drupal\acquia_telemetry\Telemetry::createEvent()

Creates an Amplitude event.

Parameters

string $type: The event type.

array $properties: The event properties.

Return value

array An Amplitude event with basic info already populated.

1 call to Telemetry::createEvent()
Telemetry::sendTelemetry in modules/acquia_telemetry/src/Telemetry.php
Creates and sends an event to Amplitude.

File

modules/acquia_telemetry/src/Telemetry.php, line 190

Class

Telemetry
Telemetry service.

Namespace

Drupal\acquia_telemetry

Code

private function createEvent($type, array $properties) {
  $default_properties = [
    'extensions' => $this
      ->getExtensionInfo(),
    'php' => [
      'version' => phpversion(),
    ],
    'drupal' => [
      'version' => \Drupal::VERSION,
    ],
  ];
  return [
    'event_type' => $type,
    'user_id' => $this
      ->getUserId(),
    'event_properties' => NestedArray::mergeDeep($default_properties, $properties),
  ];
}