google-analytics - GA4 跟踪总收入
解决方案
标记中的“值”参数填充报告中的“收入”指标。例如,如果您从本示例上传购买事件 ( https://developers.google.com/analytics/devguides/collection/ga4/ecommerce#purchase ):
gtag('event', 'purchase', {
affiliation: 'Google Store',
coupon: 'SUMMER_FUN',
currency: 'USD',
items: [{
item_id: 'SKU_12345',
item_name: 'jeggings',
coupon: 'SUMMER_FUN',
discount: 2.22,
affiliation: 'Google Store',
item_brand: 'Gucci',
item_category: 'pants',
item_variant: 'black',
price: 9.99,
currency: 'USD',
quantity: 1
}, {
item_id: 'SKU_12346',
item_name: 'jeggings',
coupon: 'SUMMER_FUN',
discount: 2.22,
affiliation: 'Google Store',
item_brand: 'Gucci',
item_category: 'pants',
item_variant: 'gray',
price: 9.99,
currency: 'USD',
quantity: 1
}],
transaction_id: 'T_12345',
shipping: 3.33,
value: 21.09,
tax: 2.22
})
然后,GA4 将显示 21.09 美元的总收入。
在货币化概览报告中,GA4 将显示这 21.09 美元专门归类为电子商务收入。
推荐阅读
- javascript - chrome上奇怪的本地存储项目
- c# - 如何将 c++ 可执行文件 p/Invoke 到 C#
- c# - 行数到标签并将标签数加 1
- javascript - 如果登录应用程序,如何重定向
- django - SerializerMethodField 始终返回相同的值并排除字段
- rust - 从对特征关联类型的引用中读取值时,如何解决“借用内容”错误?
- c# - 在不继承单一行为的情况下实例化预制件
- apache - 这个 Apache 环境变量语法是如何工作的?
- visual-studio - 无法使用 Visual Studion 2015 在 utasker 上运行 STM32Fxx 板
- javascript - 用时刻 JS 格式化日期以匹配