Method Calls

addPurchaseRows

addpurchaserows method // addpurchaserows method window\ monetateq push(\[ "addpurchaserows", \[{ "purchaseid" "idstring", "productid" "pidstring", "quantity" "quantitystring", "unitprice" "pricestring", "sku" "skustring", "currency" "currencystring" }] ]); the addpurchaserows method is used to add products a customer has purchased you don't need to send an additional api call with the addcartrows method to empty the cart after a conversion the method data is an array of objects each row is an object with properties specific to the purchased product some object properties are required while others are optional required and optional properties the required properties are as follows purchaseid productid quantity unitprice a product id (pid) as well as the purchase id each can have no more than 50 characters the api call fails if any pid exceeds this limit the purchaseid property must be the same across all rows within addpurchaserows the value it contains must be unique across all purchases to track purchases on your site if your site passes a purchase id to monetate more than once, it discards the newer duplicate purchase id and doesn't include it in analytics these object properties are optional sku currency if you are using personalized search, the sku is a required parameter if your site doesn't use us dollars (usd) for purchases, then you must include currency information in this method don't send empty strings for optional property values only send properties that have a value monetate inspector view this screenshot shows the components tab of the monetate inspector browser plug in the purchase id row indicates that the addpurchaserows method has passed the transaction number to monetate along with the required pid, quantity, and unit price values as shown in the cart products rows the components tab of monetate inspector, with a value in the 'purchase id' row as well as product id, quantity, and unit price values in the cart products rows this code example contains the method in use that results in the monetate inspector results shown in the previous screenshot addpurchaserows example // addpurchaserows example window\ monetateq = window\ monetateq || \[]; window\ monetateq push(\[ "addpurchaserows", \[{ "purchaseid" "1456768298719", "productid" "359920273", "sku" "913801477", "quantity" "1", "unitprice" "299 99", "currency" "eur" }, { "purchaseid" "73893797", "productid" "b345", "sku" "sku345", "quantity" "3", "unitprice" "29 99", "currency" "eur" }] ]); window\ monetateq push(\[ "trackdata" ]);