Google Analytics(分析)不会通过GTM从数据层接收所有数据



我目前正在使用增强型电子商务;从Google Analytics网站获取数据,但并非一切都正常。
购物车跟踪(付款和运输(正在工作,我可以在Google Analytics上看到这一点,但是跟踪产品点击,测量产品视图,跟踪购物车添加以及跟踪购物车中的删除无法正常工作。

当我加载页面的某些部分时,使用以下代码不会使用任何数据填充数据层:

//Tracking Product Clicks
dataLayer.push({
"event":"EEproductClick",
"ecommerce": {
"currencyCode": curr,
"click": {
"actionField": {"list":"category" },
"products": [{
"id": pdc,
"name": GarmName,
"price": prix,
"brand": "MyBrand",
"category": ""
}]
}
}
});
//End

//Measuring Views of Product Details
dataLayer.push({
"ecommerce": {
"currencyCode":curr,
"detail": {
"actionField": {"list":""},     //optional list property
"products": [{
"id":pdc,
"name":GarmName,
"price":prix,
//               "brand":"Boss",
//               "category":"Men/Clothing/T-Shirts",
//               "variant":"black"
}]
}
}
});
//End
//Tracking adds to cart
dataLayer.push({
"event":"EEaddToCart",
"ecommerce": {
"currencyCode": curr,
"add": {
"products": [{
"id": pdc,
"name": GarmName,
"price": prix,
"brand": "MyBrand",
//               "category":"Men/Clothing/T-Shirts",
//               "variant":"black", //optional, if there is a variant of the product
"quantity":1
}]
}
}
}); 
//End
//Tracking removes from cart
dataLayer.push({
"event":"EEremoveFromCart",
"ecommerce": {
"currencyCode": curr,
"remove": {
"products": [{
"id": pdc,
"name": GarmName,
"price": prix,
"brand": "MyBrand",
//               "category":"Men/Clothing/T-Shirts",
//               "variant":"black", //optional, if there is a variant of the product
//               "quantity":1
}]
}
}
}); 
//End

我目前正在使用以下代码填充数据层,但是使用Google跟踪代码管理器,除了购买过程外,不会将任何数据发送到Google Analytics。

//Measuring Views of Product Details
dataLayer.push({
event: 'ProductView',
ecommerce: {
detail: {
actionField: {
list: 'Search Results'
},
products: [{
id: pdc,
name: GarmName,
//              category: 'guides/google-tag-manager/enhanced-ecommerce',
//              variant: 'Text',
//              brand: 'SIMO AHAVA',
//              dimension3: 'Ecommerce',
//              metric5: 12,
//              metric6: 1002
}]
}
}
}); 
//END
//Measuring Product Clicks
dataLayer.push({
event: 'EE_ProductView',
'ecommerce': {
'detail': {
'actionField': {},
'products': [{
'name': GarmName,
'price': prix,
'id': pdc
}]
}
}
})
//End
//Measuring Additions or Removals from a Shopping Cart
dataLayer.push({
'event': 'addToCart',
'ecommerce': {
'currencyCode': curr,
'add': {
'products': [{
'name': GarmName,
'id': pdc,
'price': prix,
'quantity': 1
}]
}
}
});
//End
// Measure the removal of a product from a shopping cart.
dataLayer.push({
'event': 'removeFromCart',
'ecommerce': {
'remove': {
'products': [{
'name': GarmName,
'id': pdc,
'price': prix,
'quantity': 1
}]
}
}
});
//End

我做错了什么,一组代码可以工作,而另一组代码不能工作? 我怎样才能让GTM将它接收的数据推送到Google Analytics?

非常感谢

编辑:我已经删除了我的代码和GTM/GA标签并重写了它们,现在似乎在一定程度上工作。 仍然遇到同样的问题,所以会进一步研究这个问题

查看您的代码,您的EE_ProductView触发器设置为网页浏览,该触发器在您将数据推送到 dataLayer 之前触发。 这取决于何时将项目推送到数据层,以及要使用哪个触发器。 如果要将项目作为页面加载的一部分推送到 dataLayer,则可以使用窗口加载触发器。 对于网页加载后发生的事件(例如点击(,您可以使用针对事件名称(例如"EE_ProductView"(触发的自定义事件触发器。

你能在GTM中发布你的标签的截图吗,你的标签上是否有正确的触发器,这些触发器甚至发生在网站上吗?

我删除了所有代码和标签,从头开始。 将一些标签从"事件"更改为"页面浏览",反之亦然似乎已经解决了我遇到的问题。
数据现在被推送到 DataLayer 并由 GA 拾取。

感谢大家的帮助

最新更新