Learn how to create and configure campaigns with all available options and best practices.
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);
string
- The campaign name (must be unique)
string
- Detailed description of the campaign
string
- Target industry (e.g., "ecommerce", "healthcare", "finance")
"draft" | "active" | "paused" | "completed"
- Campaign status (default: "draft")
string | Date
- When the campaign should start
string | Date
- When the campaign should end
number
- Campaign budget in USD
string[]
- Array of tags for categorization
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
});
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
Include date, target audience, or campaign type in the name for easy identification
Always create campaigns in "draft" status and test before activating
Define start and end dates to ensure campaigns run for the intended duration
Tag campaigns consistently to enable easy filtering and reporting