Skip to content

Campaigns from the API fall back to the page's own copy when no model has credit - #236

Closed
ralyodio wants to merge 2 commits into
masterfrom
worktree-ads-api
Closed

Campaigns from the API fall back to the page's own copy when no model has credit#236
ralyodio wants to merge 2 commits into
masterfrom
worktree-ads-api

Conversation

@ralyodio

@ralyodio ralyodio commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #235. createCampaignForUrl failed on the very first live call: OpenAI has no credits and the Anthropic key is capped until 2026-10-01, so generateAdCreatives threw and the campaign was refused.

templateCopy(brand) now writes the creative set from the page's own title, description and palette (with the og:image as the hero), and the API uses it whenever the generator throws. Provider is recorded as template (…). Editable in the dashboard like any generated creative.

3 new tests; typecheck clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YafYxayh7Gqe5MWNNQMev2

ralyodio and others added 2 commits September 5, 2026 22:38
…CLI, and ad visits in stats

POST/GET /api/ads/v1/campaigns creates a campaign from a URL for a bearer
token caller: the page is read, the creatives written, the campaign saved
active. A live campaign for the same URL is returned instead of a twin.
POST/GET /api/ads/v1/slots creates a publisher slot on a site named by
hostname, finding or creating the site's project with the tracker on, and
answers with the two tags to paste.

The CLI gains `ads create|list` and `slots create|list` over the same
endpoints, with CRAWLPROOF_TOKEN.

The tracker now buckets a visit that arrived through an ad as ad:<ref>:
our click redirect appends ?ref=crawlproof-ad-NNN to the destination, and
paid utm tags name their source. Bots stay bots; the referrer no longer
hides a paid visit behind the page that carried the unit.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YafYxayh7Gqe5MWNNQMev2
… has credit

generateAdCreatives needs an AI provider with balance; with both providers
out, every campaign opened from the API or the CLI failed, so a blog post
published through myna ran no ad. templateCopy() writes the creative set
from the page's title, description and palette, and createCampaignForUrl
uses it when the generator throws. The provider is recorded as template.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YafYxayh7Gqe5MWNNQMev2
@ralyodio

ralyodio commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

Re-cut on top of master as a fresh branch (this one carried the squashed #235 commits and conflicted).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant