目前,我正在使用增强的电子商务,从Google网站上获取数据,但并不是所有的东西都能工作。
购物车跟踪(付款和发货)是可行的,我可以在Google分析中看到这一点,但是跟踪产品点击量、测量产品视图、跟踪购物车的添加和从购物车中跟踪清除都是不正常的。
当我加载页面的某些部分时,数据层不会使用以下代码填充任何数据:
//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。
//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标记,并重写了它们,现在似乎在某种程度上起作用了。仍然有相同的问题,尽管如此,将进一步研究这一问题。
发布于 2020-02-04 15:39:59
我删除了所有的代码和标签,并从头开始。将一些标记从“事件”更改为“页面视图”,反之亦然,似乎解决了我遇到的问题。
数据现在被推送到DataLayer,并由GA获取。
感谢你的帮助
发布于 2020-01-31 16:38:22
查看您的标记,您的EE_ProductView触发器设置为PageView,它在将数据推到dataLayer之前触发。这取决于何时将项推送到dataLayer,以确定要使用哪个触发器。如果要将项作为页面加载的一部分推送到dataLayer,则可以使用加载窗口的触发器。对于页面加载后发生的事件(例如,单击),可以使用自定义事件触发器来激发事件名称(例如,"EE_ProductView")。
发布于 2020-01-31 15:58:46
你能在GTM中发布你的标签的截图吗?你的标签上有正确的触发器吗?这些触发器甚至发生在网站上吗?
https://stackoverflow.com/questions/60003405
复制相似问题