Show Menu
TOPICS×

Manually mapping variables in Adobe Analytics

The Adobe Experience Platform (AEP) 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 the AEP 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

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 can be used with the xdm option to send and retrieve data with the AEP 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 the AEP Web SDK, see Tracking events .