Sha256: 6cc595cf5ad14576f4c06fe9008ebc0cd895ad848e9fcdad40458c94b295a722
Contents?: true
Size: 1.9 KB
Versions: 1
Compression:
Stored size: 1.9 KB
Contents
/** * @namespace WORKAREA.flowIoAdapter */ WORKAREA.analytics.registerAdapter('flowIoAdapter', function () { 'use strict'; return { 'addToCartConfirmation': function (payload) { var cartAddEvent = { item_number: payload.sku, quantity: payload.quantity, price: { amount: payload.price, currency: payload.currency_code, }, }; flow.beacon('event', 'cart_add', cartAddEvent); }, 'removeFromCart': function (payload) { var cartRemoveEvent = { item_number: payload.sku }; flow.beacon('event', 'cart_remove', cartRemoveEvent); }, 'checkoutOrderPlaced': function (payload) { var transactionEvent = { number: payload.id, revenue: { amount: payload.total_price, currency: payload.total_price_currence_code, }, shipping: { amount: payload.shipping_total, currency: payload.shipping_total_currency_code }, tax: { amount: payload.tax_total, currency: payload.tax_total_currency_code, }, items: _.map(payload.items, function (impression) { return { number: impression.sku, price: { amount: impression.price, currency: impression.currency_code }, quantity: impression.quantity, name: impression.product_name }; }) }; flow.beacon('event', 'transaction', transactionEvent); } }; });
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
workarea-flow_io-1.2.1 | app/assets/javascripts/workarea/storefront/flow_io/adapters/flow_io_adapter.js |