Locoia
  • Overview
  • Account and User Settings
    • User types
    • Adding Users
    • Teams
    • Access Permissions
    • 2 Factor Authentication 2FA
    • Versioning and Snapshots
    • Activity Log
  • Reset your Password
  • Invoices and Payments
  • Automation
    • Flow Builder
      • Flow Building Best Practices
      • Jinja Template Language
        • Jinja: (Custom) variables, wildcards and functions
        • Magic Code Samples
      • Connectors & APIs
        • Titles and References
        • Referencing data of objects, lists, arrays - how to pass data dynamically
        • Accessing Objects with JSONPath
        • Merging nested JSON objects
        • Parsing JSONs from String
        • Response Headers & Status Codes
        • Custom Data Fields
        • Wildcard API calls and actions
        • Response cleaning
      • Text Strings, Date & Time, Numbers and Currencies
        • Text and Strings
        • Dates & Time
        • Numbers (Thousand Separators, Currencies)
      • Email-formatting
      • Code Fields
      • Running single Flow steps
      • Flow run data retention, logging, and error notifications
      • Advanced View
      • Dynamic Title
      • Custom Error Handling
      • Error Handling Flows
      • Automatic Pagination
    • Flow Debugger
      • Automatic Retrying
      • Run Flows again
      • Troubleshooting Flows
    • Community Library
  • Connectors & Helpers
    • Connectors
      • Monday.com
      • ActiveCampaign
      • Aircall
      • Allthings
      • Amplitude
      • Animus
      • Assetti
      • Awork
      • AWS RDS Database - How to connect
      • bubble.io
      • Casavi
      • Chargebee
      • CleverReach
      • comgy
      • commercetools
      • Everreal
      • Exact Online
      • Facebook Marketing
      • Fahrländer Partner
      • FastBill
      • FILESTAGE.io
      • Freshdesk
      • Freshsales
      • Google Ads
      • Google Ads Lead Form
      • Google Analytics
      • Google Chat
      • Google Drive
      • Google Sheets
      • Gmail
      • HubSpot
      • Heyflow
      • iDWELL
      • ImmobilienScout24
      • Instagram Ads
      • Intercom
      • klaviyo
      • Kiwi Opening Doors
      • Klenty
      • Klipfolio
      • Kolibri CRM
      • konfipay
      • KUGU
      • Shopify
      • S3 AWS
      • SQS AWS
      • Lambda AWS
      • Learnster
      • lexoffice
      • LineMetrics
      • Linkedin
      • Locoia
      • Notion
      • MailGun
      • Makula
      • Microsoft Dynamics 365
      • Microsoft OneDrive
      • MixPanel
      • MongoDB
      • Odoo
      • OnFleet
      • OnOffice
      • Oracle NetSuite
      • Outbrain
      • Quickbooks
      • Trello
      • PandaDoc
      • Personio
      • Pinterest Ads
      • Pipedrive
      • Plentific
      • PriceHubble
      • relay
      • REALCUBE
      • Sage ERP
      • Salesforce
      • SAP
      • Scoro
      • Seafile
      • sevDesk
      • SharePoint
      • SharpSpring
      • Slack
      • Snapchat Marketing
      • Snowflake
      • Teamleader Focus
      • Teamwork.com
      • Tableau
      • TikTok
      • TinQwise
      • The Trade Desk
      • Twitter
      • Typeform
      • WordPress
      • Xero
      • Youtube
      • Zendesk
      • Zoho CRM
      • Zoom
    • Helpers
      • Scheduler
      • Webhook
      • Dict Helper
      • Spreadsheet Helper
      • REST Helper
      • Boolean Helper
      • Multi Case Helper
      • Looper
      • FTP Helper
      • CSV Helper
      • XLSX Helper
      • Mail Sender
      • Flow Trigger
      • File Storage Helper
      • Terminate Helper
      • Delay Helper
      • SQL Connector
      • PDF Helper
      • Zip Helper
      • Data Warehouse Helper
      • XML Helper
      • Form Helper
      • Arrow
      • Error Arrow
    • Authentication Types Available
      • Setting up authentication
      • OAuth1
      • OAuth2
      • Refreshable token
      • AWS Signature
      • Basic Auth and Other Simple Authentication Methods
      • How are API versioning and API updates handeled?
      • Custom OAuth2 clients (apps)
    • Building Connectors
      • Base Connector Setup
        • Connector Auth Validation
        • GraphQL APIs
        • Rendering with User Input
      • Building Connector Actions
        • Actions Examples
      • Search Automation
      • Pagination Automation
      • Uploading Files in Actions
      • Working with SOAP APIs
    • Super Actions
    • Webhook Trigger for Connectors
    • Data Mapping and Env Variables
  • Embed - White Label Portal
    • Embed Overview
      • 1. Embed Flow
        • 1.1 Creating Embed Flows
        • 1.2 Updating Embed Flows
        • 1.3 Embed Error Handling
        • 1.4 Setting up Callbacks for Integration activation/deactivation
        • 1.5 Setting up Remote search
        • 1.6 Setting up End User logs
      • 2. Configure Embed
        • 2.1 Embed Integration via SSO
        • 2.2 Proprietary connector setup
        • 2.3 Sharing level
        • 2.4 Consent screen
        • 2.5 Account Secrets
        • 2.7 Further settings
      • 3. Integrate Embed
        • 3.1 iframe vs native embed
        • 3.2 Customizing CSS
        • 3.3 Events emitted from iframe to parent window
      • 4. Embed for End User
        • 4.1 Embed Remote Search
        • 4.2 Embed End User Logs
      • 5. Test Embed Configuration
        • Testing example
      • 6. Embed Integrations and Connector Auths
    • Embed FAQs
  • Data and Dashboards
    • Dashboards & Insights
      • Introduction to Dashboards
      • Introduction to Insights
      • Introduction to Data Sources
      • Dashboard Filters
      • Insight Marketplace - Using Pre-Built Insights
      • Writing SQL Queries
      • Useful SQL Examples
      • Charts
        • Line Chart
        • Bar and Horizontal Bar Chart
        • Stat Card
        • Pie Chart
        • Gauge Chart
        • Donut Chart
        • Stacked Bar, Horizontal Stacked Bar, and Normalized Horizontal Stacked Bar
        • Multiple Line Chart
        • Pivot Table
        • Map Chart
  • Best Practice Guides
    • Integration Best Practices
    • Integration Check List
    • CSV Files in Excel
    • Multi-Tenant Flows
    • On-Premise Integrations
    • Database Connection Setup
    • Data and General Security
    • Using Tags
    • FAQ
  • API
    • Locoia API Authentication - Personal Access Token
    • Create Connector Authentication
  • Contact us
  • Status of Service
  • Data Privacy
  • Imprint
