# Overview.Admin

## What it does

Campaign Studio groups landing pages, reusable calls to action, and conversion goals under a campaign. It adds campaign fields to the page editor, campaign widgets to Layout Builder, and campaign performance widgets to the dashboard.

## Setup requirements

Install and migrate Campaign Studio with its required Insights, Form Builder, and Layout Builder packages. Conversion reporting depends on Insights creating a consent-eligible visit identity; Campaign Studio does not record an anonymous browser event without that visit.

Keep Laravel's scheduler running. The package updates campaign statuses every five minutes, without overlapping and on one server: a **Scheduled** campaign becomes **Active** when its start time arrives, and an **Active** campaign becomes **Ended** after its end time. Draft and paused campaigns are not activated automatically. A separate monthly task removes expired Campaign Studio conversion records.

## Build a campaign

Open **Marketing Studio** in the admin, then use:

- **Campaign groups** for the campaign name, site, status, start/end dates, budget notes, and default UTM values.
- **Landing pages** for pages assigned to the campaign, their primary goal, audience targeting, and variants. The same assignment is available on a page's **Campaign** tab.
- **CTA widgets** for reusable calls to action. A CTA must be active before a Layout Builder campaign CTA widget can select it.
- **Conversion goals** for the outcome, stable key, optional value, and active/primary state.

Campaign hero, CTA, and lead-form widgets are configured in Layout Builder. Page-view and CTA-click goals are recorded by the frontend tracker; matching Form Builder submissions are recorded by the package listener. **Custom action** goals need an integration that explicitly records that conversion. If Experiments is installed, landing-page variants can be synchronised to a campaign-scoped experiment; Campaign Studio itself does not install Experiments.

Use the configured dashboard campaign summary, top campaigns, and top landing pages to review results. Conversion records are reporting data rather than a separately editable admin resource. A practical first journey is a Spring launch campaign whose `/pricing` landing page records the `book-demo` goal and then appears in both campaign and landing-page dashboard rows.

## Tracking and attribution boundaries

The public conversion endpoint accepts page views and CTA clicks from the campaign tracker. It is CSRF-exempt but origin-validated, limited to 60 requests per minute, and accepts only an existing Insights visit from the resolved site. Invalid origins, unknown landing-page URLs, inactive or cross-campaign goals, missing visits, and visits belonging to another site are ignored.

The tracker uses the existing Insights visit identifier from browser storage or its visit cookie. Global Privacy Control, Do Not Track, and `X-Do-Not-Track` signals are honoured before Campaign Studio validates or stores a conversion. The default attribution window is 30 days; an older visit is not attached to a new conversion. Replaying the same stable event key for the same goal returns the existing conversion, so a retry does not inflate the dashboard. Outcomes whose site, language, or landing-page campaign does not match the goal are rejected.

## Access, data, and retention

Campaign groups, landing pages, CTA widgets, and conversion goals use their standard Filament resource permissions, including view, create, update, and delete abilities. Resource lists, relationships, records, and dashboard queries are site-scoped; global administrators can work across sites.

Campaign conversions can link a goal, landing page, Insights visit/event, source record, site, language, UTM/referrer attribution, stable event key, value, and conversion time. These fields are stored in plaintext reporting tables. Avoid putting personal data in event keys, campaign keys, or UTM values, restrict campaign/report access, and account for Insights data in the same privacy review.

By default, `campaign-studio:purge-conversions` deletes Campaign Studio conversions older than 365 days when the monthly scheduler runs. Changing `capell-campaign-studio.retention_days` or invoking the command with `--days` changes that boundary. The purge does not state that related Insights events are removed, so manage Insights retention separately.