5 min read

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

2. name

3. objective

4. status

5. specialAdCategories

6. dailyBudget

7. lifetimeBudget

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.

  1. Input Handling: It starts by retrieving and prioritizing inputs over configuration defaults.
  2. Validation: Validates mandatory fields and responds with error messages when necessary.
  3. Integration Call: Uses the the integration connection to connect to the Meta API and makes a call to createCampaign with the required parameters.
  4. Error Management: Captures any failure in the API call and returns error details.
  5. Return Data: Responds with output data upon successful execution.

Expected Data

The function expects the parameters to be formatted correctly:

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:

javascript
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.