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"
import requests
import json
url = "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"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch("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", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
)
func main() {
req, err := http.NewRequest("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", nil)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('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')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
response = http.request(request)
puts response.body
{
"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"
}
]
}
}
}
{
"error": "Bad Request",
"message": "The request contains invalid parameters or malformed data",
"code": 400,
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
{
"error": "Unauthorized",
"message": "Authentication required. Please provide a valid API token",
"code": 401
}
{
"error": "Error",
"message": "No Meta ads-insights table in this client's dataset.",
"code": 424
}
{
"error": "Too Many Requests",
"message": "Rate limit exceeded. Please try again later",
"code": 429,
"retryAfter": 3600
}
/client/v1/constraints/audit
Target server for requests. Edit to use your own host.
Location to scope to. Required for ak_ keys (or send the X-Location-Id header); ignored for sk_.
Window start (YYYY-MM-DD). Defaults to 28 days before to.
Window end (YYYY-MM-DD), inclusive. Defaults to yesterday.
Window length in days, inclusive of both ends. Ignored when from is given.
Grain to audit. adset/ad key off utm_content and are expected to look far worse than campaign.
Override the Meta ads-insights table name.
Request Preview
Response
Response will appear here after sending the request
Query Parameters
Location to scope to. Required for ak_ keys (or send the X-Location-Id header); ignored for sk_.
Window start (YYYY-MM-DD). Defaults to 28 days before to.
Window end (YYYY-MM-DD), inclusive. Defaults to yesterday.
Window length in days, inclusive of both ends. Ignored when from is given.
Grain to audit. adset/ad key off utm_content and are expected to look far worse than campaign.
campaignadsetadsessionfirst_touchOverride the Meta ads-insights table name.