OMX Logo
Documentation
Campaign SDK

Creating Campaigns

Learn how to create and configure campaigns with all available options and best practices.

Basic Campaign Creation

createCampaign() Method
Create a new campaign with required and optional parameters
import { createCampaignClient } from "@omx-sdk/campaign";

const campaignClient = createCampaignClient({
  clientId: "your-client-id",
  secretKey: "your-secret-key",
  teamId: "your-team-id"
});

// Basic campaign creation
const campaign = await campaignClient.createCampaign({
  name: "Black Friday Sale 2024",
  description: "Annual Black Friday promotion with 50% off",
  industry: "ecommerce",
  status: "draft"
});

console.log("Campaign created with ID:", campaign.id);

Campaign Parameters

Required Parameters

name

string - The campaign name (must be unique)

description

string - Detailed description of the campaign

industry

string - Target industry (e.g., "ecommerce", "healthcare", "finance")

Optional Parameters

status

"draft" | "active" | "paused" | "completed" - Campaign status (default: "draft")

startDate

string | Date - When the campaign should start

endDate

string | Date - When the campaign should end

budget

number - Campaign budget in USD

tags

string[] - Array of tags for categorization

Advanced Campaign Example

Complete Campaign Configuration
Example with all available parameters and configuration options
const advancedCampaign = await campaignClient.createCampaign({
  // Required parameters
  name: "Holiday Season 2024",
  description: "Comprehensive holiday marketing campaign with multiple touchpoints",
  industry: "retail",
  
  // Optional parameters
  status: "draft",
  startDate: "2024-11-01T00:00:00Z",
  endDate: "2024-12-31T23:59:59Z",
  budget: 50000,
  tags: ["holiday", "seasonal", "promotion", "retail"],
  
  // Campaign configuration
  targetAudience: {
    demographics: ["18-35", "36-50"],
    interests: ["fashion", "technology", "home-decor"],
    location: ["US", "CA", "UK"]
  },
  
  // Campaign goals
  objectives: [
    "increase_sales",
    "brand_awareness",
    "customer_acquisition"
  ],
  
  // Tracking parameters
  trackingPixel: "https://analytics.example.com/pixel?id=campaign-123",
  conversionGoals: [
    { type: "purchase", value: 100 },
    { type: "signup", value: 10 }
  ]
});

console.log("Advanced campaign created:", {
  id: advancedCampaign.id,
  name: advancedCampaign.name,
  status: advancedCampaign.status,
  createdAt: advancedCampaign.createdAt
});

Campaign Status Options

draft

Campaign is being prepared and not yet active

active

Campaign is running and executing actions

paused

Campaign is temporarily stopped

completed

Campaign has finished running

Best Practices

Use descriptive names

Include date, target audience, or campaign type in the name for easy identification

Start with draft status

Always create campaigns in "draft" status and test before activating

Set clear dates

Define start and end dates to ensure campaigns run for the intended duration

Use meaningful tags

Tag campaigns consistently to enable easy filtering and reporting