Skip to main content
Skip table of contents

Facebook

Introduction

Facebook Marketing API

Facebook Marketing API uses OAuth 2.0. Sign up for an application on Facebook first and get an OAuth client ID and client secret.

The process of having your app approved by Facebook may take around 5 business days.

Setup & Authentication

Setting up your Partner App

  1. Log into your Facebook account.

  2. Create a Facebook Developer account if you don’t already have one: https://developers.facebook.com

  3. Go to My Apps: https://developers.facebook.com/apps

  4. Select Create App, and select Business as the app type. Complete the following sections:

    • App Display Name: This is the name your users will see when they grant consent to access their data.

    • App Purpose: Set to Clients.

  5. Select Create App (You will be asked to enter your password).

  6. You should be faced with a screen entitled Add Products to Your App. Under Facebook Login, select Set Up.

  7. This should now be added. In the menu on the left, select Facebook Login > Settings.

  8. Under Valid OAuth Redirect URIs enter https://Your Service Domain/connector/callback
    (Your service domain can be found in your Cyclr console under Settings > General Settings > Service Domain.) and select Save Changes.

  9. Under App Review on the left, select Permissions and Features. Here you're going to set the permissions you'll be asking your user for when they see the consent screen. The permissions you choose will vary depending on your use case, but you will always need advanced access to the user's public profile to allow them to sign in.

  10. Search for public_profile, select Get Advanced Access, and complete the confirmation screen. You will notice that Advanced Access to public_profile is granted automatically. The other permissions will require a bit more admin.

  11. For this example, we'll add the leads_retrieval permission, which is required if you are working with Form submissions.

  12. Once you have requested Advanced Access on this (and any other permissions), you'll be invited to Edit App Review Request. Select this, complete all the required sections, and Submit for Review.

  13. Under Settings > Basic on the left menu, you'll be able to complete any missing sections, and copy your App ID and App Secret. Once your app has been approved by Facebook, you'll be able to use these to authenticate your App in Cyclr.

Authenticating your Facebook Cyclr Connector

Go to your Cyclr Console > Connectors > Connector Library > Facebook Marketing API > Setup.

Client ID: This is the App ID displayed after you create the Facebook app

Client Secret: This is the App Secret displayed after you create the Facebook app

Your Facebook Marketing API connector is now set up! You can test it by installing it in one of your user accounts.

Official Facebook Documentation

For reference, these links take you to Meta’s own documentation around their APIs:

Additional information

“Ad Leads” and “Form Leads” Method Categories

Both the Ad Leads and Form Leads Method Categories are copyable on the Connector Settings page of an installed Connector, allowing you to create versions of them for specific Ads or Forms.

You will need to provide an ID for the Ad or Form you’re creating the Method Category for. That ID can be obtained by calling Methods on the Connector, as described in the sections below.

Ad Leads

When creating a new Ad Leads Method Category to work with a specific Ad, you will need to obtain an Ad ID as described here:

  1. Use the Ad Accounts > List My Ad Accounts method to retrieve an Ad Account ID.

  2. Use the Ads > List Ads method with an Ad Account ID to retrieve an Ad ID.

  3. Expand the Ad Leads Method Category and select the Copy this Category to create a Custom Object Category icon image-20240523-092712.png

  4. Enter your Ad ID as the Object Name in the popup.

  5. Select Copy.

  6. A new Method Category will be created using the Ad ID as its name, e.g.:

    image-20240523-113127.png

Form Leads

When creating a new Form Leads Method Category to work with a specific Form, you will need to obtain a Form ID as described here:

  1. Use the Pages > List My Pages method to retrieve a Page ID.

  2. Use the Forms > List Forms method with a Page ID to retrieve a Form ID.

  3. Expand the Form Leads method category and select the Copy this Category to create a Custom Object Category icon image-20240523-092712.png

  4. Enter your Form ID as the Object Name in the popup.

  5. Select Copy.

  6. A new Method Category will be created using the Form ID as its name, e.g.:

    image-20240523-133734.png

Create Ad Set "Promoted Object"

The Promoted Object is required for certain campaign objectives. The below table outlines the required Promoted Object fields based on the Optimization Goal.

Optimization Goal

Promoted Object Field

CONVERSIONS

  • Pixel ID (Conversion pixel ID)

  • Pixel ID (Facebook pixel ID) and Custom Event Type

  • Pixel ID (Facebook pixel ID), Pixel Rule and Custom Event Type

  • Event ID (Facebook event ID) and Custom Event Type

  • Application ID, Object Store URL, and Custom Event Type for mobile app events

  • Offline Conversion Data Set ID (Offline dataset ID) and Custom Event Type for offline conversions

PAGE_LIKES

  • Page ID

OFFER_CLAIMS

  • Page ID

LINK_CLICKS

  • Application ID and Object Store URL for mobile app or Canvas app engagement link clicks

APP_INSTALLS

  • Application ID and Object Store URL

OFFSITE_CONVERSIONS

  • Application ID, Object Store URL, and Custom Event Type (Standard Events)

PRODUCT_CATALOG_SALES

  • Product Set ID

  • Product Set ID and Custom Event Type

LEAD_GENERATION

  • Page ID

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.