Skip to main content

Ads Platform Integrations

UniPulse integrates with Meta Ads (Facebook/Instagram) and TikTok Promote for campaign management, post boosting, and ad performance tracking.


Supported Platforms

PlatformAPIFeaturesSync Queue
Meta AdsMarketing API v19+Create campaigns, boost posts, read insightsad-sync
TikTok PromoteTikTok Ads APIBoost TikTok videos, read performancead-sync

Meta Ads Manager

Authentication

OAuth 2.0 via Facebook Login with the ads_management and ads_read permissions. Uses the same token as the social account connection.

Capabilities

FeatureAPI CallDescription
Create campaignMarketing API - Campaign creationFull campaign setup with targeting
Boost postMarketing API - Promote existing postTurn organic post into ad
Read insightsGET /act_{ad-account-id}/insightsSpend, reach, conversions, CPM, CPC
Manage ad setsMarketing API - Ad set CRUDAudience targeting, budget, schedule

Auto-Boost Rules

The AutoBoostRule model enables automatic post promotion when performance thresholds are met:

Rule ConditionExampleAction
Engagement rate above thresholdengagementRate > 5%Boost with specified budget
Reach above thresholdreach > 10000 in first 2 hoursBoost for wider reach
Specific content typeclassification.category == 'promotional'Boost with conversion objective

Configuration

// AutoBoostRule example
{
workspaceId: 'ws_123',
conditions: {
metric: 'engagementRate',
operator: 'gt',
value: 5,
timeWindow: '2h',
},
budget: {
amount: 50,
currency: 'USD',
duration: '3d',
},
targeting: {
audiences: ['existing_followers', 'lookalike'],
},
enabled: true,
}

TikTok Promote

Authentication

TikTok Ads OAuth with promote.create and promote.read scopes. Linked to the existing TikTok social account.

Capabilities

FeatureDescription
Boost videosPromote existing TikTok videos to wider audience
Read performanceCampaign views, clicks, spend, conversions
Auto-boostSame rule engine as Meta, targeting TikTok content

Ad Performance Sync

The ad-sync queue periodically fetches ad performance metrics from both platforms:

Synced Metrics

MetricMeta AdsTikTok Promote
SpendYesYes
ReachYesYes
ImpressionsYesYes
ClicksYesYes
ConversionsYesYes
CPMYesCalculated
CPCYesCalculated
ROASYes (with e-commerce)Yes (with e-commerce)

Database Models

ModelPurposeKey Fields
AdCampaignAd campaign recordsworkspaceId, platform, externalId, budget, status, metrics
AutoBoostRuleAutomatic boost rulesworkspaceId, conditions, budget, targeting, enabled

API Endpoints

EndpointMethodDescription
/api/v1/adsGETList ad campaigns with performance
/api/v1/adsPOSTCreate ad campaign or boost rule
/api/v1/ads/:idPATCHUpdate campaign or rule
/api/v1/ads/:idDELETEDelete campaign or rule

All ads routes require authenticate, requireWorkspace('EDITOR'), and requireFeature('ads').


Cross-Reference