New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(Facebook Lead Ads Trigger Node): Add Facebook Lead Ads Trigger Node #7113
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
ecbd73d
Add new Facebook Lead Ads Node
elsmr 3e5338a
Add simplifyOutput option, add form and page metadata, throw when web…
elsmr b4e3040
Add error message indicating Facebook only allows 1 webhook URL per App
elsmr 7a33367
Merge branch 'master' into node-740-facebook-lead-ads
elsmr b1ea969
Remove App Secret field, hide webhook URLs when automatically registered
elsmr a104406
Add notice to Lead Ads node about limitation, fix non-simplified output
elsmr 7548bd9
Show facebook error message when something goes wrong
elsmr 16baca6
Defensive code around pagination fields
elsmr 1fab07d
Merge branch 'master' into node-740-facebook-lead-ads
elsmr bf3ed0e
Remove changes to Facebook Trigger webhook method
elsmr 3e633cf
remove unused type import
maspio 75f8ca1
Merge branch 'master' into node-740-facebook-lead-ads
maspio b77247b
Change hasLifecycleMethods type to boolean
elsmr 6367779
Merge branch 'master' into node-740-facebook-lead-ads
elsmr File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
packages/nodes-base/credentials/FacebookLeadAdsOAuth2Api.credentials.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import type { ICredentialType, INodeProperties } from 'n8n-workflow'; | ||
|
||
export class FacebookLeadAdsOAuth2Api implements ICredentialType { | ||
name = 'facebookLeadAdsOAuth2Api'; | ||
|
||
extends = ['oAuth2Api']; | ||
|
||
displayName = 'Facebook Lead Ads OAuth2 API'; | ||
|
||
documentationUrl = 'facebookleadads'; | ||
|
||
properties: INodeProperties[] = [ | ||
{ | ||
displayName: 'Grant Type', | ||
name: 'grantType', | ||
type: 'hidden', | ||
default: 'authorizationCode', | ||
}, | ||
{ | ||
displayName: 'Authorization URL', | ||
name: 'authUrl', | ||
type: 'hidden', | ||
default: 'https://www.facebook.com/v17.0/dialog/oauth', | ||
required: true, | ||
}, | ||
{ | ||
displayName: 'Access Token URL', | ||
name: 'accessTokenUrl', | ||
type: 'hidden', | ||
default: 'https://graph.facebook.com/v17.0/oauth/access_token', | ||
required: true, | ||
}, | ||
{ | ||
displayName: 'Scope', | ||
name: 'scope', | ||
type: 'hidden', | ||
default: 'leads_retrieval pages_show_list pages_manage_metadata pages_manage_ads', | ||
}, | ||
{ | ||
displayName: 'Auth URI Query Parameters', | ||
name: 'authQueryParameters', | ||
type: 'hidden', | ||
default: '', | ||
}, | ||
{ | ||
displayName: 'Authentication', | ||
name: 'authentication', | ||
type: 'hidden', | ||
default: 'header', | ||
}, | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
export interface FacebookEvent { | ||
object: string; | ||
entry: FacebookPageEventEntry[]; | ||
} | ||
|
||
export interface FacebookPageEventEntry { | ||
id: string; | ||
time: number; | ||
changes: [ | ||
{ | ||
field: 'leadgen'; | ||
value: { | ||
ad_id: string; | ||
form_id: string; | ||
leadgen_id: string; | ||
created_time: number; | ||
page_id: string; | ||
adgroup_id: string; | ||
}; | ||
}, | ||
]; | ||
} | ||
|
||
export interface FacebookWebhookSubscription { | ||
object: string; | ||
callback_url: string; | ||
fields: string[]; | ||
status: boolean; | ||
} |
18 changes: 18 additions & 0 deletions
18
packages/nodes-base/nodes/FacebookLeadAds/FacebookLeadAdsTrigger.node.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"node": "n8n-nodes-base.facebookLeadAdsTrigger", | ||
"nodeVersion": "1.0", | ||
"codexVersion": "1.0", | ||
"categories": ["Marketing & Content"], | ||
"resources": { | ||
"credentialDocumentation": [ | ||
{ | ||
"url": "https://docs.n8n.io/integrations/credentials/facebookleadads/" | ||
} | ||
], | ||
"primaryDocumentation": [ | ||
{ | ||
"url": "https://docs.n8n.io/integrations/builtin/trigger-nodes/n8n-nodes-base.facebookleadadstrigger/" | ||
} | ||
] | ||
} | ||
} |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elsmr just FYI: we've reverted this check in #7783
For more context: Slack thread.