Appendix

Naming rules

The value of any name field within extension.json must comply with the following rules:

  • Must be less than or equal to 214 characters
  • Must not start with a dot or an underscore
  • Must not contain uppercase letters
  • Must only contain URL-safe characters

These are consistent with npm package name rules.

Configuration object properties

The configuration object should be structured as follows:

PropertyDescription
viewPathThe relative URL to the extension configuration view. It should be relative to viewBasePath and should not begin with a slash. It must reference an HTML file with a .html extension. Query string and fragment identifier (hashes) suffixes are acceptable.
schema

An object of JSON Schema describing the format of a valid object being saved from the extension configuration view. Since you are the developer of the configuration view, it is your responsibility to ensure that any settings object saved matches this schema. This schema will also be used for validation when users attempt to save data using Experience Platform services.

An example schema object is as follows:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "delay": {
      "type": "number",
      "minimum": 1
    }
  },
  "required": [
    "delay"
  ],
  "additionalProperties": false
}

We recommend using a tool like JSON Schema validator to manually test your schema.

transforms (Optional)An array of objects where each object represents a transformation that should be performed on every corresponding settings object when it is emitted into the runtime library. See the transforms section for more information on why this may be needed and how it is used.

Type definitions

A type definition is an object used to describe an event, condition, action, or data element type. The object consists of the following:

PropertyDescription
nameThe name of the type. This must be a unique name within the extension. The name must comply with naming rules. This is used by tags as an identifier and should not be changed after you publish your extension.
displayNameThe text that will be used to represent the type within the Data Collection user interface. It should be human-readable.
categoryName (Optional)When provided, the displayName will be listed under the categoryName within the UI. All types with the same categoryName will be listed under the same category. For example, if your extension provided a keyUp event type and a keyDown event type and they both had a categoryName of Keyboard, both event types would be listed under the Keyboard category while the user is selecting from the list of available event types when building a rule. The value of categoryName should be human-readable.
libPathThe relative path to the type's library module. It should not not begin with a slash. It must reference a JavaScript file with a .js extension.
viewPath (Optional)The relative URL to the type's view. It should be relative to viewBasePath and should not begin with a slash. It must reference an HTML file with a .html extension. Query strings and fragment identifiers (hashes) are acceptable. If your type's library module does not use any settings from a user, you may exclude this property and Experience Platform will instead display a placeholder stating that no configuration is necessary.
schema

An object of JSON Schema describing the format of a valid settings object that can be saved by the user. Settings are usually configured and saved by a user using the Data Collection user interface. In these cases, the extension's view can take necessary steps to validate user-provided settings. On the other hand, some users choose to use tags APIs directly without the aid of any user interface. The purpose of this schema is to allow Experience Platform to properly validate that settings objects saved by users, regardless of whether a user interface is used, are in a format that is compatible with the library module that will act upon the settings object at runtime.

An example schema object is as follows:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "type": "object",
  "properties": {
    "delay": {
      "type": "number",
      "minimum": 1
    }
  },
  "required": [
    "delay"
  ],
  "additionalProperties": false
}

We recommend using a tool like JSON Schema validator to manually test your schema.

transforms (Optional)An array of objects where each object represents a transformation that should be performed on every corresponding settings object when it is emitted into the runtime library. See the section on transforms for more information on why this may be needed and how it is used.