Migrating from Deprecated Pixels

We deprecated the Conversion Tracking Pixel in February, 2017, and it is no longer available for use. Start using the new Facebook pixel today — a single pixel for more powerful advertising and measurement. For additional information about how to transition from the conversion tracking pixel to the Facebook pixel, see Advertiser Help Center, Facebook Pixel.

If you use the Custom Audience Pixel or Conversion Tracking Pixel, you'll want to migrate to the Facebook Pixel. To start, get the new pixel code:

Get the Pixel

Update the Pixel

The core JavaScript code for the original Custom Audience Pixel and the Conversion Tracking Pixel both look like this:

(function() {
  var _fbq = window._fbq || (window._fbq = []);
  if (!_fbq.loaded) {
    var fbds = document.createElement('script');
    fbds.async = true;
    fbds.src = 'https://connect.facebook.net/en_US/fbds.js';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(fbds, s);
    _fbq.loaded = true;
  _fbq.push(['addPixelId', '<PIXEL_ID>']);
window._fbq = window._fbq || [];
<noscript><img height="1" width="1" alt="" style="display:none" src="https://www.facebook.com/tr?ev=<PIXEL_ID>&amp;cd[value]=0.00&amp;cd[currency]=USD&amp;noscript=1" /></noscript>

Go through your pages that contain this code and replace this with the Facebook Pixel code, but make sure to replace FB_PIXEL_ID with your Facebook pixel ID:

<!-- Facebook Pixel Code -->
// Insert Your Facebook Pixel ID below. 
fbq('init', 'FB_PIXEL_ID');
fbq('track', 'PageView');
<!-- Insert Your Facebook Pixel ID below. --> 
<noscript><img height="1" width="1" style="display:none"
<!-- End Facebook Pixel Code -->

Updating Events

When you upgrade to the new pixel you also need to update the code used to track events on your website.

For the Conversion Tracking Pixel, you track conversions as follows:


_fbq.push(['track','PIXEL_ID', { 'value': 0.00, 'currency': 'USD' }]);


<img height="1" width="1" style="display:none"

Where PIXEL_ID is the Conversion pixel ID that you want to track and the {...} contains information you want to log when the event occurs, such as the conversion value.

With the Facebook Pixel, you can continue to support the Conversion Tracking pixel conversions, until it is deprecated, using the following code:


fbq('track', 'PIXEL_ID', { value: 0.00, currency: 'USD' });


<img height="1" width="1" style="display:none"

The code for both standard and custom events with the Custom Audience Pixel looks like this:


_fbq.push(['track','Purchase',{ 'value': 0.00, 'currency': 'USD' }]);
_fbq.push(['track','CustomEvent',{ 'value': 0.00, 'currency': 'USD' }]);


<img height="1" width="1" style="display:none"

<img height="1" width="1" style="display:none"

In the Facebook Pixel, there is a new syntax which looks like this:


fbq('track', 'Purchase', { value: 0.00, currency: 'USD' });
fbq('trackCustom', 'CustomEvent', { value: 0.00, currency: 'USD' });/>


<img height="1" width="1" style="display:none"

<img height="1" width="1" style="display:none"

In this example we use the track value to indicate we're logging a standard event of type Purchase and we use trackCustom to track the custom events we define for use in Custom Audiences and custom conversions.