1GNS.analytics = { 2 mapProductToGAItem(product, quantity = null) { 3 //console.log(product); 4 const item = { 5 item_name: product.name, 6 //item_id: String(product.id), 7 item_id: String(product.city)+'-'+String(product.article), 8 price: parseFloat(product.price), 9 item_brand: "Родинна ковбаÑка", // TODO: fill brand (maybe) 10 item_category: product.category_names[0], 11 }; 12 13 if (product.category_names.length > 1) { 14 product.category_names.forEach((category, idx) => { 15 if (idx === 0 || idx > 4) return; 16 item[`item_category${idx + 1}`] = category; 17 }); 18 } 19 20 if (quantity != null) { 21 item.quantity = String(quantity) 22 } 23 24 return item; 25 } 26}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.