@groupby/elements-gb-tracker-plugin
v0.1.0
Published
This package contains the GroupBy Tracker Plugin class. Its purpose is to provide automatic beaconing integration with Groupby.
Downloads
7
Maintainers
Keywords
Readme
GroupBy Elements GB Tracker Plugin
This package contains the GroupBy Tracker Plugin class. Its purpose is to provide automatic beaconing integration with Groupby.
Prerequisites
This plugin depends on the following Elements plugins:
dom_events
These plugins must be registered either before or in the same batch as this plugin.
Usage
To use the plugin, simply instantiate it and register it with Core:
const gbTrackerPlugin = new GbTrackerPlugin({
customerId: 'my-customer-id',
area: 'some-area',
collection: 'some-collection',
});
core.register(gbTrackerPlugin);
It accepts a mandatory customerId
. It also accepts optional area
and collection
arguments to handle tracking actions against specific areas and collections.
Additionally, the plugin will automatically listen for and act on beacon events. It is designed to work with the other plugins in the Logic Layer.
The plugin registers an instance of the gb-tracker client with Core.
Events
This plugin listens for a number of events.
These events are defined in the @groupby/elements-events
package.
Received
BEACON_SEARCH
: When received, a GroupBy Auto Search beacon is triggered.