我正试图从客户数据层将转换价值拉到 GA4,但是,似乎无法让它发挥作用。我可以看到除值以外的所有其他详细信息。
我在 GTM 中使用自定义变量,但希望得到一些帮助,了解我需要为此设置的参数。
我想要的数字是您将在第一行看到的“总数”。
提前致谢。
他们在购物车转换页面上的代码如下:
<script>
(function() {
var orderDataModel = {"modeOfSale":4,"number":1002226060,"fees":[{"description":"Booking Fee:","amount":0.0}],"total":45.0000,"cartItems":[{"id":4916658,"productId":8958,"performanceId":8958,"packageId":0,"price":45.0000,"priceType":1190,"priceTypeDescription":"Under 35","productType":"Season","productDescription":"8957|[eventname]","quantity":1}]};
var productDataModel = {"packageId":0,"productionSeasonId":0,"performanceId":0,"productTypeDescription":null,"contributionTypeId":0,"fundId":0,"onAccountPaymentMethodId":0,"giftCertificatePaymentMethodId":0};
var sessionDataModel = {"customerNumber":21576670,"sessionKey":"VENMEoiu9PpKmDrbHRFeSUeOcpcpAhBjH5R6KaPP8N01QIYHJca7yfZXq1TlaBxJK0/cjKknmB1vTYrrZbUcEREixtVtlTJutlD3rpZi26ZrCbiReclITL7WeuKmbKrrhDrRWsXomuQylAw06nNY72B6CoH06lnzxd74dEYtNBzK6lKLYLEd0esxJdDT28DA","modeOfSale":4,"isGuest":true,"isAnonymous":false,"sourceId":15967,"isRenewalOrder":false};
var provider = new tnew.lib.GoogleDataLayerProvider(orderDataModel, productDataModel, sessionDataModel);
window.dataLayer = window.dataLayer || [];
var session = provider.getSession();
window.dataLayer.push(session);
var product = provider.getProduct();
window.dataLayer.push(product);
var order = provider.transformOrder();
if (order) {
window.dataLayer.push(order);
}
})();
</script>
我创建了一个 DataLayer 变量名称为“total”的变量,另一个用于“orderDataModel”
我创建了一个在转换页面上触发的触发器。
我创建了一个标签,将“总计”拉入“值”字段。我已将我的货币添加为静态澳元。