admin管理员组文章数量:1125044
I want to implement both Google Remarketing and GA4 Ecommerce events into my website.
According to the latest Google Ads Remarketing docs (#zippy=), this is done like this:
dataLayer.push({
'event': 'add_to_cart',
'value': 78.45,
'items' : [{
'id': '1234',
'google_business_vertical': 'retail'
}]
});
I already have lots of dataLayer pushes using the same event names (e.g. add_to_cart etc.) also using the "items"-array for GA4 Ecommerce events - but for those, the identifier is not id, but item_id. See the official reference here: ;client_type=gtag#add_to_cart
Now I am wondering: whats the best and correct way, to implement both frameworks? Do I:
- do 2 pushes, once the ga4 ecommerce one and once the remarketing one?
- combine both pushes and use both id AND item_id as keys in my array?
- push 2 item-arrays within one push, as our marketing agency suggested?
None of those options seems really ideal to me.
I want to implement both Google Remarketing and GA4 Ecommerce events into my website.
According to the latest Google Ads Remarketing docs (https://support.google.com/tagmanager/answer/6106009?hl=en#zippy=), this is done like this:
dataLayer.push({
'event': 'add_to_cart',
'value': 78.45,
'items' : [{
'id': '1234',
'google_business_vertical': 'retail'
}]
});
I already have lots of dataLayer pushes using the same event names (e.g. add_to_cart etc.) also using the "items"-array for GA4 Ecommerce events - but for those, the identifier is not id, but item_id. See the official reference here: https://developers.google.com/analytics/devguides/collection/ga4/reference/events?hl=de&client_type=gtag#add_to_cart
Now I am wondering: whats the best and correct way, to implement both frameworks? Do I:
- do 2 pushes, once the ga4 ecommerce one and once the remarketing one?
- combine both pushes and use both id AND item_id as keys in my array?
- push 2 item-arrays within one push, as our marketing agency suggested?
None of those options seems really ideal to me.
Share Improve this question asked 2 days ago constantinconstantin 112 bronze badges1 Answer
Reset to default 0You can try to use a single push with dual compatibility. This avoids duplication in GA4 while providing all the necessary fields for Remarketing:
dataLayer.push({
'event': 'add_to_cart',
'value': 78.45, // Common field used by both
'items': [{
'item_id': '1234', // GA4 identifier
'id': '1234', // Remarketing identifier
'item_name': 'Product Name',
'price': 78.45,
'google_business_vertical': 'retail' // Specific to Remarketing
}]
});
The event name remains the same (add_to_cart), so only one event is logged in GA4.
The items array includes both item_id (for GA4) and id (for Remarketing). GA4 will ignore id, and Google Remarketing will ignore item_id.
Fields like value and price are shared and utilized by both platforms.
Fields like google_business_vertical are included but won’t interfere with GA4 processing.
本文标签:
版权声明:本文标题:How to deal with GA4 and Google Remarketing both wanting an item array but with different keys for the identifier? - Stack Overf 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736654716a1946223.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论