Web SDK

Web SDK

This FAQ part answers questions about WEB SDK and Web Events.

How can I define custom events through Web SDK?

The first step is to prepare the table where the events to be collected will be transferred. Once the table feeding the event is set up, you can trigger the custom event from either the website or mobile application based on the columns in the table, using the function below. The table opened should be of type 'Big Data Table.' Please check Tables section to learn about how to create Big Data Tables.

var eventData = {
event_name: 'purchase',
product_id: 12345,
product_name: 'computer'
};
dengage('sendDeviceEvent', 'events', eventData);

In the example provided: The term "'event_name'" represents the name of a column in the big data table you have opened. The value "'purchase'" next to it signifies the value to be fed into this column for the respective event. Thus, each column in the table you have created specifies a parameter in the JS code. The term "'events'" at the bottom line should denote the name of the table you have created.

For further information regarding custom events, you can refer to the technical documentation here: Custom Events Technical Documentation

Note: Upon creating the Big Data table, the 'key' and 'event_date' fields are automatically generated. When triggering events, it is unnecessary to send 'key' and 'event_date' within the function, as these two columns are populated by the SDK.

How can I implement Web SDK?

After creating and saving the website application (as outlined in the guide "How to create Web SDK and Service Worker File (SWF)?"), navigate to More > Setup Guide to access the Web SDK. Copy this code and insert it into the <head> tag of every page on the website. This insertion can be done either through GTM or directly into the source code.

If there are subdomains where you wish to implement the Web SDK, ensure they are added to the application by clicking "+ Add Domain."

You can refer to the documentation here: Web Push SDK Setup Documentation

👍

Identify contact

As detailed in the documentation, if your website includes a login function, it's necessary to implement "setContactKey" to facilitate matching between the device and the contact. The "contact key" serves as the unique identifier for contacts within the Dengage CDMP platform.

❗️

Double Service Worker File

If there exists a service worker file from another provider, it must be removed before adding the Dengage service worker file. Additionally, even after removing the service worker file, the push prompt might still appear due to settings from the previous provider. Ensure that these prompts are disabled so that only the Dengage SDK runs for displaying prompts and generating tokens.

Should we include the same SDK for our mobile site, considering that it operates on a separate domain?

Certainly, it's advisable to utilise distinct SDKs for each site. If the web URLs differ, we ought to establish separate web applications for both mobile and desktop websites.

How to identify contacts through Web SDK

If your website includes a login function, it's necessary to implement "setContactKey" to facilitate matching between the device and the contact. The "contact key" serves as the unique identifier for contacts within the Dengage CDMP platform.Use the following syntax:

dengage('setContactKey', your_contact_id);

Since the mobile app essentially mirrors the content and functionality of the website, should I duplicate events in the app as well?

If your mobile app is a mobile screen sized view of your website and the events capturing script have already been added/Integrated in the website code then you do not need to add the the events script again for the mobile app.

    • Related Articles

    • Web Login

      This page allows you to restrict access to your web interface login. Logging in through the Web Interface is a crucial security matter. Anyone who gains access to your account can control various elements like your audience, segments, campaigns, etc. ...
    • Mobile SDK

      Should we duplicate our events within the mobile app if it essentially serves as the mobile view of our website? If your mobile app mirrors the layout of your website for mobile screens and the event capturing script has already been incorporated ...
    • Develop your own WEB API

      The Dengage Platform can invoke your Custom Web APIs during the audience export process. This section outlines the format of the data sent by the Dengage Platform, providing the necessary details for you to develop a function that receives and ...
    • General

      The "Onboarding and Setup" section of our product documentation provides users with a detailed guide through the initial configuration and deployment of our platform. This section is meticulously designed to ensure a smooth start, offering ...
    • Applications

      The Settings section in Dengage offers a variety of tools to manage and integrate different aspects of your account. One important feature is the ability to integrate applications within the platform. This functionality provides an overview of ...