Skip to main content

Web destinations

Like the web client walker.js, the web destinations run in a users browser directly. It's purpose is to initialize a destination, map event data to the destination's requirements, and send them.

A destination receives events through the push interface. Configurations can be made in the config object. The optional init function gets called before actually pushing events and has to return true on proper initialization to enable event processing.

Installation

There are different ways to install a web destination:

  • TypeScript: Install the destination package and import it in your code.
  • Script: Load the destination mjs module with a script tag.
  • Code: Download/copy the browser file and include it directly in your code. This will create a Destination object in the global namespace.

Configuration

Each destination requires its own configuration. All settings are optional and can be omitted. Besides common settings like consent, id, and others, there are also individual settings only available for a specific destination in the custom object and mapping.

The individual Custom settings and EventConfig in the mapping used for event specifications. All configuration definitions, and examples are available in each destination's detail page.

Create your own

Instead of using the pre-built destinations, you can also create your own. A valid WebDestination.Destination consists of a config object, and the two methods init and push. The following examples shows how to create a destination for the web.

A very basic console destination:

elb('walker destination', { push: console.log });

A basic destination setup looks like this.

var destination = {
config: {},
init: function (config) {
// Do something initializing
// window.xxx = console.log;
return true;
},
push: function (event, config, mapping) {
// Do something magical
// window.xxx({ event, config, mapping });
},
};
// Add the destination to walker.js
elb('walker destination', destination, config);

Available destinations

If you can't find your desired destination, you can request it.