Set Variables
Last updated
Last updated
To Set Variables in an Action in a Rule,
Change the Extension from "Core" to "AA Product String Builder.
Set the Action Type to "Set Variables"
Fill in the Data Layer Setting, Product String Core Settings, and Product String Custom Events which will be described more below.
The Root Data Object is the root for the product collection path. This should be a Launch Data Element that must return a JSON object. You have two options,
Use a data element that returns your data layer JSON object.
Use event data such as %event.detail% (if the rule's trigger supports this).
Launch Data Element syntax ( %dataElementName% ) is expected.
This field specifies the path to your product collection (product object array).
If your product object array exists at digitalData.cart.item and Root Data Object is returned from digitalData, then you would enter cart.item here.
A string literal is expected. Dot notation may be used for nested objects. A Data Element returning a string literal may be used.
These are the core settings of the Adobe Analytics Product String which include the four basic fields of Category, Product ID, Quantity, and Unit Price.
Note that values used in any part of the product string core settings are cleansed of special characters in the following way. The pipe character, "|", is replaced with a tilde, "~". The semicolon, ";" is replaced with a colon, ":". And the comma, "," is replaced with a period, "."
Product Category is optional and can be specified as a path within the collection or as static text. This feeds the first part of a product string stanza: s.products=category;productID;quantity;price;events;eVars Using a collection path allow the value for category to be dynamic for each product. Example: For Cart Item Products supplied by digitalData.cart.item[n] Root Data Object : digitalData Product Collection Path : cart.item Path to Product ID: productInfo.productID Path to Category: productInfo.productCategory Using a static text value will cause Category to be replicated for each product. This is useful on implementations that use s.products for more than just traditional products. An example of this is a purchase event where the transaction items use the category 'Product', payments use the category 'Payment', and shipment info uses 'Shipment'.
This feeds the second (and most important) part of a product string stanza: s.products=category;productID;quantity;price;events;evars Product ID is always specified as a path within the Product Collection. Each Product ID within a collection must be unique. Example: For Cart Item Products within digitalData.cart.item[n].productInfo.productID Root Data Object : digitalData Product Collection Path : cart.item Path to Product ID: productInfo.productID A string literal is expected. Dot notation may be used for nested objects. A Data Element returning a string literal may be used.
This feeds the third part of a product string stanza: s.products=category;productID;quantity;price;events;evars It serves no purpose to Adobe Analytics except in the special case of the purchase event. For purchase events only, this value populates the units metric.
This feeds the fourth part of a product string stanza: s.products=category;productID;quantity;price;events;evars It also serves no purpose to Adobe Analytics except in the special case of the purchase event. For purchase events only, this value populates the revenue metric.
Note that this extension requires the Unit Price. The Adobe Product String requires the combine price of all units. The AA Product String Builder multiplies this value by the quantity when creating the product string price value. In order for this to happen, BOTH Quantity and Unit Price must be provided.
This feeds the fifth part of a product string stanza: s.products=category;productID;quantity;price;events;evars Each event and its value will be added to the events portion of the product string. If more than one custom event is configured, a pipe (|) delimiter is used between them. Custom events that are set in the product string must be configured as "numeric" or "currency" in the Adobe Analytics report suite settings. Event data layer path is expected to be a string literal (and to be relative to the Product Collection Path set above). Dot notation may be used for nested objects. A Data Element returning a string literal may be used. If "Boolean Flag" is selected, the value returned at runtime is expected to be a boolean (true or false) and the event will be set to 1 or 0 accordingly. s.events and s.linkTrackEvents is automatically updated for every custom event that is set in the product string.
This feeds the final part of a product string stanza: s.products=category;productID;quantity;price;events;evars Each eVar and its value will be added to the evars portion of the product string. If more than one merchandising eVar is configured, a pipe (|) delimiter is used between them. Evars that are set in the product string must be configured as "merchandising" enabled with "product syntax" in the Adobe Analytics report suite settings. Event data layer path is expected to be a string literal (and to be relative to the Product Collection Path set above). Dot notation may be used for nested objects. A Data Element returning a string literal may be used.
Note that merchandising eVar values are cleansed of special characters in the following way. The pipe character, "|", is replaced with a tilde, "~". The semicolon, ";" is replaced with a colon, ":". And the comma, "," is replaced with a period, "."