产品变量

无法使用处理规则来设置产品变量。在 Mobile SDK 中,必须在上下文数据参数中使用特殊语法来设置服务器调用中的产品。

要设置“产品”​变量,请将上下文数据键设置为 "&&products",然后使用为“产品”​变量定义的语法来设置值:

cdata.put("&&products", "Category;Product;Quantity;Price[,Category;Product;Quantity;Price]");

例如:

//create a context data dictionary 
HashMap cdata = new HashMap<String, Object>(); 
 
// add products, a purchase id, a purchase context data key, and any other data you want to collect. 
// Note the special syntax for products 
cdata.put("&&products", ";Running Shoes;1;69.95,;Running Socks;10;29.99"); 
cdata.put("myapp.purchase", "1"); 
cdata.put("myapp.purchaseid", "1234567890"); 
 
// send the tracking call - use either a trackAction or TrackState call. 
// trackAction example: 
Analytics.trackAction("purchase", cdata); 
// trackState example: 
Analytics.trackState("Order Confirmation", cdata);

“产品”**​变量在图像请求中设置,而其他变量则设置为上下文数据。必须使用处理规则来映射所有上下文数据变量:

您无需使用处理规则来映射​产品​变量,因为 SDK 会直接在图像请求中设置此变量。

On this page

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