gtm_create_datalayer_variable
Create a Google Tag Manager Data Layer variable to read a specified key, with an optional default value for absent data, simplifying tag configuration.
Instructions
Create a Data Layer Variable (type 'v').
Args: datalayer_name: the dataLayer key to read, e.g. 'ecommerce.value'. default_value: returned when the key is absent. version: dataLayer version, 2 unless you have a specific reason.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | ||
| confirm | No | ||
| version | No | ||
| account_id | No | ||
| container_id | No | ||
| workspace_id | No | ||
| default_value | No | ||
| datalayer_name | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |