Retargeting pixel integration for remarketing

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Showing 1 of 1 servicesAll 2065 services
Retargeting pixel integration for remarketing
Simple
from 1 business day to 3 business days
FAQ
Our competencies:
Development stages
Latest works
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    822
  • image_crm_chasseurs_493_0.webp
    CRM development for Chasseurs
    847
  • image_website-sbh_0.png
    Website development for SBH Partners
    999
  • image_website-_0.png
    Website development for Red Pear
    451

Retargeting Pixel Integration for Remarketing

Retargeting pixel is JavaScript code from ad platform, installed on site and records visitors in audience for later ad display. Pixel writes cookie to user's browser, transmits visit data to platform servers, and user starts seeing your ads in search, social networks, and partner networks.

Main Pixels

Most commonly installed: Meta Pixel (Facebook/Instagram), VK Pixel, Google Ads remarketing tag, Yandex Audience pixel, TikTok Pixel. Each has own syntax, but logic is same—base code on all pages plus events on specific actions.

Meta Pixel

<!-- Base code — in <head> of all pages -->
<script>
!function(f,b,e,v,n,t,s)
{if(f.fbq)return;n=f.fbq=function(){n.callMethod?
n.callMethod.apply(n,arguments):n.queue.push(arguments)};
if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';
n.queue=[];t=b.createElement(e);t.async=!0;
t.src=v;s=b.getElementsByTagName(e)[0];
s.parentNode.insertBefore(t,s)}(window, document,'script',
'https://connect.facebook.net/en_US/fbevents.js');
fbq('init', 'YOUR_PIXEL_ID');
fbq('track', 'PageView');
</script>

Events for remarketing:

// Product view
fbq('track', 'ViewContent', {
  content_ids: ['PRODUCT_123'],
  content_type: 'product',
  value: 4900,
  currency: 'RUB',
});

// Add to cart
fbq('track', 'AddToCart', {
  content_ids: ['PRODUCT_123'],
  content_type: 'product',
  value: 4900,
  currency: 'RUB',
  num_items: 1,
});

// Purchase
fbq('track', 'Purchase', {
  value: 14700,
  currency: 'RUB',
  content_ids: ['PRODUCT_123', 'PRODUCT_456'],
  content_type: 'product',
  num_items: 2,
});

VK Pixel

<script type="text/javascript">
!function(){var t=document.createElement("script");
t.type="text/javascript",t.async=!0,t.src='https://vk.com/js/api/openapi.js?169',
t.onload=function(){VK.Retargeting.Init("VK-RTRG-XXXXXX-XXXXX"),VK.Retargeting.Hit()},
document.head.appendChild(t)}();
</script>
// VK events
VK.Retargeting.Event('add_to_cart');
VK.Retargeting.Event('purchase');
VK.Retargeting.ProductEvent('view_product', { id: 'PRODUCT_123', price: 4900, currency: 'RUB' });

Yandex Audience Pixel

Yandex uses two different tools: Metrika counter for remarketing and Audience pixel for external sites.

<!-- Yandex.Metrika — if site already has counter, remarketing configured via goals -->
<script>
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();k=e.createElement(t);a=e.getElementsByTagName(t)[0];
k.async=1;k.src=r;a.parentNode.insertBefore(k,a)})(
window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
ym(COUNTER_ID, "init", { clickmap: true, trackLinks: true, accurateTrackBounce: true });
</script>
// Goal achievement for remarketing audience
ym(COUNTER_ID, 'reachGoal', 'add_to_cart');
ym(COUNTER_ID, 'reachGoal', 'purchase', { order_price: 14700, currency: 'RUB' });

Installation via GTM

Recommended way—via Google Tag Manager. All pixels added to GTM, not directly in site code. Allows adding/removing pixels without deploy.

On site only need:

<!-- GTM container — in <head> -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-XXXXXXX');</script>

<!-- GTM noscript — right after <body> -->
<noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-XXXXXXX"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>

In GTM create tags for each pixel with needed triggers. Events pass via dataLayer:

// Send event to dataLayer for GTM
window.dataLayer = window.dataLayer || [];

// On product page
dataLayer.push({
  event: 'view_item',
  ecommerce: {
    items: [{
      item_id: 'PRODUCT_123',
      item_name: 'MacBook Pro 14',
      item_category: 'laptops',
      price: 89900,
      currency: 'RUB',
      quantity: 1,
    }],
  },
});

GTM trigger Custom Event: view_item fires Meta, VK, and Yandex tags simultaneously.

Server-Side Pixel (Conversions API)

Browser pixels blocked by AdBlock and iOS ITP. Server-Side Conversions API solves this: events sent from server directly to ad platform API.

// Meta Conversions API — send event from server
$response = Http::withHeaders([
    'Authorization' => 'Bearer ' . config('meta.access_token'),
])->post("https://graph.facebook.com/v18.0/{$pixelId}/events", [
    'data' => [[
        'event_name'  => 'Purchase',
        'event_time'  => time(),
        'action_source' => 'website',
        'user_data'   => [
            'em'  => hash('sha256', strtolower(trim($user->email))),
            'ph'  => hash('sha256', preg_replace('/\D/', '', $user->phone)),
            'client_ip_address' => $request->ip(),
            'client_user_agent' => $request->userAgent(),
        ],
        'custom_data' => [
            'value'    => $order->total,
            'currency' => 'RUB',
            'order_id' => (string) $order->id,
        ],
    ]],
    'test_event_code' => config('meta.test_code'), // remove in production
]);

Verification

Meta: Meta Pixel Helper extension shows which events fire with what data. VK: "Statistics" in audience account—data should appear in 30-60 minutes. Yandex: "Metrika → Reports → Audience" — "Remarketing" section.

Timeline

Basic pixel setup (Meta + VK + Yandex) via GTM: 2-4 hours. Event markup (ViewContent, AddToCart, Purchase) via dataLayer: 4-8 hours. Server-Side Conversions API for Meta: 1 day.