ConstraintsWhich campaigns are measurable, and where the untracked clicks went

Which campaigns are measurable, and where the untracked clicks went

Tracking hygiene, per campaign. GET /client/v1/constraints reports one match_rate for the account — enough to know a problem exists, not enough to fix it. This takes that number apart: a verdict per campaign, plus the ad clicks that reached no campaign at all, bucketed by cause.

Causes call for different repairs, which is why they are separated rather than summed: no_utm (the ad has no URL tags), unexpanded_macro (the tag holds a literal the platform never substituted), and unknown_campaign (the UTM names something outside the synced rows — a deleted campaign, a hand-written UTM, or a different ad account).

Uses the same window, grain and join as the analysis, so the two agree by construction. No conversion, lead or benchmark inputs — nothing here depends on them. Unlike the analysis, there is no volume floor: a small campaign with broken tags is precisely what this should surface.

Meta only for now.

curl -X GET "https://mythic-analytics.gulp.workers.dev/client/v1/constraints/audit?location_id=example_string&from=2024-12-25&to=2024-12-25&days=28&group_by=campaign&attribution=session&table=example_string" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -H "Authorization: Bearer YOUR_API_TOKEN"
{
  "success": true,
  "data": {
    "window": {
      "from": "2024-12-25",
      "to": "2024-12-25"
    },
    "grain": "example_string",
    "attribution": "example_string",
    "totals": {
      "campaigns": 42,
      "spend": 3.14,
      "flagged": 42,
      "flagged_spend": 3.14,
      "matched_sessions": 42,
      "untracked_sessions": 42,
      "match_rate": 3.14
    },
    "campaigns": [
      {
        "campaign_id": "example_string",
        "campaign_name": "John Doe",
        "impressions": 42,
        "clicks": 42,
        "spend": 3.14,
        "sessions": 42,
        "sessions_by_id": 123,
        "sessions_by_name": 42,
        "click_to_session_rate": 3.14,
        "verdict": "ok",
        "issue": "example_string",
        "fix": "example_string"
      }
    ],
    "untracked_sessions": {
      "total": 42,
      "by_cause": [
        {
          "cause": "no_utm",
          "sessions": 42,
          "sample": "example_string",
          "top_landing_page": "example_string",
          "fix": "example_string"
        }
      ]
    }
  }
}
GET
/client/v1/constraints/audit
GET
Base URLstring

Target server for requests. Edit to use your own host.

⚠️Authentication configuration error - security schemes not found
query
location_idstring

Location to scope to. Required for ak_ keys (or send the X-Location-Id header); ignored for sk_.

query
fromstring

Window start (YYYY-MM-DD). Defaults to 28 days before to.

Format: date
query
tostring

Window end (YYYY-MM-DD), inclusive. Defaults to yesterday.

Format: date
query
daysinteger

Window length in days, inclusive of both ends. Ignored when from is given.

Min: 1 • Max: 365
query
group_bystring

Grain to audit. adset/ad key off utm_content and are expected to look far worse than campaign.

Options: campaign, adset, ad
query
attributionstring
Options: session, first_touch
query
tablestring

Override the Meta ads-insights table name.

Request Preview
Response

Response will appear here after sending the request

Query Parameters

location_idstring

Location to scope to. Required for ak_ keys (or send the X-Location-Id header); ignored for sk_.

fromstring

Window start (YYYY-MM-DD). Defaults to 28 days before to.

tostring

Window end (YYYY-MM-DD), inclusive. Defaults to yesterday.

daysinteger

Window length in days, inclusive of both ends. Ignored when from is given.

group_bystring

Grain to audit. adset/ad key off utm_content and are expected to look far worse than campaign.

Allowed values:campaignadsetad
attributionstring
Allowed values:sessionfirst_touch
tablestring

Override the Meta ads-insights table name.

Responses

successboolean
dataobject