> ## Documentation Index
> Fetch the complete documentation index at: https://docs.semicola.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Set up an event source

> Use when a buyer campaign needs conversion measurement: find or create the advertiser's event source, confirm events are arriving, and attach it to the campaign goal.

Skill `set-up-an-event-source` · version 1.0.0 · for buyers.

## When to use

* A person wants a campaign to optimize for purchases, leads or another conversion.
* A person asks whether their site is sending conversion events.
* [Set up a campaign](/skills/set-up-a-campaign) found a conversion goal in the brief.

## Before you start

* You are connected to the buyer account and know the `advertiserId`.
* You know which conversions matter to the person and on which domains they happen.
* Someone who can change the advertiser's website or app is available to install the tag.

## Steps

1. Call `get_status` and confirm the account and advertiser.
2. Call `search` with `kind: "measurement_source"` and reuse an event source that already covers
   the advertiser.
3. Call `get` with `kind: "measurement_source"` and the id. Read its event types, allowed domains
   and health: `not_seen`, `receiving` or `needs_attention`.
4. If there is no suitable source, call `open_page` with `page: "event_sources"` and the
   `advertiserId` in `arguments`. The person creates the source there, picks event types and
   allowed domains, and copies the snippet. v3 has no tool that creates an event source directly.
5. The person installs the snippet and sends a test event from the same page.
6. Call `get` on the source again until its health is `receiving`. If it stays `not_seen` or turns
   `needs_attention`, tell the person what the page reports.
7. Attach the source to the campaign goal with `save_campaign`: on a new campaign include
   `optimizationGoals`; on an existing one send `campaignId`, `expectedRevision` and
   `optimizationGoals`. Read the `optimizationGoals` schema in `tools/list` for the exact shape.
8. If the advertiser needs an integration Semicola does not offer yet, file it with `save_ask` and
   `type: "integration"`.

## Guardrails

* Never send or ask for personal data about the people behind the events.
* Do not say events are arriving until the health says `receiving`.
* Missing conversions are unavailable, not zero.
* If you attach a source that is not receiving yet, tell the person the goal cannot optimize until
  it does.

## Done when

* The event source reports `receiving`.
* The campaign's goal references it, confirmed by `get` on the campaign.
* The person knows which events are counted and where to check health later.
