Manually mapping variables in Adobe Analytics

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 Products.

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 context data:

{
  "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": "http://example.com/home",
  "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 a.x._atag.search.term(Context Data).

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:

alloy("event",{
  "xdm":{
    "commerce":{
      "productViews":{
        "value":1
      }
    },
    "productListItems":[
      {
        "SKU":"HT105",
        "name":"Large Field Hat",
      },
      {
        "SKU":"HT104",
        "name":"Small Field Hat",
      }
    ]
  }
});

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

On this page

Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free
Adobe Summit Banner

A virtual event April 27-28.

Expand your skills and get inspired.

Register for free
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now
Adobe Maker Awards Banner

Time to shine!

Apply now for the 2021 Adobe Experience Maker Awards.

Apply now