API stands for application programming interface, which is the intermediary code that allows applications to talk to each other. All major ad platforms have APIs, and with a little know-how, you can write pieces of code that will help you manage your advertising better.
On most platforms, APIs automate certain processes that you’d otherwise have to do manually. On Facebook, however, the API functions a little differently and is more powerful because it contains features that you simply can’t access via the Facebook Ads interface.
Without coding experience, API documentation can be difficult to understand. Keeping that in mind, let’s take a look at the parts of Facebook Ads that are only accessible via API — and discuss when it might be worth diving into them.
When you’re searching for interested audiences in the Facebook Ads interface, you’re directly querying Facebook’s Targeting Search API.
Given a collection of letters or words, this API will return a list of “interest audiences” that match your query. For example, if you start typing a word like car into the interest audience search bar inside an ad set, you’ll see results like car racing, car rentals, and electric cars.
But there’s more to it: Facebook Ads only lets you see 25 interest audiences for any search. This isn’t because the Targeting Search API only returns 25 audiences; it’s because Ads Manager artificially limits what you see to the first 25 results.
This is particularly limiting if you are trying to:
If you query the API directly instead, you see every interest audience that’s relevant to your search. From here, you can simply add these to your ad sets.
If you’re interested in learning more about interest audience searches, here’s the relevant API document.
If you’re advertising a product where LTV is important, then you likely know the factors that influence LTV. You might know, for instance, that women using your brand have a 20% higher LTV than men, or that LTV increases steadily with user age.
While this is good contextual information, it can be difficult to translate into actionable strategy. You might be tempted to take advantage of it by creating different campaigns for each age and gender combination, working toward a different CPA for each. This would be highly complex to manage though, not to mention the small size of each campaign will limit how much you learn.
A better solution is to use Facebook’s bid modifiers API. This lets you run a single ad set targeting any audience you want — all while working to different CPA targets for each segment.
As a basic example, you might run an ad set targeting males and females, working towards a CPA target of $10. If I happened to know that females had a 20% higher LTV, I could apply a +20% bid modifier to females, and effectively work towards a $12 CPA for them. This lets you work towards different LTVs for different audience segments, without having to fragment your campaign.
The bid modifier API has been around for more than a year, but is still in closed beta phase. You can reach out to your Facebook rep if you’re interested in getting access.
Facebook’s experimentation tools have come a long way in recent years. The experiments tab within Ads Manager now allows for complex, multi-cell tests, both with and without holdout groups (otherwise known as lift tests).
Long before these features were available in Ads Manager though, they were accessible via the Facebook API. To this day, there are still some experimentation options that you can only access via the API:
You can find more information on these features in the split testing and conversion lift API documents.
Lastly, we have lookalike audiences. Building your lookalike audiences through the Facebook API gives you two main advantages over building them through Ads Manager’s audience screen:
This can be useful when you’re looking to run broader campaigns (broader than a 10% lookalike), but want to stop short of targeting a whole country. These 20% lookalikes can also be layered on top of specific interest audiences, helping refine your audience without overly restricting volume.
You can find out more on how to take advantage of these two features in the lookalike API docs.
Clearly, there is more to advertising on Facebook than just the Ads Manager platform. While navigating the API and relevant documentation can be a little technical, it can also be very valuable for advertisers. Not every API-only feature will apply to each advertiser, but it’s good to be aware of them when you do run into potential use cases. While some of these features will get built into Ads Manager over time, some of them will likely remain hidden in the API — and only available to advertisers who know where to look.
Get industry insights and news directly to your inbox.
Thank you. Check your email for details on your request.
Cookie | Duration | Description |
---|---|---|
__hssrc | session | This cookie is set by Hubspot whenever it changes the session cookie. The __hssrc cookie set to 1 indicates that the user has restarted the browser, and if the cookie does not exist, it is assumed to be a new session. |
checkForPermission | 10 minutes | This cookie is set by Beeswax to determine whether the user has accepted the cookie consent box. |
cookielawinfo-checkbox-advertisement | 1 year | Set by the GDPR Cookie Consent plugin, this cookie is used to record the user consent for the cookies in the "Advertisement" category . |
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
CookieLawInfoConsent | 1 year | Records the default button state of the corresponding category & the status of CCPA. It works only in coordination with the primary cookie. |
elementor | never | This cookie is used by the website's WordPress theme. It allows the website owner to implement or change the website's content in real-time. |
JSESSIONID | session | The JSESSIONID cookie is used by New Relic to store a session identifier so that New Relic can monitor session counts for an application. |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |
Cookie | Duration | Description |
---|---|---|
__cf_bm | 30 minutes | This cookie, set by Cloudflare, is used to support Cloudflare Bot Management. |
__hssc | 30 minutes | HubSpot sets this cookie to keep track of sessions and to determine if HubSpot should increment the session number and timestamps in the __hstc cookie. |
bcookie | 2 years | LinkedIn sets this cookie from LinkedIn share buttons and ad tags to recognize browser ID. |
bscookie | 2 years | LinkedIn sets this cookie to store performed actions on the website. |
lang | session | LinkedIn sets this cookie to remember a user's language setting. |
lidc | 1 day | LinkedIn sets the lidc cookie to facilitate data center selection. |
UserMatchHistory | 1 month | LinkedIn sets this cookie for LinkedIn Ads ID syncing. |
Cookie | Duration | Description |
---|---|---|
_uetsid | 1 day | Bing Ads sets this cookie to engage with a user that has previously visited the website. |
_uetvid | 1 year 24 days | Bing Ads sets this cookie to engage with a user that has previously visited the website. |
Cookie | Duration | Description |
---|---|---|
__hstc | 1 year 24 days | This is the main cookie set by Hubspot, for tracking visitors. It contains the domain, initial timestamp (first visit), last timestamp (last visit), current timestamp (this visit), and session number (increments for each subsequent session). |
__lotl | 5 months 27 days | This cookie is set by Lucky Orange to identify the traffic source URL of the visitor's orginal referrer, if any. |
_ga | 2 years | The _ga cookie, installed by Google Analytics, calculates visitor, session and campaign data and also keeps track of site usage for the site's analytics report. The cookie stores information anonymously and assigns a randomly generated number to recognize unique visitors. |
_gcl_au | 3 months | Provided by Google Tag Manager to experiment advertisement efficiency of websites using their services. |
_gd_session | 4 hours | This cookie is used for collecting information on users visit to the website. It collects data such as total number of visits, average time spent on the website and the pages loaded. |
_gd_svisitor | 2 years | This cookie is set by the Google Analytics. This cookie is used for tracking the signup commissions via affiliate program. |
_gd_visitor | 2 years | This cookie is used for collecting information on the users visit such as number of visits, average time spent on the website and the pages loaded for displaying targeted ads. |
_gid | 1 day | Installed by Google Analytics, _gid cookie stores information on how visitors use a website, while also creating an analytics report of the website's performance. Some of the data that are collected include the number of visitors, their source, and the pages they visit anonymously. |
_hjAbsoluteSessionInProgress | 30 minutes | Hotjar sets this cookie to detect the first pageview session of a user. This is a True/False flag set by the cookie. |
_hjFirstSeen | 30 minutes | Hotjar sets this cookie to identify a new user’s first session. It stores a true/false value, indicating whether it was the first time Hotjar saw this user. |
_hjIncludedInPageviewSample | 2 minutes | Hotjar sets this cookie to know whether a user is included in the data sampling defined by the site's pageview limit. |
_lo_uid | 2 years | This cookie is set by Lucky Orange as a unique identifier for the visitor. |
_lo_v | 1 year | This cookie is set by Lucky Orange to show the total number of visitor's visits. |
_lorid | 10 minutes | This cookie is set by Lucky Orange to identify the ID of the visitors current recording. |
hubspotutk | 1 year 24 days | HubSpot sets this cookie to keep track of the visitors to the website. This cookie is passed to HubSpot on form submission and used when deduplicating contacts. |
IR_gbd | session | Impact Radius sets this cookie to store a unique ID which is used to identify the user's device, when they return to the websites that used the same network. |
Cookie | Duration | Description |
---|---|---|
__qca | 1 year 26 days | The __qca cookie is associated with Quantcast. This anonymous data helps us to better understand users' needs and customize the website accordingly. |
_fbp | 3 months | This cookie is set by Facebook to display advertisements when either on Facebook or on a digital platform powered by Facebook advertising, after visiting the website. |
_mkto_trk | 2 years | This cookie, provided by Marketo, has information (such as a unique user ID) that is used to track the user's site usage. The cookies set by Marketo are readable only by Marketo. |
B | 1 year | This Cookie is used by Yahoo to anonymously store data related to user's visits, such as the number of visits, average time spent on the website and what pages have been loaded. This data helps to customize website content to enhance user experience. |
bito | 1 year 1 month | This cookie is set by Beeswax for advertisement purposes. |
bitoIsSecure | 1 year 1 month | Beeswax sets this cookie for targeting and advertising. The cookie is used to serve the user with relevant advertisements based on real time bidding. |
fr | 3 months | Facebook sets this cookie to show relevant advertisements to users by tracking user behaviour across the web, on sites that have Facebook pixel or Facebook social plugin. |
mc | 1 year 1 month | Quantserve sets the mc cookie to anonymously track user behaviour on the website. |
MUID | 1 year 24 days | Bing sets this cookie to recognize unique web browsers visiting Microsoft sites. This cookie is used for advertising, site analytics, and other operations. |
test_cookie | 15 minutes | The test_cookie is set by doubleclick.net and is used to determine if the user's browser supports cookies. |
tuuid | 2 years | The tuuid cookie, set by BidSwitch, stores an unique ID to determine what adverts the users have seen if they have visited any of the advertiser's websites. The information is used to decide when and how often users will see a certain banner. |
tuuid_lu | 2 years | This cookie, set by BidSwitch, stores a unique ID to determine what adverts the users have seen while visiting an advertiser's website. This information is then used to understand when and how often users will see a certain banner. |
Cookie | Duration | Description |
---|---|---|
__pdst | 1 year | No description available. |
_an_uid | 7 days | No description available. |
_dc_gtm_UA-61749619-1 | 1 minute | No description |
_dlt | 1 day | No description |
_hjSession_1771567 | 30 minutes | No description |
_hjSessionUser_1771567 | 1 year | No description |
_nx-nocache | session | No description available. |
6suuid | 2 years | No description available. |
A3 | 1 year | No description |
ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/ | session | No description |
AnalyticsSyncHistory | 1 month | No description |
BIGipServerab44web-nginx-app_https | session | No description |
bounceClientVisit3783c | 30 minutes | No description |
bounceClientVisit3783v | 30 minutes | No description |
dgzsdl08v4 | 10 minutes | No description |
IR_11658 | session | No description |
li_gc | 2 years | No description |
tableau_locale | session | No description available. |
tableau_public_negotiated_locale | session | No description available. |
test | 1 year | No description available. |