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:

  1. do 2 pushes, once the ga4 ecommerce one and once the remarketing one?
  2. combine both pushes and use both id AND item_id as keys in my array?
  3. 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:

  1. do 2 pushes, once the ga4 ecommerce one and once the remarketing one?
  2. combine both pushes and use both id AND item_id as keys in my array?
  3. 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 badges
Add a comment  | 

1 Answer 1

Reset to default 0

You 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.

本文标签: