更新时间:2025年7月14号
purchase没触发
先确认是gtag方式布署,还是通过GTM布署?
如果是gtag方式,首先检查源码里,是否有如下代码:
<script> gtag("event", "<a href="https://www.ichdata.com/tag/purchase" title="查看更多关于purchase的文章" target="_blank">purchase</a>", { transaction_id: "T_12345_1", value: 30.03, tax: 4.90, shipping: 5.99, currency: "USD", coupon: "SUMMER_SALE", items: [ // If someone <a href="https://www.ichdata.com/tag/purchase" title="查看更多关于purchase的文章" target="_blank">purchase</a>s more than one item, // you can add those items to the items array { item_id: "SKU_12345", item_name: "Stan and Friends Tee", affiliation: "Google Merchandise Store", coupon: "SUMMER_FUN", discount: 2.22, index: 0, item_brand: "Google", item_category: "Apparel", item_category2: "Adult", item_category3: "Shirts", item_category4: "Crew", item_category5: "Short sleeve", item_list_id: "related_products", item_list_name: "Related Products", item_variant: "green", location_id: "ChIJIQBpAG2ahYAR_6128GcTUEo", price: 10.01, quantity: 3 }] }); </script>
这段代码的作用是发送purchase事件,其次是测试,看是该事件是否发送。
如果是GTM布署,首先检查GTM里是否配置代码(Tag),其次检查触发器是否配置正确,最后检查dataLayer.push是否有发送数据。
purchase触发,但没金额
purchase的金额取决于如下三个要素:
- 货币类型:purchase事件里一定要配置货币类型,若没设置,报告中不显示收入
- 参数price要浮点型,因为金额=price*quality
- 参数quality要整型,因为金额=price*quality