@ecomplus/widget-tiktok-pixel
Version:
Storefront plugin to handle Tiktok Pixel events
18 lines (15 loc) • 443 B
JavaScript
import { $ecomConfig, price } from '@ecomplus/utils'
export const currency = $ecomConfig.get('currency') || 'BRL'
export const getProductData = body => {
const data = {
currency,
content_id: body.sku,
content_name: body.name,
value: price(body),
content_type: 'product'
}
if (body.categories && body.categories.length) {
data.content_category = body.category_tree || body.categories[0].name
}
return data
}