Marketing API Version

Custom Audiences from your Website FAQ


Custom Audiences from your website makes it easy to reach people who visit your website and deliver the right message to them on Facebook.

Using Custom Audiences from your website you can create an audience representing any group of customers or prospective customers that express interest in your product on your website. Later, you can reach these people with targeted Facebook Ads. For example, you could run a campaign to reach out to those who visited your site and viewed a page about yellow shoes but have not made a purchase.

Custom Audiences from your website requires use of the Facebook pixel, which is a small piece of javascript placed on every page of a website.


Q: How do I use Custom Audiences from Your Website?

A: Custom Audiences from your website is a new way to reach your customers on Facebook.

Now you can reach people who have recently visited your website and deliver them highly relevant ads based on interest they express in your products. This might be current customers who have viewed a particular product or service page, potential customers who have not yet registered, or simply re-engaging recently visitors by delivering them highly relevant messages.

This is great way to drive potential customers who have expressed interest in your products back to your website.

Q: What are the benefits Custom Audiences from your website?

A: Custom Audience from your website can be used to

  • Remarket to people using your website
  • Make your existing ads more efficient by excluding audiences of people who have already converted on your message
  • Create lookalike audiences of people who look like the people browsing your website

By tracking how each customer progresses in a process (e.g., which checkpoints a customer has completed), an advertiser can more effectively influence customers who have expressed interest in their products through the entire process. For example, using Facebook pixel an advertiser could capture intent based on activity of people who are viewing pages about a loyalty program, browsing a particular product page, or filling out a preferences form'. Later the advertiser could serve relevant ads to these people to help them complete the conversion.

Q: How do I create a Website Custom Audiences?

A: To create Custom Audiences from your website:

  1. Go to your Facebook Ads Manager
  2. Select Audiences from the left side tab
  3. Click on Custom Audiences from Your Website.
  4. Agree to the Terms of Service beforehand.
  5. You will be taken to a lightbox asking for Audience Name and Visited URLs. Here you can input any page, keywords, or URLs where the pixel will be executed on your site. This can also include args or any advanced query strings or parameters within the URL if needed.
  6. You will also have the ability provide negative statements where “doesn’t contain” will be an option. An example could be, contains any “/plane/” and doesn’t contain “accessories.”
  7. Set the retention window for how long you would like people to remain in this Website Custom Audience. You can input a few as 1 and as many as 180 days.
  8. Make sure to double check your Audience rule to ensure that there are no errors.
  9. Once completed, click on the View Facebook pixel link. Copy and paste this javascript into the HTML of every page of your website. Please make sure to copy the entire javascript snippet from the beginning to the end.

Q: How do I edit an existing Website Custom Audience?

A: To edit an existing Website Custom Audience:

  1. Go to your ads manager
  2. Select Audiences from the left side tab
  3. Navigate to the Audience Segment created and click on the Pencil icon on the right hand side. You will be displayed a light box interface where you can add or delete the rules originally created.

When you add or remove people, the system typically updates within a few hours. Your ads will continue running in the meantime.

If you edit the audience rules, the new rules will only apply to people added from that moment forward. The previous rules will continue to apply to existing people in the Website Custom Audience.

Q: How many audiences can I create?

A: At this time, there is a maximum of 10000 Custom Audiences from your Website that can be created in a single account.

Q: Can I exclude a Website Custom Audience from my ad targeting?

A: Yes, you can exclude a Website Custom Audience from your ad targeting. Exclusion targeting lets you prevent a particular audience from seeing your ad to help you tailor your advertising message more precisely. For example, you can exclude an audience of your current customers if you're running a campaign to acquire new customers.

To exclude your custom audience in Power Editor, when you're in the audience section of creating an ad, go to advanced add the custom audience to the Excluded Audiences list.

To exclude your custom audience in the ads create tool, hover over the audience name and you'll see a carrot that you can click on to exclude the selected audience.

Q: What is the maximum duration where customers will stay within my website custom audience?

A: The longest duration can be set for 180 days. After 180 days, customers who have been within the Website Custom Audience will be removed unless they revisit the website again and match the same audience rule.

Q: Can I create a Lookalike Audience of a Website Custom Audience?

A: Yes, you can create Lookalikes of Website Custom Audiences. To do so select Lookalikes from the New Audience dropdown in the Audiences tab of Ad Manager.

Q: Will Dating & Gambling clients be permitted to use Custom Audiences from Your Website?

A: Yes, Dating clients will be able to leverage Custom Audiences from Your Website, but Gambling website must be approved and vetted through the sales team on a managed list. There will need to be demographic restrictions (21 years +) enacted.

Q: What bid type should we leverage for Custom Audiences from Your Website? oCPM? CPC? Or CPM?

A: We recommend using CPM bidding against a Website Custom Audience target until the Website Custom Audience has reached a sufficiently large size. Start off with CPM and then migrate to oCPM or CPC once sufficient scale has been achieved.

Q: Can I access both mobile and web inventory with Custom Audiences from your website?

