Create Campaign
Purpose
The node is responsible for creating a marketing campaign within a specified advertising account using the Meta Marketing API. This function ensures that all required parameters are provided and handles integration with Meta's services, providing feedback on success or failure during the operation.
Settings
1. adAccountId
- Input Type: String
- Description: This is the unique identifier for the advertising account in which the campaign will be created. It is mandatory for the operation to proceed. If omitted, the function returns an error message indicating the requirement for this field.
- Default Value:
''(empty string)
2. name
- Input Type: String
- Description: This setting represents the name of the campaign being created. Campaigns must have a distinct name to facilitate management and tracking. If this field is empty, the function returns an error notifying the user that a campaign name is required.
- Default Value:
''(empty string)
3. objective
- Input Type: String
- Description: The marketing objective of the campaign. This could be goals like awareness, engagement, conversions, etc. The role of this parameter is critical as it shapes how the campaign will be optimized. Omitting this results in an error, as campaigns must align with a specific objective.
- Default Value:
''(empty string)
4. status
- Input Type: String
- Description: Defines the initial status of the campaign upon creation. This can include statuses like "ACTIVE" or "PAUSED". The default status is set to "PAUSED", which means that the campaign will not start running immediately upon creation. Modifying this to "ACTIVE" enables immediate commencement of the campaign.
- Default Value:
'PAUSED'
5. specialAdCategories
- Input Type: String (JSON Array)
- Description: This setting allows for specifying any special ad categories that may apply to the campaign, such as social issues, elections, or politics. It accepts a JSON formatted string. By default, it will be an empty array if not specified. This is important for compliance with ad regulations when dealing with certain sensitive topics.
- Default Value:
'[]'(empty JSON array)
6. dailyBudget
- Input Type: Numeric (String)
- Description: Represents the maximum amount of money allocated for the campaign’s daily spending. Providing a budget here is crucial for controlling expenditures. If not set, it will be treated as
undefined, indicating no daily budget limit. - Default Value:
''(empty string)
7. lifetimeBudget
- Input Type: Numeric (String)
- Description: Similar to daily budget, but this parameter specifies the maximum spend for the entire lifetime of the campaign. If not specified, it is treated as
undefined, meaning no lifetime budget capping. - Default Value:
''(empty string)
How It Works
The node works by first extracting the input settings from either the inputs or config parameters. It checks for the mandatory fields (adAccountId, name, objective) and returns an error if any of those are missing. Upon successful validation, it attempts to create a campaign using a secure connection to establish communication with the Meta Marketing API.
- Input Handling: It starts by retrieving and prioritizing inputs over configuration defaults.
- Validation: Validates mandatory fields and responds with error messages when necessary.
- Integration Call: Uses the the integration connection to connect to the Meta API and makes a call to
createCampaignwith the required parameters. - Error Management: Captures any failure in the API call and returns error details.
- Return Data: Responds with output data upon successful execution.
Expected Data
The function expects the parameters to be formatted correctly:
- The
adAccountId,name, andobjectiveare required as strings. - The
statuscan be altered to either "ACTIVE" or "PAUSED". specialAdCategoriesmust be in a valid JSON format, whiledailyBudgetandlifetimeBudgetcan be numerical strings.
AI Integrations
Currently, there are no specific AI integrations mentioned within this logic. However, future enhancements could introduce predictive algorithms for optimizing budget allocation and targeting based on data-driven insights.
Billing Impacts
Creating marketing campaigns will incur costs based on the daily or lifetime budgets set in the dailyBudget and lifetimeBudget settings. Users must monitor these parameters carefully to avoid unexpected charges on their accounts. Adjusting budgets post-creation can impact campaign reach, effectiveness, and ultimately, return on investment.
Use Cases & Examples
Use Case 1: Launching a Product
A business plans to launch a new product and wants to run a campaign with the objective of "Conversions" targeted at a specific demographic.
Use Case 2: Event Promotion
An organization is hosting an upcoming event and requires brand awareness through social media ads to attract attendees.
Concrete Example Configuration
For the product launch use case, the configuration might look like this:
const campaignConfig = {
inputs: {
adAccountId: '1234567890',
name: 'Product Launch Campaign',
objective: 'CONVERSIONS',
status: 'ACTIVE',
specialAdCategories: '[]',
dailyBudget: '100',
lifetimeBudget: '1000',
},
config: {}
};In this case, the campaign will be created under the specified ad account, focusing on conversions, actively promoting the product with a daily budget of $100 and a lifetime limit of $1000. The specialAdCategories indicates that there are no pertinent regulatory concerns with this campaign.