Migration › Map your variables
Map your variables
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.XDM - Global. Map the groups below into its nodes.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) };
});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].
In the Debugger payload: your mapped nodes under xdm._experience.analytics... and productListItems as an array of objects.