Configure a vendor integration using a JSON file. Load this file locally in the app or from a remotely hosted URL. A JSON template file is available for each vendor integration.
A JSON template file has three sections: config, mappings, and commands.
The config section sets vendor SDK initialization options such as client ID, API key, or the log level. For example, the following sets the application ID:
"applicationid": "appid123" }
The mappings section defines your data mappings. The following mapping assigns the data layer variable product_id to the vendor parameter param_item_id.
"product_id": "param_item_id" }
The vendor parameter may use a prefix with dot notation to scope a mapping to a specific object in the payload. The prefix defines the object and the value to the right of the . becomes a property of the object. For example, the following mapping assigns product_id to the param_item_id variable of the event object. The remote commands parser creates an event object with param_item_id as one of its properties.
The object prefix is typically event., product., or purchase., but may be any custom object name. Refer to the JSON template files to see the object prefixes used for your vendor integration.
The commands section maps Tealium event names to the vendor’s events. In the basic implementation, the key is the Tealium event name and the right value is the Tealium wrapper for the vendor’s method. In the following example, the Tealium event cart_add is mapped to the vendor method logevent:
"cart_add": "logevent" }
Starting from version 2.9.0 of the Swift library and version 1.3.0 of the kotlin remote command module, commands can also be triggered when other DataLayer variables match specific values.
To do this, you have to create a compound key that contains the data layer key and a data layer value, separated by a :.
In this case, the remote command looks in the data layer for screen_view, and if it’s found, its value is compared to the string cart_view.
If they are the identical, then the remote command triggers the logevent command.
For retrocompatibility and for ease of use, in cases where the data layer key is not specified, tealium_event is implied. Therefore these two commands are exactly identical:
Another feature that makes use of Compound Keys is Static Mappings. This also requires Swift 2.9.0+ and Kotlin 1.3.0+.
Static Mappings allow you to add static values into the data layer for the remote command to use.
Other mappings and commands can make use of those values to trigger other commands or to add parameters.
This adds the two keys possible_buyer and apply_discount_percentage with their respective values (true and 20.0) in the paylod of the command. It is assumed that both conditions in the compound key are matched.