Custom Variable Template for Google Tag Manager
Finds specific ecommerce push to dataLayer by ecom type (UA) or event name (GA4)
Define a UA ecommerce event type like "detail" or "add" to find the last push to the existing dataLayer. Optionally define an event name to specify the desired dataLayer push like "view_item" for a GA4 ecommerce event. Returns the "ecommerce" object if found.
Optionally define a list of keys to delete from the result object. A second list allows to add new keys to the result or overwrite existing keys with new values.