Actions3
- Facebook Ads Actions
Overview
This node is a custom integration for Facebook Ads data within n8n. It allows users to interact with Facebook Ads accounts, retrieve ad account details, fetch specific ad information, and list ads within an account over specified date ranges. The node is designed as a testing or experimental version, with ongoing updates and bug fixes.
Common scenarios where this node is beneficial include:
- Marketing teams wanting to automate the retrieval of Facebook Ads performance data.
- Agencies managing multiple Facebook Ad accounts needing consolidated reporting.
- Data analysts integrating Facebook Ads metrics into broader workflows or dashboards.
Practical examples:
- Fetching all ad accounts linked to a user’s Facebook profile.
- Retrieving detailed information about a specific ad by its ID within a given date range.
- Listing all ads under a particular ad account with filtering by date and limiting the number of results.
Properties
| Name | Meaning |
|---|---|
| Đây là phiên bản Thử nghiệm Chúng tôi sẽ liên tục cập nhật và sửa lỗi. Mời bạn truy cập https://zalo.me/g/ebsiof941 để cập nhật thông tin mới nhất |
A notice informing users that this is an experimental version of the node with continuous updates and bug fixes. Users are invited to visit the provided URL for the latest information. |
The node internally supports parameters such as:
operation: Currently only one operation "Default" is supported.- Parameters related to Facebook Ads API calls like ad account IDs, ad IDs, date ranges (
since,until), and limits on returned items.
However, these internal parameters are not exposed in the provided input properties JSON and appear hardcoded or managed internally.
Output
The node outputs JSON data structured according to the operation performed:
For fetching ad accounts:
{ "success": true, "adAccounts": [ { "display_name": "BusinessName - AccountName (AccountID) [Status]", "formatted_info": { "account_name": "AccountName", "business_name": "BusinessName", "account_id": "AccountID", "status": "Status", "currency": "CurrencyCode", "timezone": "TimezoneName", "created_time": "CreationDate" } }, ... ], "totalAccounts": Number, "response": { /* raw API response */ } }For fetching a specific ad detail:
{ "success": true, "adId": "AdID", "dateRange": { "since": "YYYY-MM-DD", "until": "YYYY-MM-DD" }, "adDetail": { /* detailed ad info from Facebook API */ }, "response": { /* raw API response */ } }For listing ads in an account:
{ "success": true, "adAccountId": "act_AccountID", "dateRange": { "since": "YYYY-MM-DD", "until": "YYYY-MM-DD" }, "ads": [ /* array of ads */ ], "totalAds": Number, "response": { /* raw API response */ } }
No binary data output is indicated by the code.
Dependencies
- Requires a valid API authentication token credential for Facebook Ads API access.
- Makes HTTP requests to Facebook Graph API endpoints.
- Uses n8n's built-in HTTP request helper methods.
- Requires proper configuration of credentials within n8n to authenticate API calls.
Troubleshooting
Common issues:
- Invalid or expired API tokens causing authentication failures.
- Incorrect ad account or ad IDs leading to "not found" errors.
- Date range parameters improperly formatted or out of bounds.
- API rate limits or permission restrictions from Facebook.
Error messages:
- Errors thrown include descriptive messages with HTTP status codes and API response bodies.
- NodeOperationError is used to wrap API errors with additional context including item index.
- Users should verify credentials, parameter correctness, and Facebook API permissions if errors occur.
Links and References
- Facebook Graph API documentation: https://developers.facebook.com/docs/graph-api/
- Facebook Ads API overview: https://developers.facebook.com/docs/marketing-api/
- n8n HTTP Request node documentation: https://docs.n8n.io/nodes/n8n-nodes-base.httpRequest/
