Home AppMeasurement Web SDK · Migration Guide Created by Amit G Dusane

Migration › Map your variables

Step 08 of 13
62% complete

Map your variables

This is the heart of the migration, and where your inventory pays off. Every eVar, prop, and event you catalogued earlier now needs a home in the payload, but instead of setting them one at a time on a global object the way doPlugins did, you bundle them into a single structured object the Edge understands. The good news: thanks to the Full Extension, most slot into predictable, named places[4]. We handle them in five groups, because variables of the same kind map the same way, learn the pattern once per group and the rest is repetition.
What to do
First make one master payload object, then map each group into it. For each data-layer value, create a JavaScript Variable data element as you go.
0
Where Tags › Data Elements › Add › AEP Web SDK · Variable · XDM[27]
Do Name it XDM - Global. Map the groups below into its nodes.
Group 1 · OOTB / standard variables
Page name, channel, browser, OS, geo, standard nodes; geo and user-agent are filled by the Edge automatically.
pageName → web.webPageDetails.name channel → web.webPageDetails.siteSection browser, OS → environment.browserDetails.* (auto from user-agent) geo → placeContext.geo.* (auto · datastream geolocation)
Group 2 · eVars
eVarN → _experience.analytics.customDimensions.eVars.eVarN
Group 3 · props & list props
propN → _experience.analytics.customDimensions.props.propN list propN → _experience.analytics.customDimensions.listProps.propN
Group 4 · events
eventN (counter/numeric) → _experience.analytics.event1to100.eventN.value eventN (serialized) → ...eventN.value + ...eventN.id (id = dedupe key)
Group 5 · product variables
Map the cart to productListItems with a Custom Code data element:
var dl = (window.digitalData && window.digitalData.product) || [];
return (Array.isArray(dl) ? dl : [dl])
  .filter(function (p) { return p && p.sku && p.name; })
  .map(function (p) {
    return { SKU: p.sku, name: p.name, quantity: p.quantity || 1,
             priceTotal: (p.price || 0) * (p.quantity || 1) };
  });
FIVE GROUPSSCHEMA NODEOOTB / standardweb.webPageDetails.*eVars...customDimensions.eVarsprops / list props...customDimensions.propsevents...event1to100.*productsproductListItems[]
Variables of the same kind map the same way, learn the pattern once per group, then it is repetition.
⚠ Common mistake

Forcing product-scoped merchandising eVars into productListItems and losing days to it. They don't ride that structure cleanly, pass them via the delimited data.__adobe.analytics.products string instead[36].

✓ You should see

In the Debugger payload: your mapped nodes under xdm._experience.analytics... and productListItems as an array of objects.