Do you use Items object of Google Analytics 4 in your dataLayer?
Well, this variable is a smart way to track the Google Ads Dynamic Remarketing using the GA4 items.
So you must to have the dataLayer.push of GA4 structure to use this variable.
Guide step by step:
Go to the GTM gallery variable and search "GA4 Items to GAds Dynamic Remarketing Converter"
or
- Go to User-Defined Variables
- Click Discover more variable type in the Community Template Gallery
- Search GA4 Items to GAds Dynamic Remarketing Converter
- Import the Template Variable
You can choose one of the 2 types of GAds dynamic remarketing:
- First: Custom parameters (the old ecomm_pagetype, ecomm_prodid, ecomm_totalvalue, ecomm_category). This is the old option, I suggest you to use the new one :)
- Second : Event Data (the new GAds dynamic remarketing). This option is suggested :)
Ok, let's see together how to set up the old way of dynamic remarketing with custom parameters
If you want to use the old version, you have to simply create the custom variable with this option.
Then you create the GAds Tag Remarketing:
- Go to Custom Parameters and select Use Data Layer
- Choose the name of the variable (in my case GAds Dynamic Remarketing - Custom Parameters)
- Create the trigger for your remarketing. You can catch these GA4 events:
- view_item_list
- select_item
- view_item
- add_to_cart
- purchase
So you can use a Custom Event with regex matching
view_item_list$|select_item$|view_item$|add_to_cart$|purchase$
Now debug with one of GA4 events and check the variable and GAds tag
If you choose Event Data you have to create 2 variables:
- Event Value
- Event Items
The Event Value will set up the total value of the GA4 items (in other words the sum of the each items value * qta).
Set the name of variable (es: "GAds Dynamic Remarketing - Event Value")
The Event Items will set up the list of items id and the google_business_vertical (the default is retail)
Set the name of variable (es: "GAds Dynamic Remarketing - Event Items")
Go to GAds Remarketing Tag and check the flag "Send dynamic remarketing event data"
- Event Name choose the variable {{Event}}
- Event Value choose the variable {{GAds Dynamic Remarketing - Event Value}}
- Event Items choose the variable {{GAds Dynamic Remarketing - Event Items}}
- Create the trigger for your remarketing. You can catch these GA4 events:
- view_item_list
- select_item
- view_item
- add_to_cart
- purchase
So you can use a Custom Event with regex matching
view_item_list$|select_item$|view_item$|add_to_cart$|purchase$
Ok, go to debug it.
Example of the dataLayer push purchase:
dataLayer.push({ "event": "purchase", "ecommerce": { "currency": "EUR", "items": [ { "item_id": 122, "item_name": "Beanie (Copy)", "item_brand": "", "price": 18, "item_category": "Accessories", "quantity": 2, }, { "item_id": 28, "item_name": "Belt", "item_brand": "", "price": 55, "item_category": "Accessories", "quantity": 1, }, { "item_id": 29, "item_name": "Cap", "item_brand": "", "price": 16, "item_category": "Accessories", "quantity": 2, } ], "transaction_id": "183", "affiliation": "", "value": 123, "tax": 0, "shipping": 0, "coupon": "" } });
The 2 variables contain the list of id, google_business_vertical and the total value of GA4 items
Great, it works. Now you can use the same data of GA4 directly on your Google Ads Remarketing Tag!
Let me know if it is helpful for you
Buon Tag :)