【发布时间】:2020-12-01 20:09:24
【问题描述】:
我正忙于在我的 WooCommerce 网站中实施 GA4 电子商务 dataLayer。有一些插件可以为 Universal Analytics 实现 dataLayer(例如 this one, for $99 per year),但我找不到任何适用于 GA4 的插件。
这是purchase 事件的dataLayer (source):
dataLayer.push({
'event': 'purchase',
'ecommerce': {
'purchase': {
'transaction_id': 'T12345',
'affiliation': 'Online Store',
'value': '35.43',
'tax': '4.90',
'shipping': '5.99',
'currency': 'EUR',
'coupon': 'SUMMER_SALE',
'items': [{
'item_name': 'Triblend Android T-Shirt',
'item_id': '12345',
'item_price': '15.25',
'item_brand': 'Google',
'item_category': 'Apparel',
'item_variant': 'Gray',
'quantity': 1,
'item_coupon': ''
}, {
'item_name': 'Donut Friday Scented T-Shirt',
'item_id': '67890',
'item_price': '33.75',
'item_brand': 'Google',
'item_category': 'Apparel',
'item_variant': 'Black',
'quantity': 1
}]
}
}
});
谁能帮我把变量放进去吗?
【问题讨论】:
标签: e-commerce hook-woocommerce google-datalayer google-analytics-4