Event Specifications integration
The plugin allows you to integrate with Event Specifications for a selected set of plugins. The configuration for the plugin should be retrieved directly from your Data Product in the Snowplow BDP Console.
The plugin will automatically add an Event Specification context to the events matching the configuration added.
note
The plugin is available since version 3.23 of the tracker.
Install pluginโ
- JavaScript (tag)
- Browser (npm)
Tracker Distribution | Included |
---|---|
sp.js | โ |
sp.lite.js | โ |
Download:
Download from GitHub Releases (Recommended) | Github Releases (plugins.umd.zip) |
Available on jsDelivr | jsDelivr (latest) |
Available on unpkg | unpkg (latest) |
window.snowplow(
'addPlugin',
'https://cdn.jsdelivr.net/npm/@snowplow/browser-plugin-event-specifications@latest/dist/index.umd.min.js',
['eventSpecifications', 'EventSpecificationsPlugin']
);
npm install @snowplow/browser-plugin-event-specifications
yarn add @snowplow/browser-plugin-event-specifications
pnpm add @snowplow/browser-plugin-event-specifications
import { newTracker } from '@snowplow/browser-tracker';
import { WebVitalsPlugin } from '@snowplow/browser-plugin-event-specifications';
newTracker('sp1', '{{collector_url}}', {
appId: 'my-app-id',
plugins: [ EventSpecificationsPlugin(/* plugin configuration */) ],
});
Configurationโ
The configuration of the plugin would be in the form of:
- JavaScript (tag)
- Browser (npm)
window.snowplow(
'addPlugin',
'https://cdn.jsdelivr.net/npm/@snowplow/browser-plugin-event-specifications@latest/dist/index.umd.min.js',
['eventSpecifications', 'EventSpecificationsPlugin'],
[
{
[Plugin integration name]: {
/* Key value pairs of event names and event specification ids */
},
/* More integrations */
}
]
);
EventSpecificationsPlugin({
[Plugin integration name]: {
/* Key value pairs of event names and event specification ids */
},
/* More integrations */
});
You can retrieve the configuration for your Event Specifications directly from your Data Product after clicking on the Implement tracking
button.