Event Collection

Event Collection In Web SDK

In order to collect website events and use that data to create behavioural segments in D·engage you have to determine the type of events and data that needs to collect. Web SDK provides some functions to collect page view events and ecommerce events.

But if you need custom events then you need to create a “Big Data” table in D·engage admin panel. Collected events will be stored in this table. Multiple tables can be defined depending on your specific need. Any type of event can be collected. The content and the structure of the events are completely flexible and can be changed according to unique business requirements. You will just need to define a table for events.

User Identification

If you have a user id for logged in user. You should set that information to the Web SDK. You can have this code anywhere in your page.

dengage('setContactKey', 'userid123');

Dengage WebSDK generates its own device_id for each visitor and each browser. If you want to use your own identifier for device_id. You can pass it on the initialize method.

dengage('initialize', { deviceId: customDeviceId });

Also if you have contact_key data at the start, you can pass it on the initialize method. You can still use the setContactKey method.

dengage('initialize', { contactKey: userId });

And if you want to pass them together you can use it like this:

dengage('initialize', { deviceId: customDeviceId, contactKey: userId });

Dengage WebSDK starts doing its tasks with the initialize method. When you pass user identifiers on the initialize, SDK uses the data you provided on its tasks from the start. Any task that requires these identifications are going to be correct and consistent from the start.If you have these identifiers before calling the initialize method we recommend using this approach.