In your Google Ads account, navigate to Tools > Shared Library > Audience Management > Your Data Sources.
For dynamic remarketing, check the event data box and select the relevant event data variable.
Follow the correct GA4 server-side implementation sequence to ensure Google can recognize and forward the right data for dynamic remarketing.
In some cases, after switching to Consent Mode V2 remarketing audiences can disappear. Here is the workaround we found.
The following Google Ads Remarketing settings doesn't work:
Because in a standard GA4 implementation, for example, item_id is sent, and the remarketing tag expects id. A business_vertical is also expected, which is usually not implemented by default.
Add a new custom javascript variable to your GA4 events (view_item etc) named rem_ids, this variable will contain an array of all the item ids, e.g. ["item)id1", "item_id2", "item_id3", ..]
Add 'id' event parameter to individual GA4 tags in the web container (view_item_list, view_item, view_search_results, add_to_cart, purchase). Here's an example code:
The result? The custom javascript variable can be made with this code in which you provide the items variable.
function() {
var items = {{items}}; // Replace {{items}} with the correct Data Layer Variable that contains the items array
var ids = items.map(function(item) {
return item.item_id; // Collect only the item_id of each item
});
return ids; // Returns an array of item_id values
}Then, in the server container you must first create an event data variable ED | rem_ids that retrieves the rem_ids, and then you can pass it along as an id in your Google Ads remarketing tag.