meta-ads
Create and manage Meta (Facebook & Instagram) ad campaigns, lead forms, audiences, pixels, and product catalogs via the Plai API. Also connects Facebook/Instagram and Google Ads accounts via OAuth. Use when the user asks to connect an ad account, create, pause, update, or report on Facebook or Instagram ads, set up lead generation forms, build custom or lookalike audiences, manage product catalogs, upload media, or view campaign performance insights.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/arsalan98m/meta-ai-adsMeta Ads via Plai
Manage Meta (Facebook & Instagram) advertising through the Plai API.
Setup
Requires two environment variables:
PLAI_API_KEY— your Plai API key (from your Plai account dashboard)PLAI_USER_ID— your Plai user ID
How to Run
All operations are run via:
node scripts/plai-meta.js <command> [options]
Options are passed as --key value pairs. JSON array/object values must be
passed as quoted JSON strings, e.g. --locations '[{"id":"2537","type":"city","countryCode":"AE"}]'.
Account Connection
This must be done before any ad operation. If an ad tool returns
"User has no connected Facebook account" or similar, generate a connection
link and share it with the user so they can complete the OAuth flow.
Generate an account connection link
# Connect Facebook / Instagram Ads account
node scripts/plai-meta.js create-connection-link --platform FACEBOOK
# Connect Google Ads account
node scripts/plai-meta.js create-connection-link --platform GOOGLE
# With a custom redirect after connection
node scripts/plai-meta.js create-connection-link \
--platform FACEBOOK \
--redirectUri "https://yourapp.com/connected"
Required: --platform (FACEBOOK | GOOGLE)
Optional: --redirectUri — URL the user lands on after completing OAuth
Returns a link the user must open in their browser to connect their account.
Share this link directly; do not attempt to open it automatically.
Campaign Management
List all campaigns
node scripts/plai-meta.js list-campaigns
Create a campaign
node scripts/plai-meta.js create-campaign \
--campaignName "My Campaign" \
--campaignType LEAD_GENERATION \
--budget 50 \
--url "https://example.com" \
--locations '[{"id":"2537","type":"city","countryCode":"AE"}]' \
--primaryText '[{"text":"Join us today!"}]' \
--images '["https://example.com/image.jpg"]' \
--leadsFormId "1234567890"
Required params: campaignName, campaignType, budget, locations
Required by type:
LEAD_GENERATION→ also requires--leadsFormIdCONVERSIONS/OUTCOME_SALES→ also requires--pixelIdand--conversionGoal
Optional params: --url, --primaryText, --headlines, --images, --videos,
--interests, --gender ("1" male / "2" female), --minAge, --maxAge,
--targetLocales, --audienceId
Notes:
--imagestakes a JSON array of URL strings — they are automatically transformed to{url}objects.--minAgeand--maxAgemust both be provided together.callToActionis alwaysLEARN_MORE(set automatically).
campaignType values: LEAD_GENERATION | LINK_CLICKS | CONVERSIONS | OUTCOME_SALES
Create a message engagement campaign
Drives conversations via messaging apps (Messenger, Instagram DM, WhatsApp).
Metadata
Not sure this is the right skill?
Describe what you want to build — we'll match you to the best skill from 16,000+ options.
Find the right skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-arsalan98m-meta-ai-ads": {
"enabled": true,
"auto_update": true
}
}
}