Custom Template for Google Tag Manager: Google Enhanced Ecommerce data transfer to remarketing pixels
This tag gets data from Google Enhanced Ecommerce configured via dataLayer and sends it to dynamic remarketing pixels:
This tag uses Google Enhanced Ecommerce configured via dataLayer to get event and product data, so you need it to be on your site, otherwise this tag will not work.
This tag intercepts dataLayer.push, so it should be fired only via All Pages or DOM Ready triggers.
You can run several copies of the tag on the page, for example, one for VK, the second for Facebook, etc.
The tag injects this script to the site for its work.
If your security policy does not allow loading third-party scripts, you can install this data transfer script as a GTM Custom HTML tag. In this case, no third-party scripts will be loaded to your site. To do this, fill the settings object in the code with your data and set All Pages trigger for this GTM Custom HTML tag.
Pixels events and data structure of each event are compiled in accordance with the official documentation of each pixel.
The tag doesn't add anything from itself to the event or product data, it takes only what is in Google Enhanced Ecommerce. If Google Enhanced Ecommerce is missing something, it will be absent in dynamic remarketing pixels as well.
Description of events and data structures:
- view_home
- view_category
- view_search
- view_other
- view_product
- add_to_cart
- remove_from_cart
- init_checkout
- purchase
Website homepage view.
Event data structure:
{
priсeListID, // Price list ID
name, // Event name
{
[
{
id, // Product ID
group_id, // Product brandname
price // Product price
},
…
],
category_ids // Product categories, for example: 'phones,tablets,headphones'
}
}
Website catalog page view.
Event data structure:
{
priсeListID, // Price list ID
name, // Event name
{
[
{
id, // Product ID
group_id, // Product brandname
price // Product price
},
…
],
category_ids // Product categories, for example: 'phones,tablets,headphones'
}
}
Page with site search results view.
Event data structure:
{
priсeListID, // Price list ID
name, // Event name
{
[
{
id, // Product ID
group_id, // Product brandname
price // Product price
},
…
],
category_ids, // Product categories, for example: 'phones,tablets,headphones'
search_string // Search query
}
}
Other page view.
Event data structure:
{
priсeListID, // Price list ID
name, // Event name
{
[
{
id, // Product ID
group_id, // Product brandname
price // Product price
},
…
],
category_ids // Product categories, for example: 'phones,tablets,headphones'
}
}
Product detail view.
Event data structure:
{
priсeListID, // Price list ID
name, // Event name
{
[
{
id, // Product ID
group_id, // Product brandname
price // Product price
},
…
],
category_ids, // Product categories, for example: 'phones,tablets,headphones'
currency_code, // Currency code
total_price // Total price
}
}
Add product to cart.
Event data structure:
{
priсeListID, // Price list ID
name, // Event name
{
[
{
id, // Product ID
group_id, // Product brandname
price // Product price
},
…
],
category_ids, // Product categories, for example: 'phones,tablets,headphones'
currency_code, // Currency code
total_price // Total price
}
}
Remove product from cart.
Event data structure:
{
priсeListID, // Price list ID
name, // Event name
{
[
{
id, // Product ID
group_id, // Product brandname
price // Product price
},
…
],
category_ids, // Product categories, for example: 'phones,tablets,headphones'
currency_code, // Currency code
total_price // Total price
}
}
Checkout process start.
Event data structure:
{
priсeListID, // Price list ID
name, // Event name
{
[
{
id, // Product ID
group_id, // Product brandname
price // Product price
},
…
],
category_ids, // Product categories, for example: 'phones,tablets,headphones'
currency_code, // Currency code
total_price // Total price
}
}
Product purchase.
Event data structure:
{
priсeListID, // Price list ID
name, // Event name
{
[
{
id, // Product ID
group_id, // Product brandname
price // Product price
},
…
],
category_ids, // Product categories, for example: 'phones,tablets,headphones'
currency_code, // Currency code
total_price // Total price
}
}
- ViewHome
- ViewCategory
- Search
- ViewOther
- ViewContent
- AddToCart
- RemoveFromCart
- InitiateCheckout
- Purchase
Website homepage view.
Event data structure:
{
'trackCustom', // Method of data send
name, // Event name
{
[
{
id, // Product ID
quantity, // Product quantity
item_price // Product price
},
…
],
content_name, // Product names, for example: 'Apple iPhone X Black,Samsung Galaxy A80 128Gb'
content_type // Product type
}
}
Website catalog page view.
Event data structure:
{
'trackCustom', // Method of data send
name, // Event name
{
[
{
id, // Product ID
quantity, // Product quantity
item_price // Product price
},
…
],
content_name, // Product names, for example: 'Apple iPhone X Black,Samsung Galaxy A80 128Gb'
content_type // Product type
}
}
Page with site search results view.
Event data structure:
{
'track', // Method of data send
name, // Event name
{
[
{
id, // Product ID
quantity, // Product quantity
item_price // Product price
},
…
],
content_category, // Product categories, for example: 'phones,tablets,headphones'
search_string // Search query
}
}
Other page view.
Event data structure:
{
'trackCustom', // Method of data send
name, // Event name
{
[
{
id, // Product ID
quantity, // Product quantity
item_price // Product price
},
…
],
content_name, // Product names, for example: 'Apple iPhone X Black,Samsung Galaxy A80 128Gb'
content_type // Product type
}
}
Product detail view.
Event data structure:
{
'track', // Method of data send
name, // Event name
{
[
{
id, // Product ID
quantity, // Product quantity
item_price // Product price
},
…
],
content_name, // Product names, for example: 'Apple iPhone X Black,Samsung Galaxy A80 128Gb'
content_type, // Product type
currency, // Currency code
value // Total price
}
}
Add product to cart.
Event data structure:
{
'track', // Method of data send
name, // Event name
{
[
{
id, // Product ID
quantity, // Product quantity
item_price // Product price
},
…
],
content_name, // Product names, for example: 'Apple iPhone X Black,Samsung Galaxy A80 128Gb'
content_type, // Product type
currency, // Currency code
value // Total price
}
}
Remove product from cart.
Event data structure:
{
'trackCustom', // Method of data send
name, // Event name
{
[
{
id, // Product ID
quantity, // Product quantity
item_price // Product price
},
…
],
content_name, // Product names, for example: 'Apple iPhone X Black,Samsung Galaxy A80 128Gb'
content_type, // Product type
currency, // Currency code
value // Total price
}
}
Checkout process start.
Event data structure:
{
'track', // Method of data send
name, // Event name
{
[
{
id, // Product ID
quantity, // Product quantity
item_price // Product price
},
…
],
content_category, // Product categories, for example: 'phones,tablets,headphones'
num_items, // Number of product items
currency, // Currency code
value // Total price
}
}
Product purchase.
Event data structure:
{
'track', // Method of data send
name, // Event name
{
[
{
id, // Product ID
quantity, // Product quantity
item_price // Product price
},
…
],
content_name, // Product names, for example: 'Apple iPhone X Black,Samsung Galaxy A80 128Gb'
content_type, // Product type
currency, // Currency code
value, // Total price
num_items // Number of product items
}
}
Website homepage view.
Event data structure:
{
id, // Counter ID
type, // Event type
[productid, …], // Product ID(s)
pagetype, // Event name
list // Feed ID
}
Website catalog page view.
Event data structure:
{
id, // Counter ID
type, // Event type
[productid, …], // Product ID(s)
pagetype, // Event name
list // Feed ID
}
Page with site search results view.
Event data structure:
{
id, // Counter ID
type, // Event type
[productid, …], // Product ID(s)
pagetype, // Event name
list // Feed ID
}
Other page view.
Event data structure:
{
id, // Counter ID
type, // Event type
[productid, …], // Product ID(s)
pagetype, // Event name
list // Feed ID
}
Product detail view.
Event data structure:
{
id, // Counter ID
type, // Event type
[productid, …], // Product ID(s)
pagetype, // Event name
list, // Feed ID
totalvalue // Total price
}
Add product to cart.
Event data structure:
{
id, // Counter ID
type, // Event type
[productid, …], // Product ID(s)
pagetype, // Event name
list, // Feed ID
totalvalue // Total price
}
Product purchase.
Event data structure:
{
id, // Counter ID
type, // Event type
[productid, …], // Product ID(s)
pagetype, // Event name
list, // Feed ID
totalvalue // Total price
}