Powered by GitBook
On this page
  • Helpful links
  • Finding User and Page IDs
  • User ID
  • Page ID
  • Use Cases
  • Facebook Lead Ads
  • Custom Audience Uploads

Was this helpful?

  1. Connectors & Helpers
  2. Connectors

Facebook Marketing

Facebook custom audiences

PreviousExact OnlineNextFahrländer Partner

Last updated 2 years ago

Was this helpful?

Helpful links

  • - latest v11.0 as of August 2021.

  • Permissions and .

  • Base URL: https://graph.facebook.com/<VERSION>/

  • Test Facebook Graph API Playground: https://developers.facebook.com/tools/explorer?method=GET&path=me%3Ffields%3Did%2Cname&version=v12.0

Finding User and Page IDs

You need to know your Facebook User and Page IDs for a few actions, here is how to find them.

User ID

  1. Go to the Facebook with the Facebook user you used to authenticate with Locoia

  2. Click on View and edit next to the Locoia integration

  3. Scroll to the very bottom to see your user ID.

Page ID

Use Cases

Facebook Lead Ads

Rate Limits

200 multiplied by 24 multiplied by the number of leads created in the past 30 days for the Facebook page.

Custom Audience Uploads

The Data Processing Terms need to be accepted to upload custom audiences: https://business.facebook.com/ads/manage/customaudiences/tos/?act=1234567890

1234567890 has to be replaced with the respective account id.

For app builders: Any app needs at least the scopes ads_management to have access.

1. Creating a custom audience with Curl

curl -X POST \
  -D '{
     "name": "My new Custom Audience 1",
     "subtype": "CUSTOM",
     "description": "People who purchased on my website",
     "customer_file_source": "USER_PROVIDED_ONLY"
  }' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {{ token }}' \
https://graph.facebook.com/v12.0/act_{{ my ad account id }}/customaudiences

2. Adding mobile device data using Curl

curl -X POST \
  -D '{
    "payload": {
        "schema": [ "MADID" ],
        "data": [
            [
                "{{ my mobile device id }}"
            ],
            [
                "{{ my mobile device id }}"
            ]
        ]
    },
    "session": {
        "session_id": "{{ some session id }}",
        "batch_seq": 1,
        "last_batch_flag": true,
        "estimated_num_total": 2
    }}' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer {{ token }}' \
https://graph.facebook.com/v12.0/{{ my audience id }}/users

If your JSON is malformatted, you will get this error: { "error": { "message" : "(#100) Invalid parameter", "type": "OAuthException", "code": 100,"fbtrace_id": "some id" } }

Endpoints

To find your page ID, you can follow the (here a direct link to ).

Retrieving Leads API docs by Facebook can be .

You can find your lead ads forms and form IDs .

You can find your Facebook ad account id on the . It is in the upper right or in the URL. You should replace it in the above URL with {{ ... }}. So a final URL can look like https://graph.facebook.com/v11.0/act_1234567890/ followed by the endpoint, customaudience

Error explanation page can be .

Creating a Custom audience based on CRM or similar data - . Creating manually as a user, can be found here https://www.facebook.com/adsmanager/audiences?act=xxxxxaccount_id&tool=AUDIENCES&nav_source=business_manager In order to make this endpoint work, you need to connect it with a business.

official Facebook instructions
your Facebook pages
found here
here
page here
found here
Customer File Custom Audiences
API Versions
Scopes
Business Integrations settings
Facebook User ID in integration settings