A: Yes, Custom Audiences from Your Website works with all native ad format and serves across all Facebook inventory including desktop, mobile, and tablet.

Q: How does Custom Audiences from Your Website relate to FBX? Aren’t they just the same thing?

A: FBX and Website Custom Audiences are complementary products. FBX is best when advertisers require real-time product level dynamic ads, which is not yet easily facilitated by Custom Audiences from Your Website. However FBX is limited to desktop inventory. Custom Audiences from Your Website allows targeting across browsers, overlaying of Facebook data, access to mobile inventory, and usage of all Facebook ad units, all of which are not available on FBX.

Q: What is the user retention parameter based on? When the audience is created, when the pixel has been placed, or when the pixel fired?

A: When structuring the campaign, Custom Audiences from Your Website requests a duration where customers will be retained within the audience created. The duration is in relation to when the customers visited the advertiser website and fired the pixel. For example, with a retention window of 30 days, if someone visits a website and matches an Audience rule on June 1st they will automatically expire from the Website Custom Audience on June 30.

Q: Are Rules solely based on URLs? Can we apply more complex rules for sophisticated clients?

A: Advertisers can create rules based on URLs people have visited or on Custom Data events sent from Facebook pixel. Using Custom Data, Website Custom Audiences could be created based upon SKUs, Pricing, Color, or any other arbitrary attribute sent to Facebook. To learn more about Custom events read the Facebook pixel documentation.

Q: What Privacy Features do we have enabled for Custom Audiences from Your Website?

A: Custom Audiences from your website was designed from the bottom up with privacy in mind. No personal information is reported to the advertiser about any individual person on the website and Website Custom Audiences can only be targeted in ads once they have reached a critical mass by which it is impossible to learn the individual identity an any person visiting a website.

In addition we have enabled an AdChoices link that will enable people to learn more and opt out of the targeted ad they are seeing. They will also have the ability to click on the “x” in the upper right hand corner to reveal further options. They also have the ability to:

  • "Hide this ad": if someone chooses this, they won't see that ad again (Facebook native). This is specific to the ad ID within the campaign only.

  • "Hide all ads": if someone chooses this, they won't see any other ads from that advertiser (Facebook native). It will hide/block any ads from either that subdomain ( or or the page ( if we have it. It will block the sub-domain or page across ad accounts.

  • "Why Am I seeing this Ad?"

Q: Are View Tags allowed when running for Custom Audiences from Your Website?

A: No, not at this time. View Tags are not yet permitted for Custom Audiences from Your Website clients. Only Atlas view tag are accepted at this time.

Q: Can Website Custom Audiences be shared with another account or FBMP?

A: Yes, it is possible to share Website Custom Audiences.

Q: If I delete a Website Custom Audience, what happens to my Campaign that is targeting this Website Custom Audience?

A: If an Active campaign is targeting a Website Custom Audience and that Website Custom Audience is deleted the campaign will then be put placed on Pause.

Q: How quickly does my audience update?

A: The audience will be updated relatively close to real-time. Once customers navigate to the pages with a Facebook pixel and match an Audience rule, they will almost immediately be added to that Website Custom Audience. If this Website Custom Audience is being targeted with an ad the person will be eligible to be served an ad in a matter of minutes.

Facebook Pixel

The Facebook pixel is a small piece of javascript that is added to every page of a website that enables the Custom Audiences from your website product.

Q: What is Facebook pixel?

A: Facebook pixel is a small piece of JavaScript code that an advertiser places on every page of their website. This piece of code provides a set of lightweight functionalities for sending user-specific events and event-specific custom data to Facebook.

Advertisers can use Facebook pixel to capture intent information about how people are using their website. A single Facebook pixel is added to all pages of a website. This pixel reports back general information about the browsing session, a hashed version of the Facebook ID, and the URL being viewed. Optionally, an advertiser can send Custom Data back to Facebook that contained additional information about the browsing session.

For example, when a customer adds a product into her wish list, an advertiser can optionally send Custom Data to Facebook about this event such as product information. This product information then becomes available for use in Audience rules via the API.

Q: Do I have to add a new Facebook pixel to my website every time I create an audience?

A: No, it is not necessary to add multiple Facebook pixels to your website. There is one Facebook pixel generated per account. Simply add this Facebook pixel to all pages of your website one time, and use Audience rules to create different Website Custom Audiences.

Q: Is it possible to "piggyback" a Facebook pixel with another 3rd party tag?

A: Yes, the Custom Audiences from Your Website tag can piggyback off most other tags from the FBMP, Tag Manager, or DFA Floodlight tag. This is dependent on the sophistication of the 3rd party client – simple rules will not be a problem, but if dynamic variables are to be passed in through the JS event, it will require the 3rd party tag to receive them and pass them to the Facebook pixel via Custom Data fields.

Q: Can I use the IMG only version of the pixel?

A: Yes, you can use the IMG only portion of the pixel.

Q: What are other benefits of using the Javascript version of Facebook pixel?

