Dynamic Remarketing
Dynamic remarketing shows ads featuring the specific products or content a user viewed on your site. It requires passing item data to Google Ads via the dataLayer so the ad system knows what to show. This recipe covers the ecommerce dataLayer structure, Google Ads tag configuration, and how to adapt it for non-ecommerce sites.
How dynamic remarketing works
Section titled “How dynamic remarketing works”- A user views a product page → your site pushes item data to the dataLayer
- Google Ads tag reads the item data and sends it to Google’s servers
- When that user later browses other sites, Google Ads shows them an ad featuring that specific product
The key is that the product/item data must be in the dataLayer before the Google Ads Remarketing tag fires.
Ecommerce dataLayer setup
Section titled “Ecommerce dataLayer setup”GA4 ecommerce events automatically carry item data that Google Ads can use. Push GA4-format ecommerce events on every page where remarketing should trigger.
Push on product detail pages. This feeds both GA4 ecommerce and Google Ads remarketing.
window.dataLayer = window.dataLayer || [];
// Always clear ecommerce before pushing new datawindow.dataLayer.push({ ecommerce: null });
window.dataLayer.push({ event: 'view_item', ecommerce: { currency: 'USD', value: 49.99, items: [{ item_id: 'SKU-12345', item_name: 'Running Shoes Pro', item_category: 'Footwear', item_brand: 'BrandName', item_variant: 'Blue / Size 10', price: 49.99, quantity: 1, index: 0 }] }});For category and search pages, use view_item_list:
window.dataLayer.push({ ecommerce: null });window.dataLayer.push({ event: 'view_item_list', ecommerce: { item_list_name: 'Search Results', items: [ { item_id: 'SKU-001', item_name: 'Product A', price: 29.99 }, { item_id: 'SKU-002', item_name: 'Product B', price: 39.99 }, { item_id: 'SKU-003', item_name: 'Product C', price: 19.99 } ] }});GTM Configuration
Section titled “GTM Configuration”-
Create Data Layer Variables for ecommerce data
DLV - ecommerce.items→ Data Layer Variable name:ecommerce.itemsDLV - ecommerce.value→ecommerce.valueDLV - ecommerce.currency→ecommerce.currency
-
Create a Google Ads Remarketing tag
- Tag type: Google Ads Remarketing
- Conversion ID: your Google Ads Conversion ID (from Google Ads → Tools → Conversions → Tag Setup)
- Remarketing parameters:
items→{{DLV - ecommerce.items}}value→{{DLV - ecommerce.value}}currency→{{DLV - ecommerce.currency}}
-
Create Custom Event Triggers
Create triggers for each ecommerce event you want to use for remarketing:
- Custom Event:
view_item - Custom Event:
view_item_list - Custom Event:
add_to_cart - Custom Event:
purchase
Assign all four as triggers to the Remarketing tag.
- Custom Event:
-
Test with Google Tag Assistant
Install the Google Tag Assistant Chrome extension. Visit a product page and verify the Remarketing tag fires with
itemsdata populated.
Google Ads Remarketing
- Type
- Google Ads Remarketing
- Trigger
- Custom Events - view_item, add_to_cart, purchase
- Variables
-
DLV - ecommerce.itemsDLV - ecommerce.valueDLV - ecommerce.currency
Non-ecommerce dynamic remarketing
Section titled “Non-ecommerce dynamic remarketing”If you run a non-ecommerce site (SaaS, travel, real estate, finance), you can still use dynamic remarketing with custom parameters that map to your Google Ads feed.
For real estate, travel, or SaaS — map to your Google Ads custom feed.
// Real estate examplewindow.dataLayer = window.dataLayer || [];window.dataLayer.push({ event: 'view_listing', remarketing_items: [{ id: 'PROPERTY-9876', name: '2BR Apartment Downtown', category: 'apartment', price: 2500, location: 'New York, NY' }], remarketing_pagetype: 'offerdetail', remarketing_totalvalue: 2500});Configure the Google Ads Remarketing tag with:
ecomm_pagetype→{{DLV - remarketing_pagetype}}ecomm_totalvalue→{{DLV - remarketing_totalvalue}}
Or create a custom parameter mapping that aligns with your Business Data feed in Google Ads.
Linking GA4 and Google Ads audiences
Section titled “Linking GA4 and Google Ads audiences”For the most effective remarketing, link your GA4 property to Google Ads:
- In GA4 → Admin → Google Ads Links → Add Link
- Connect your Google Ads account
- Enable Personalized Advertising data sharing
This allows GA4 audiences (like “viewed product but did not purchase”) to sync to Google Ads automatically, without needing a separate Remarketing tag for every touchpoint.
Test it
Section titled “Test it”- Open GTM Preview and visit a product page
- Verify the
view_itemecommerce event fires in the Summary pane - Check the Google Ads Remarketing tag is in Tags Fired
- Click the tag to inspect parameters — verify
itemscontains your product data - Use Google Tag Assistant → Test to see the remarketing hit details
Common gotchas
Section titled “Common gotchas”Items array is not being read correctly. If {{DLV - ecommerce.items}} returns undefined, check that you pushed ecommerce.items (not ecommerce[0].item_id). The variable name should be ecommerce.items — the GTM Data Layer Variable handles nested dot-notation paths.
Always clear ecommerce first. GTM’s data model is additive. If you push view_item on product A then view_item on product B without clearing, the items array from product A persists in the data model and contaminates product B’s event. Always push { ecommerce: null } before every ecommerce push.
Consent mode blocks remarketing. If you have Consent Mode configured and a user declines ad storage, the Remarketing tag should not fire. Make sure your Consent Mode implementation has ad_storage set correctly.