我已经在这里敲了几个小时了……尝试了很多方法仍然不起作用!我不知道为什么,但一切都设置正确...
这里的标签正在从我的网站触发...
在调试视图中,我看到了 page_view,但没有看到我的 add_to_cart 事件...这里没有显示任何事件,购买,产品视图,什么也没有!!?为什么没有事件显示,但 page_view 却显示?
dataLayer.push({ ecommerce: null }); // Clear the previous ecommerce object.
dataLayer.push({
event: "add_to_cart",
ecommerce: {
currency: "USD",
value: 7.77,
items: [
{
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: 9.99,
quantity: 1
}
]
}
});
这是带有 GA4 Google Analytics 的服务器端 GTM 标记!请任何人帮助我做错了什么...谢谢
两种调试方式:
需要考虑的事项:
希望这有帮助!