Skip to main content
Version: 1.3.0

Option A

This is the description for Param A.

DataLayer Example

window.dataLayer.push({
"$schema": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/root-choice-event.json",
"event": "option_a",
"param_a": "example_a"
});

Event Properties

PropertyTypeConstraintsExamplesDescription
$schemastringrequired
"https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/root-choice-event.json"
Defines the structure of the event. This can be used to validate an event against the schema provided.
const: "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/root-choice-event.json"
eventstringconst: "option_a"
"option_a"
The event name.
param_astring
"example_a"
A string parameter for option A.
View Raw JSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/root-choice-event.json",
  "title": "Root Choice Event",
  "description": "An example event that has oneOf at the root level.",
  "x-tracking-targets": [
    "web-datalayer-js"
  ],
  "allOf": [
    {
      "type": "object",
      "properties": {
        "$schema": {
          "type": "string",
          "description": "Defines the structure of the event. This can be used to validate an event against the schema provided.",
          "const": "https://tracking-docs-demo.buchert.digital/schemas/1.3.0/web/root-choice-event.json"
        }
      },
      "required": [
        "$schema"
      ]
    },
    {
      "oneOf": [
        {
          "title": "Option A",
          "$anchor": "option_a",
          "description": "This is the description for Param A.",
          "type": "object",
          "properties": {
            "event": {
              "type": "string",
              "const": "option_a",
              "description": "The event name."
            },
            "param_a": {
              "type": "string",
              "description": "A string parameter for option A.",
              "examples": [
                "example_a"
              ]
            }
          }
        },
        {
          "title": "Option B",
          "$anchor": "option_b",
          "type": "object",
          "properties": {
            "event": {
              "type": "string",
              "const": "option_b",
              "description": "The event name."
            },
            "param_b": {
              "type": "integer",
              "description": "An integer parameter for option B.",
              "examples": [
                123
              ]
            }
          }
        }
      ]
    }
  ]
}