Action types for web extensions

Note: Adobe Experience Platform Launch is being rebranded as a suite of data collection technologies in Experience Platform. These changes will be rolling out across all product documentation in the coming weeks. Please refer to the following document for a consolidated reference of the terminology changes.

An action type library module is intended to take an action–any action. What this action does is entirely up to you. Do you want to send a beacon, show an offer, thank the user for visiting, save a cookie, or open a support chat?

IMPORTANT

This document covers action types for web extensions. If you are developing an edge extension, see the guide on action types for edge extensions instead.

This document also assumes you are familiar with library modules and how they are integrated in Platform Launch extensions. If you require an introduction, see the overview on library module formatting before returning to this guide.

module.exports = function(settings) {
  alert('Thanks for visiting our site!');
};

Now, consider a situation where you want to make the message configurable by the Adobe Experience Platform Launch user. You could allow the user to input a message and then save the message to the settings object, with the object looking something like this:

{
  "message": "Thank you for being one of our VIP members!"
}

In order to operate on the user-defined message, your module would need to change to this:

module.exports = function(settings) {
  alert(settings.message);
}

Contextual event data

A second argument is passed to your module which contains contextual information regarding the event that fired the rule. It may be beneficial in certain cases and can be accessed as follows:

module.exports = function(settings, event) {
  // event contains information regarding the event that fired the rule
};

The event object must contain the following properties:

Property Description
$type A string describing the extension name and event name, joined using a period. For example, youtube.play.
$rule An object containing information about the currently executing rule. The object must contain the following sub-properties:
  • id: The ID of the currently executing rule.
  • name: The name of the currently executing rule.

The extension providing the event type that triggered the rule may optionally add any other useful information to this event object.

On this page