Configuring Dynamic Remarketing in Google Ads for 1С-Bitrix
Dynamic remarketing shows the user exactly the products they viewed on the site. For this you need three components: Google tag (gtag.js) with product ID transmission on each page, product feed in Google Merchant Center and configured campaign in Google Ads. Bitrix integrates with all three without installing third-party plugins.
Setting up Google tag with product parameters
Standard Google tag (gtag.js) needs to be supplemented with remarketing parameters. On product page transmit:
gtag('event', 'view_item', {
send_to: 'AW-XXXXXXXXX/XXXXXXXX',
value: <?= $arResult['CATALOG_PRICE_1']['PRICE'] ?>,
items: [{
id: '<?= $arResult['ID'] ?>',
google_business_vertical: 'retail'
}]
});
Variables from $arResult are substituted in PHP-template of bitrix:catalog.element component. Product ID is $arResult['ID'] (infoblock element ID). Make sure this same ID is used in Merchant Center feed (field id in XML).
On cart page (bitrix:sale.basket.basket) transmit products array:
gtag('event', 'begin_checkout', {
send_to: 'AW-XXXXXXXXX/XXXXXXXX',
items: [
<?php foreach ($arResult['ITEMS'] as $item): ?>
{id: '<?= $item['PRODUCT_ID'] ?>', quantity: <?= $item['QUANTITY'] ?>},
<?php endforeach; ?>
]
});
Product feed in Google Merchant Center
Feed is created via built-in Bitrix export or custom PHP script. Required fields for remarketing:
| Field | Source in Bitrix |
|---|---|
id |
b_iblock_element.ID |
title |
b_iblock_element.NAME |
description |
b_iblock_element.DETAIL_TEXT |
link |
DETAIL_PAGE_URL component |
image_link |
CFile::GetPath($PREVIEW_PICTURE) + domain |
price |
b_catalog_price.PRICE + currency |
availability |
by b_catalog_product.QUANTITY > 0 |
Save feed in Google XML format (/upload/google_feed.xml) and update by agent every 6–12 hours. In Merchant Center, add data source by URL.
Remarketing audience in Google Ads
After setting up Google tag, Google Ads automatically creates audience "Product page visitors". For dynamic remarketing, use audience "Product page visitors who haven't made purchase" — add exclusion condition for buyer audience (event purchase).
Send purchase event on "Thank you page" via bitrix:sale.order.ajax component handler or in successful order page template:
gtag('event', 'purchase', {
send_to: 'AW-XXXXXXXXX/XXXXXXXX',
transaction_id: '<?= $orderId ?>',
value: <?= $orderPrice ?>,
currency: 'RUB'
});
What we configure
-
gtag.jstag with eventsview_item,add_to_cart,begin_checkout,purchasein component templates - Product feed for Google Merchant Center with update agent
- Feed connection to Google Ads account via Merchant Center
- Remarketing audiences and Dynamic Remarketing campaign in Google Ads
- Field
idmatch in feed and ID transmitted in gtag







