Manually mapping variables in Adobe Analytics

Last update: 2023-12-06
  • Topics:
  • Web SDK
    View more on this topic
  • Created for:
  • Developer

Adobe Experience Platform Web SDK can map certain variables automatically but custom variables must be manually mapped.

For XDM data that is not automatically mapped to Analytics, you can use context data to match your schema. Then it can be mapped into Analytics using processing rules to populate Analytics variables.

Also, you can use a default set of actions and product lists to send or retrieve data with Adobe Experience Platform Web SDK. To do this, see Collect commerce and product information.

Context data

To be used by Analytics, XDM data is flattened using dot notation and made available as contextData. The following list of value pairs shows an example of what the context data looks like when it is flattened:

  "bh": "900",
  "bw": "1680",
  "c": "24",
  "c.a.d.key.[0]": "value1",
  "c.a.d.key.[1]": "value2",
  "c.a.d.object.key1": "value1",
  "c.a.d.object.key2.[0]": "value2",
  "c.a.x.environment.browserdetails.javascriptenabled": "true",
  "c.a.x.environment.type": "browser",
  "cust_hit_time_gmt": "1579781427",
  "g": "",
  "gn": "home",
  "j": "1.8.5",
  "k": "Y",
  "s": "1680x1050",
  "tnta": "218287:1:0|0,218287:1:0|2,218287:1:0|1,218287:1:0|32767,218287:1:0|1,218287:1:0|0,218287:1:0|1,218287:1:0|0,218287:1:0|1",
  "user_agent": "Mozilla/5.0 AppleWebKit/537.36 Safari/537.36",
  "v": "Y"

Processing rules

All data collected by the edge network can be accessed via processing rules. In Analytics, you can use processing rules to incorporate context data into Analytics variables.

For example, in the following rule, Adobe Analytics is set to populate Internal Search terms (eVar2) with the data associated with Data).

Analytics UI image showing a rule example.

XDM schema

Adobe Experience Platform uses schemas to describe the structure of data in a consistent and reusable way. By defining data consistently across systems, it becomes easier to retain meaning and, therefore, gain value from data. Analytics context data works with the structure defined by the schema.

The following example shows how the event command can be used with the xdm option to send and retrieve data with Adobe Experience Platform Web SDK. In this example, the event command matches the ExperienceEvent Commerce Details Schema so that the productListItems name and SKU values are tracked:

        "name":"Large Field Hat",
        "name":"Small Field Hat",

For more information on tracking events with Adobe Experience Platform Web SDK, see Tracking events.

On this page