Step 1: Create a Meta Developer App
- Go to developers.facebook.com
- Log in with your Facebook account
- Go to "My Apps" and click "Create App"
- Select "Business" as the app type
- Name your app (e.g., "Founder CreativeOS")
- Select your business account
- Click "Create App"
Step 2: Set Up Marketing API
- In your app dashboard, find "Add Products" and select "Marketing API"
- Click "Set Up"
- Grant the following permissions:
- ads_management
- ads_read
- read_insights
- Generate an access token with these permissions
- Save this token for use in n8n
Step 3: Configure the Meta API Workflow in n8n
- Create a new workflow for ad performance tracking
- Start with a "Schedule Trigger" node (daily or weekly execution)
- Add an "HTTP Request" node for the Graph API:
- Method: GET
- URL:
https://graph.facebook.com/v18.0/me/adaccounts
- Headers: Include your access token
- Add a "Split In Batches" node to iterate through accounts
- Add additional HTTP nodes to:
- Get campaigns
- Get ad sets
- Get ads
- Get insights