ComputerMinds Data Layer
18 sites
Security covered
Drupal 9–11
This module provides a service to send data and events from the server to the client-side data layer. This can be useful for integrations with analytics or tag management systems.
This module provides a messenger-like service for pushing events/data into the client side data layer.
Usage
The intended use of this module is through the cm_data_layer.data_layer service eg.
\Drupal::service('cm_data_layer.data_layer')->push([
'event' => 'myEvent',
'data' => [
'some_key' => 'some_value',
],
]);
Or more realistically, you'll oftentimes be in an event subscriber where the service can be an injected dependecy:
$this->dataLayer->push([
'event' => 'myEvent',
'data' => [
'some_key' => 'some_value',
],
]);
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.