Create Ads
Search and Display campaigns in one call
Create a Search Campaign
const ad = await zernio.adcampaigns.createStandaloneAd({ body: {
accountId: "acc_googleads_123",
adAccountId: "987-654-3210",
name: "US DevOps Search",
campaignType: "search",
goal: "traffic",
budgetAmount: 50,
budgetType: "daily",
headline: "Internal Developer Platforms",
body: "Spec-driven platform engineering.",
linkUrl: "https://example.com/platform",
keywords: ["platform engineering tools", "internal developer platform"],
additionalHeadlines: ["Build your Dev Platform", "Ship DevEx Faster", "Internal Platforms, Done Right"],
additionalDescriptions: ["Spec-driven platform. Free tier available.", "Enterprise features. Startup price."],
countries: ["US", "CA", "GB"],
}});ad = client.ad_campaigns.create_standalone_ad(
account_id="acc_googleads_123",
ad_account_id="987-654-3210",
name="US DevOps Search",
campaign_type="search",
goal="traffic",
budget_amount=50,
budget_type="daily",
headline="Internal Developer Platforms",
body="Spec-driven platform engineering.",
link_url="https://example.com/platform",
keywords=["platform engineering tools", "internal developer platform"],
additional_headlines=["Build your Dev Platform", "Ship DevEx Faster", "Internal Platforms, Done Right"],
additional_descriptions=["Spec-driven platform. Free tier available.", "Enterprise features. Startup price."],
countries=["US", "CA", "GB"],
)curl -X POST "https://zernio.com/api/v1/ads/create" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"accountId": "acc_googleads_123",
"adAccountId": "987-654-3210",
"name": "US DevOps Search",
"campaignType": "search",
"goal": "traffic",
"budgetAmount": 50,
"budgetType": "daily",
"headline": "Internal Developer Platforms",
"body": "Spec-driven platform engineering.",
"linkUrl": "https://example.com/platform",
"keywords": ["platform engineering tools", "internal developer platform"],
"additionalHeadlines": ["Build your Dev Platform", "Ship DevEx Faster", "Internal Platforms, Done Right"],
"additionalDescriptions": ["Spec-driven platform. Free tier available.", "Enterprise features. Startup price."],
"countries": ["US", "CA", "GB"]
}'Valid goal values for Google Ads: engagement, traffic, awareness, video_views. Conversion-goal campaigns aren't yet supported on /v1/ads/create, pass traffic for click-optimised delivery. campaignType is lowercase (search or display). keywords is a flat array of strings; match types default to broad.
Create a Display Campaign
const ad = await zernio.adcampaigns.createStandaloneAd({ body: {
accountId: "acc_googleads_123",
adAccountId: "987-654-3210",
name: "Retargeting Display",
campaignType: "display",
goal: "traffic",
budgetAmount: 40,
budgetType: "daily",
headline: "Finish your signup",
body: "Come back and upgrade today.",
linkUrl: "https://example.com/upgrade",
businessName: "Acme",
images: {
landscape: "https://cdn.example.com/retarget-1200x628.jpg",
square: "https://cdn.example.com/retarget-1080x1080.jpg",
},
additionalHeadlines: ["Finish your signup", "Get 30% off this week"],
additionalDescriptions: ["Come back and upgrade today."],
countries: ["US"],
}});ad = client.ad_campaigns.create_standalone_ad(
account_id="acc_googleads_123",
ad_account_id="987-654-3210",
name="Retargeting Display",
campaign_type="display",
goal="traffic",
budget_amount=40,
budget_type="daily",
headline="Finish your signup",
body="Come back and upgrade today.",
link_url="https://example.com/upgrade",
business_name="Acme",
images={
"landscape": "https://cdn.example.com/retarget-1200x628.jpg",
"square": "https://cdn.example.com/retarget-1080x1080.jpg",
},
additional_headlines=["Finish your signup", "Get 30% off this week"],
additional_descriptions=["Come back and upgrade today."],
countries=["US"],
)curl -X POST "https://zernio.com/api/v1/ads/create" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"accountId": "acc_googleads_123",
"adAccountId": "987-654-3210",
"name": "Retargeting Display",
"campaignType": "display",
"goal": "traffic",
"budgetAmount": 40,
"budgetType": "daily",
"headline": "Finish your signup",
"body": "Come back and upgrade today.",
"linkUrl": "https://example.com/upgrade",
"businessName": "Acme",
"images": {
"landscape": "https://cdn.example.com/retarget-1200x628.jpg",
"square": "https://cdn.example.com/retarget-1080x1080.jpg"
},
"additionalHeadlines": ["Finish your signup", "Get 30% off this week"],
"additionalDescriptions": ["Come back and upgrade today."],
"countries": ["US"]
}'Display campaigns require businessName (max 25 chars) on top of the Search fields. longHeadline defaults to headline if not supplied (max 90 chars). Both images.landscape and images.square are required, Google rejects RDA with only one.
Discovered campaigns of every type (including Performance Max, Shopping and Video) sync into GET /v1/ads/tree with metrics; /v1/ads/create builds Search and Display.