A: The full Javascript version has the following advantages over the IMG only pixel:

  • It's cross-browser and cross-platform.
  • It's fast and loads asynchronously so it doesn't block the page load.
  • Built in cache buster increases effectiveness.
  • You can send custom data with large payloads using HTTP POST.
  • It captures the original page URL when the pixel is placed in a tag container

Q: What is a pixel ID?

A: A pixel ID is an identifier of the piece of code placed on an advertiser's website. There is one pixel ID per Facebook Ad account.

Q: How to obtain a Facebook pixel through the API?

A: A Facebook pixel is associated with an ad account. An advertiser can use Facebook Ads Graph API to obtain its Facebook pixel.

  curl -G -d "access_token=_____"\

The above API will return a JS code (aka, pixel code) that is similar to

<!-- Facebook Pixel Code -->

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

Q: Where should I place Facebook pixel in my website code?

A: We recommend placing Facebook pixel on all page of a website between the <head> sections of the website. An advertiser should place the pixel code on any page where remarketing or conversion events need to be captured. For most websites, there is a common header or footer that is shared by all pages. It may be easier and is recommended to place pixel code in this common header or footer.

Q: How can I fire Custom Data events using fbq?

A: The code below will fire and event using fbq:

  window.fbq = window.fbq || [];
  fbq.push(['track', eventName, customData]);

The pushed calls will not be executed until Facebook pixel is loaded. One can use fbq regardless if the page is ready or not. If the page is not ready, a track call will be delayed; otherwise, a track call will be executed immediately.

The parameter customData is optional.

  window.fbq = window.fbq || [];
  fbq.push(['track', eventName]);

Q: How to refer to custom data in Custom Audiences from Your Website rules?

A: One can refer to event name (under parameter 'event') and custom data in the same way as referring to the referral url (under parameter 'url') in Custom Audiences from Your Website rules. For example, the following rule matches all visitors:

  • of pages whose URLs contain 'signup', or
  • who are associated with event 'SignUp' by fbq.push(['track', 'SignUp']);
    'or': [
      { 'url': { 'i_contains': 'signup' } },
      { 'event': { 'i_contains': 'SignUp' } }

For another example, the following rule matches all visitors who have viewed any product in the TV category by fbq.push(['track', 'ViewProduct', {category: 'TV'}]);.

    'and': [
      { 'event': { 'i_contains': 'ViewProduct' } },
      { 'category': { 'i_contains': 'TV' } }

Q: How to track conversion events?

A: The above examples illustrate how one can track remarketing events. One can use the same way to track conversion events. The only difference is that one needs to replace eventName with conversion ID, which is created using the regular conversion creation flow (

  window.fbq = window.fbq || [];
  fbq.push(['track', 123456, {currency: 'USD', value: 30.00}]);

Ideally, one should not need to know whether her fired event is a conversion event or a remarketing event. For now, one would need to know the conversion ID in order to be able to fire a conversion event.

For example, if the old conversion pixel is

  var fb_param = {};
  fb_param.pixel_id = '1234567890';
  fb_param.value = '5.00';
  fb_param.currency = 'USD';
  (elided other code)

Then, using the new pixel, it will be

  window.fbq = window.fbq || [];
  fbq.push(['track', 1234567890, {currency: 'USD', value: 5.00}]);

Also note that the old conversion pixel allows only one pixel (either a conversion pixel or a remarketing pixel) on a page. The new pixel unifies both cases and allows multiple pixel firings (multiple conversion events or multiple remarketing events or both) on a page.

Q: How to use image only version of the pixel?

A: One can use image pixel by manually inserting an IMG tag in her pages.

  <img height="1" width="1" border="0" alt="" style="display:none"
    src=" name&cd[p1]=v1&cd[p2]=v2..." />

Here, custom data is represented as key-value pairs (pi, vi). Note that each parameter needs to be wrapped inside 'cd[...]'. For example, the following image pixel:

  <img height="1" width="1" border="0" alt="" style="display:none"
         &cd[category]=TV" />

Is equivalent to the following JS call (assuming account ID is 1234):

  window.fbq = window.fbq || [];
  fbq.push(['track', 'ViewProduct', {category: 'TV'}]);

Q: How to use image pixel to fire conversion events?

A: One can use an image pixel to fire a conversion event. To do so, use parameter 'ev' to specify conversion id, parameter 'cd[value]' to specify value, and parameter 'cd[currency]' to specify currency. For example,

  <img height="1" width="1" border="0" alt="" style="display:none"
         &cd[value]=5.00&cd[currency]=USD" />

Q: When to use image pixel?

A: By default, Facebook pixel code tries to fire events using JavaScript first. In case the browser has turned off JavaScript, Facebook pixel code tries to use image pixel. Due to the benefits below, it's recommended to always use JavaScript pixel.

  • JS pixel can be fired multiple times on each page load.
  • JS pixel can be used to control when an event should be fired (i.e., upon a button click).
  • JS pixel is not subject to HTTP GET limit in sending custom data.