Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Priyanshu471/ad-management/llms.txt

Use this file to discover all available pages before exploring further.

The campaign creation flow at /advertiser/create walks you through a structured multi-section form to configure every aspect of your new ad campaign — from the campaign name and objective through audience targeting, budget allocation, and media asset uploads. Once submitted, the campaign is persisted to MongoDB and immediately appears in the Recent Campaigns table rendered below the creation form, as well as in the full campaigns list at /advertiser/campaigns.
The create form requires you to be logged in. The userId field sent with the creation request is read from the useUser() Zustand store. If you are not authenticated, you will be redirected before the form loads.

Campaign Creation Form

1

Campaign Info

The first section captures the core identity of your campaign.
  • Title — The campaign name displayed throughout the dashboard (text input, required).
  • Description — A short summary of the campaign’s purpose (text input, optional).
  • Objective — Select one of nine campaign objectives that define the primary goal of your ad:
ObjectiveDescription
Brand AwarenessIncrease awareness for your brand
ReachShow your ad to the maximum number of people
TrafficSend more people to a destination
EngagementGet more post engagements
App installsGet more people to install your app
Video viewsGet more people to view your video content
Lead generationDrive more sales leads
MessagesGet more people to send messages
ConversionsGet more people to take valuable actions
2

Targeting

The targeting section lets you narrow your audience by demographics, geography, and interests. These fields are displayed for campaign planning purposes — they are not included in the API submission payload.
  • Age Range — Text input for the target age bracket (e.g. 18-65).
  • Location — Two dropdowns:
    • Country: IND, US, UK, CA
    • Region: Urban (Metro cities), Suburban (Small cities), Rural (Villages)
  • Income Range — Text input for the target income bracket (e.g. ₹50,000).
  • Interests — Multi-select InterestSelector component with 14 categories:
food · sports · music · travel · technology · fashion · health · finance · entertainment · education · beauty · home · pets · automotiveEach category expands to reveal granular interest tags (e.g. the technology category includes Gadgets, Artificial Intelligence, and more). You can select multiple tags across multiple categories.
3

Budget & Duration

Define how much to spend and for how long the campaign should run.
  • Budget — Total campaign spend (text input, e.g. ₹50,000).
  • Duration — Length of the campaign (text input, e.g. 30 days).
The budget you enter is divided equally across the campaign duration. For example, a budget of ₹50,000 over 30 days allocates approximately ₹1,667 per day.
4

File Uploads

Attach media assets to your campaign using the drag-and-drop file input.
  • Upload method — Drag files onto the upload zone or click to open a file picker.
  • Accepted types — Images, logos, and videos.
  • Maximum file size — 10 MB per file.

API Submission

On form submission the CreateNew component sends a POST request to /api/campaign with the campaign payload. Only the fields captured by the refs in handleSubmit are included — targeting fields (age range, location, income range, interests) are UI-only and are not sent to the server.
// POST /api/campaign
const res = await fetch("/api/campaign", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    title: "My Campaign",
    description: "Campaign description",
    objective: "Brand Awareness",
    budget: "50000",
    duration: "30 days",
    userId: "65f1a2b3c4d5e6f7a8b9c0d1"
  }),
});

Success Response

A successful creation returns HTTP 200 with the newly created campaign document.
{
  "newCampaign": {
    "_id": "65f1a2b3c4d5e6f7a8b9c0d2",
    "title": "My Campaign",
    "description": "Campaign description",
    "objective": "Brand Awareness",
    "status": "Active",
    "budget": "50000",
    "duration": "30 days",
    "user": "65f1a2b3c4d5e6f7a8b9c0d1",
    "createdAt": "2024-01-15T10:30:00.000Z"
  }
}
All new campaigns are assigned a status of "Active" by default.

Recent Campaigns Table

After creation, the /advertiser/create page renders a Recent Campaigns table below the form showing campaigns already associated with your account. This table uses a different column set from the main Campaigns page:
ColumnDescription
NameCampaign title
StatusCurrent lifecycle status
BudgetTotal allocated budget
ObjectiveCampaign objective selected during creation
DurationCampaign duration as entered
EditOpens the Campaign Modal for inline edits

Build docs developers (and LLMs) love