Skip to content

REST API

Tracking API

REST endpoints for the Tracking area of Lessly.

The Tracking area publishes 36 REST endpoints. Paths are relative to https://api.lessly.com; see Authentication for the required header.

GET/tracking/catalog

List the event-name catalog for the current product with counts, first/last seen, sampled prop keys, and status.

MCP tool: tracking_event-names_list

Parameters

NameInTypeRequiredDescription
statusquerystringFilter by status; omit for all
searchquerystringCase-insensitive substring match on the event name
sortquerystringSort column (default count)
orderquerystringSort direction (default desc)

Response

FieldTypeAlwaysDescription
namesarray
POST/tracking/catalog/archive

Archive an event name (hides it from dashboards only; ingestion and counts continue unchanged).

MCP tool: tracking_event-names_archive

Parameters

NameInTypeRequiredDescription
namebodystringThe event name to archive/unarchive

Response

FieldTypeAlwaysDescription
namestring
statusstring
POST/tracking/catalog/unarchive

Unarchive an event name (restores its visibility in dashboards).

MCP tool: tracking_event-names_unarchive

Parameters

NameInTypeRequiredDescription
namebodystringThe event name to archive/unarchive

Response

FieldTypeAlwaysDescription
namestring
statusstring
GET/tracking/domains

List the product's custom domains and tracking-host bindings

MCP tool: tracking_domains_list

Parameters

No parameters.

Response

FieldTypeAlwaysDescription
domainsarray
bindingsarray
POST/tracking/domains

Claim a first-party tracking host under a product domain

MCP tool: tracking_domains_create

Parameters

NameInTypeRequiredDescription
domainIdbodystring
hostbodystring
recordsbodyarray

Response

FieldTypeAlwaysDescription
bindingobject
instructionsarray
DELETE/tracking/domains/:bindingId

Release a tracking-host binding

MCP tool: tracking_domains_delete

Parameters

NameInTypeRequiredDescription
bindingIdpathstring

Response

FieldTypeAlwaysDescription
okboolean
GET/tracking/domains/:bindingId

Get one tracking-host binding and its status

MCP tool: tracking_domains_get

Parameters

NameInTypeRequiredDescription
bindingIdpathstring

Response

FieldTypeAlwaysDescription
hoststring
statusstring
recordsarray
domainIdstring
bindingIdstring
createdAtstring
productIdstring
updatedAtstring
statusDetailstring
ownerExtensionstring
POST/tracking/domains/:bindingId/verify

Run an immediate liveness check for a pending binding

MCP tool: tracking_domains_verify

Parameters

NameInTypeRequiredDescription
bindingIdpathstring

Response

FieldTypeAlwaysDescription
hoststring
statusstring
recordsarray
domainIdstring
bindingIdstring
createdAtstring
productIdstring
updatedAtstring
statusDetailstring
ownerExtensionstring
GET/tracking/googleads/connection

Google Ads connection status for the current product: whether a Google Ads account is connected and which account (loginCustomerId / customerId), or whether it still needs account selection or re-auth.

MCP tool: tracking_googleads_connection_status

Parameters

No parameters.

GET/tracking/googleads/feedback/config

Get the Google Ads conversion-feedback config for the current product (enabled, mode, lookbackDays, event→conversion-action rules, accountCurrency — the connected account's currency, best-effort, null if unavailable — useful for defaulting a fixed-value rule's currency, and dynamicValueEvents — the revenue-eligible event-names that may use the Dynamic value source).

MCP tool: tracking_googleads_feedback_config_get

Parameters

No parameters.

Response

FieldTypeAlwaysDescription
modestring
rulesarray
enabledboolean
productIdstring
lookbackDaysnumber
accountCurrencystring
dynamicValueEventsarray
enhancedConversionsboolean
POST/tracking/googleads/feedback/config

Set the Google Ads conversion-feedback config (enable/disable, mode, lookback, rules, enhancedConversions). enhancedConversions adds hashed email/phone as additive match keys alongside gclid. Returns the config plus safety guidance. Rules are validated against the account's conversion actions.

MCP tool: tracking_googleads_feedback_config_set

Parameters

NameInTypeRequiredDescription
enabledbodybooleanMaster switch for conversion feedback (default off)
modebodystringexisting_pixel = fill gaps; fresh_pixel = our data only
lookbackDaysbodyintegerClick lookback window for gclid match (<=90)
rulesbodyarrayMap a tracked event to a Google conversion action with a per-rule value (net revenue or a fixed amount)
enhancedConversionsbodybooleanEnhanced conversions: also send hashed email/phone as additive match keys alongside gclid (default off)

Response

FieldTypeAlwaysDescription
configobject
guidancearray
GET/tracking/googleads/feedback/conversion-actions

List the connected Google Ads account's conversion actions (resource, name, category, status) so you can map a tracked event to a Google conversion action with a per-rule value (net revenue or a fixed amount).

MCP tool: tracking_googleads_conversion_actions

Parameters

No parameters.

POST/tracking/googleads/feedback/run

Manually run one conversion-feedback upload pass for the current product now (uploads newly-attributed conversions across all enabled rules since the last run). Useful for testing; the daily cron runs this automatically.

MCP tool: tracking_googleads_feedback_run

Parameters

No parameters.

Response

FieldTypeAlwaysDescription
failednumber
matchednumber
noGclidnumber
skippedstring
selectednumber
uploadednumber
productIdstring
zeroValuenumber
partialFailureErrorstring
GET/tracking/googleads/feedback/status

Google Ads conversion-feedback status for the current product: enabled/mode, rule count, cumulative uploaded/failed counts, last-run coverage (selected vs matched vs uploaded, plus noGclid so gclid-match coverage is visible), safety guidance, accountCurrency (the connected account's currency, best-effort, null if unavailable), and dynamicValueEvents (the revenue-eligible event-names that may use the Dynamic value source).

MCP tool: tracking_googleads_feedback_status

Parameters

No parameters.

Response

FieldTypeAlwaysDescription
modestring
failednumber
enabledboolean
lastRunobject
guidancearray
uploadednumber
ruleCountnumber
lookbackDaysnumber
accountCurrencystring
dynamicValueEventsarray
enhancedConversionsboolean
GET/tracking/googleads/feedback/uploads

List the most recent Google Ads offline-conversion uploads for the current product (per-row ledger: conversionKey, gclid, conversionAction, conversionDatetime, valueMicros, currency, orderId, status, error, uploadedAt). Newest first. Query: limit (default 100, max 500).

MCP tool: tracking_googleads_feedback_uploads

Parameters

NameInTypeRequiredDescription
limitqueryinteger
GET/tracking/googleads/reports/roas

Google Ads ROAS/CPA per campaign->ad_group->ad joining frozen cost rollups with attributed revenue. Attributed ROAS/CPA at campaign level; cost + platform metrics at every level. Currency-isolated; never summed across currencies. Query: from,to (ISO, required), model (last_click|first_click), lookbackDays (1-365), domain?, customerId?.

MCP tool: tracking_googleads_roas_report

Parameters

NameInTypeRequiredDescription
fromquerystring
toquerystring
modelquerystring
lookbackDaysqueryinteger
domainquerystring
customerIdquerystring

Response

FieldTypeAlwaysDescription
tostring
fromstring
modelstring
domainstring
accountsarray
computedAtstring
lookbackDaysnumber
unmatchedAttributedarray
GET/tracking/googleads/reports/us-vs-platform

Per-campaign comparison: our attributed revenue/conversions vs Google-reported conversions and conversions_value, within each account currency. Query: from,to (ISO, required), model, lookbackDays, domain?, customerId?.

MCP tool: tracking_googleads_us_vs_platform

Parameters

NameInTypeRequiredDescription
fromquerystring
toquerystring
modelquerystring
lookbackDaysqueryinteger
domainquerystring
customerIdquerystring

Response

FieldTypeAlwaysDescription
tostring
fromstring
modelstring
domainstring
accountsarray
computedAtstring
lookbackDaysnumber
POST/tracking/googleads/sync

Pull the current product's Google Ads campaign/ad-group/ad structure and daily spend/metrics into the reporting tables now (backfill window). Returns per-table row counts. Skips gracefully if the account is pending selection or needs re-auth.

MCP tool: tracking_googleads_sync_now

Parameters

No parameters.

Response

FieldTypeAlwaysDescription
rowsobject
reasonstring
statusstring
windowobject
lastSyncedAtstring
GET/tracking/googleads/tracking-health

Google Ads URL-tracking health for the current product over a date range: how many Google paid clicks arrived, how many carried our ValueTrack URL parameters (marker _lt_campaign) vs how many were UNTAGGED (template not installed / broken), the breakage rate, whether the template is verified live, first/last untagged times, sample offending landing URLs. Read-only; computed on the fly from stored events (no Google Ads API call). dataQuality describes how complete the figures above are and holds no metric of its own: dataQuality.cookielessPaidClicks is how many of the paid clicks arrived cookieless (the visitor declined consent) — counted INSIDE paidClicks, never added to it, because a cookieless paid click is a real click and belongs in the breakage denominator. It is broken out so breakageRate is not read as one homogeneous population. Clicks from sites running no consent banner at all are NOT counted as cookieless: nobody was ever asked there, which is not the same as being told no.

MCP tool: tracking_googleads_tracking_health

Parameters

NameInTypeRequiredDescription
fromquerystringRange start (ISO); defaults to 30 days ago
toquerystringRange end (ISO); defaults to now

Response

FieldTypeAlwaysDescription
tostring
fromstring
installedboolean
truncatedboolean
paidClicksnumber
dataQualityobject
breakageRatenumber
taggedClicksnumber
lastUntaggedAtstring
untaggedClicksnumber
firstUntaggedAtstring
sampleUntaggedUrlsarray
GET/tracking/identity/health

Identity match-rate metric: share of identified profiles and share with an ad touchpoint (proxy = has >=1 click_id identifier).

MCP tool: tracking_identity_health

Parameters

No parameters.

Response

FieldTypeAlwaysDescription
computedAtstring
totalProfilesnumber
identifiedRatenumber
adTouchpointRatenumber
identifiedProfilesnumber
adTouchpointProfilesnumber
GET/tracking/install/domains

List install-verification domains for the current product with per-domain "script seen" status, plus auto-discovered domains sending events

MCP tool: tracking_install-domains_list

Parameters

No parameters.

Response

FieldTypeAlwaysDescription
discoveredarray
registeredarray
windowDaysnumber
POST/tracking/install/domains

Register a domain in the install-verification checklist for the current product

MCP tool: tracking_install-domains_create

Parameters

NameInTypeRequiredDescription
domainbodystringDomain to add to the install checklist (e.g. acme.com)

Response

FieldTypeAlwaysDescription
domainstring
DELETE/tracking/install/domains/:domain

Remove a domain from the install-verification checklist for the current product

MCP tool: tracking_install-domains_delete

Parameters

NameInTypeRequiredDescription
domainpathstringRegistered domain to remove from the checklist

Response

FieldTypeAlwaysDescription
okboolean
GET/tracking/link/domains

List the cross-domain linking group (domains whose links the tracking script decorates with the visitor id) for the current product

MCP tool: tracking_link-domains_list

Parameters

No parameters.

Response

FieldTypeAlwaysDescription
domainsarray
POST/tracking/link/domains

Add a root domain to the cross-domain linking group for the current product

MCP tool: tracking_link-domains_create

Parameters

NameInTypeRequiredDescription
domainbodystringRoot domain to add to the cross-domain linking group (e.g. acme.io)

Response

FieldTypeAlwaysDescription
domainstring
DELETE/tracking/link/domains/:domain

Remove a root domain from the cross-domain linking group for the current product

MCP tool: tracking_link-domains_delete

Parameters

NameInTypeRequiredDescription
domainpathstringRoot domain to remove from the cross-domain linking group

Response

FieldTypeAlwaysDescription
okboolean
GET/tracking/live

List the most recent tracking events for the current product (live visitor stream). Cursor-paged for incremental polling.

MCP tool: tracking_live-events_list

Parameters

NameInTypeRequiredDescription
sincequerystringOpaque cursor from a previous response; omit for the newest events
domainquerystringFilter to a single domain (e.g. acme.com)
limitqueryintegerMax events to return (default 50, max 200)

Response

FieldTypeAlwaysDescription
cursorstring
eventsarray
GET/tracking/profiles

List/search people (profiles) for the product; filter by email and status, cursor-paged.

MCP tool: tracking_profiles_list

Parameters

NameInTypeRequiredDescription
emailquerystringExact email to find (case-insensitive), or a prefix when emailMatch=prefix
emailMatchquerystringHow to match the email filter
statusquerystringFilter by profile status
limitqueryintegerMax profiles per page (default 25, max 100)
cursorquerystringOpaque pagination cursor from a previous response

Response

FieldTypeAlwaysDescription
cursorstring
profilesarray
DELETE/tracking/profiles/:profileId

GDPR erasure: permanently delete a person and their events from Postgres and record an erasure request. Archived events are flagged as a deletion gap.

MCP tool: tracking_profiles_delete

Parameters

NameInTypeRequiredDescription
profileIdpathstringThe profile id (uuid)

Response

FieldTypeAlwaysDescription
okboolean
archiveobject
deletedobject
profileIdstring
GET/tracking/profiles/:profileId

Get one person: profile, identity signals, and their chronological journey (query-time join over the person's anonymous ids).

MCP tool: tracking_profiles_get

Parameters

NameInTypeRequiredDescription
profileIdpathstringThe profile id (uuid)
journeyCursorquerystringOpaque cursor to page further back through the journey
journeyLimitqueryintegerJourney events per page (default 100, max 200)

Response

FieldTypeAlwaysDescription
ltvobject
journeyobject
profileobject
signalsobject
acquisitionobject
GET/tracking/profiles/:profileId/export

Export a person as JSON: profile + identity signals + full journey (capped at 50k events; truncated flag set if exceeded).

MCP tool: tracking_profiles_export

Parameters

NameInTypeRequiredDescription
profileIdpathstringThe profile id (uuid)

Response

FieldTypeAlwaysDescription
journeyarray
profileobject
signalsobject
truncatedboolean
exportedAtstring
acquisitionobject
GET/tracking/reports/attributed-journey/:profileId

One person's journey with, for their originating conversion, the attribution decision explained (winning touchpoint + why) under the requested model and lookback window. Attribution is never locked in — changing model/window re-reads the same history.

MCP tool: tracking_reports_attributed_journey

Parameters

NameInTypeRequiredDescription
profileIdpathstringThe profile id (uuid)
modelquerystring
lookbackDaysqueryinteger
fromquerystring
toquerystring

Response

FieldTypeAlwaysDescription
journeyobject
decisionsarray
profileIdstring
GET/tracking/reports/event-volume

Traffic for a date range as TWO headline figures plus a data-quality block. totalEvents counts events. visitorsDeduplicatedPerUtcDay counts PEOPLE, over both populations at once: visitors who consented are deduplicated by their anonymous_id, visitors who declined by a server-derived daily_visitor_key. It is one COUNT DISTINCT, not a sum of two figures, and there is no second set of numbers to add to it. READ THE FIELD NAME LITERALLY — the caveat is the metric, not a footnote. The daily key is rebuilt from a salt that is destroyed every UTC midnight, so the same declining visitor gets a DIFFERENT key tomorrow and is counted again. Consequences you must state whenever you report this number over more than one day: (1) weekly and monthly unique-visitor counts are OVERSTATED, and the longer the window the worse it gets — a visitor who comes back on ten days counts as ten people; (2) returning-visitor, retention, frequency and loyalty analysis DO NOT WORK on this traffic at all, because the identity that would link the days was never created. This is not a defect awaiting a fix and no post-processing recovers the real figure; Plausible, PostHog and Matomo concede the same limitation about their own daily keys. dataQuality.visitorsOverstated tells you whether it bites for the window you asked for (true when the range spans more than one UTC day and there is declining traffic in it), and dataQuality.utcDaysInRange is how many UTC days the range spans. For an exact people count, ask for a single UTC day. dataQuality describes how COMPLETE the two headline figures are and contains no metric of its own — never present anything inside it as a headline number and never add it to anything. cookielessShare and noBannerShare are the fractions of events that arrived from declining visitors and from sites running no consent banner. consentGrantedEvents + cookielessEvents + noBannerEvents = totalEvents. noBannerEvents (nobody was ever asked) is deliberately kept apart from cookielessEvents (the visitor declined); merging them would tell a customer people refused when nobody was asked. identifiedEvents is a DIFFERENT cut — events carrying an anonymous_id — that overlaps the consent buckets and is NOT the complement of cookielessEvents; never add those two together.

MCP tool: tracking_reports_event_volume

Parameters

NameInTypeRequiredDescription
fromquerystring
toquerystring
domainquerystring

Response

FieldTypeAlwaysDescription
tostring
fromstring
domainstring
computedAtstring
dataQualityobject
totalEventsnumber
visitorsDeduplicatedPerUtcDaynumber
GET/tracking/reports/revenue-by-source

Revenue attributed by channel + UTM breakdown for a date range, under a chosen attribution model and lookback window. Includes a distinct unattributed row, totals, and a count-based match rate. Revenue is per-currency (never summed across currencies); refunds are netted explicitly.

MCP tool: tracking_reports_revenue_by_source

Parameters

NameInTypeRequiredDescription
fromquerystringCohort window start (ISO); selects conversions by subscription start
toquerystringCohort window end (ISO)
modelquerystringAttribution model
lookbackDaysqueryintegerLookback window in days (default 30)
domainquerystringOnly consider touchpoints on this domain

Response

FieldTypeAlwaysDescription
tostring
fromstring
modelstring
domainstring
totalsobject
channelsarray
matchRatenumber
computedAtstring
lookbackDaysnumber
unattributedobject
GET/tracking/reports/source-people

List the people (profiles) behind one channel / UTM row from the revenue-by-source report, under the same model + window. Keyset-paginated; each person carries their attributed lifetime revenue per currency.

MCP tool: tracking_reports_source_people

Parameters

NameInTypeRequiredDescription
channelquerystringChannel to drill into
utmSourcequerystring
utmMediumquerystring
utmCampaignquerystring
clickIdTypequerystringNative click-id type of the breakdown row to drill into (e.g. 'gclid'). Tri-state: omit for no filter (all click ids), pass a value to match it, or list 'clickIdType' in utmNulls to match the IS-NULL row.
utmNullsquerystringComma-separated dimension names (utmSource,utmMedium,utmCampaign,clickIdType) that must be IS NULL
modelquerystring
lookbackDaysqueryinteger
fromquerystring
toquerystring
domainquerystring
cursorquerystringOpaque keyset cursor from a previous page
limitqueryintegerPeople per page (default 50, max 200)

Response

FieldTypeAlwaysDescription
cursorstring
peoplearray
GET/tracking/snippet

Get the tracking snippet for the caller's current product. Install it unconditionally. Do NOT wrap it in a consent gate and do NOT load it only after consent is granted: the tracker reads the visitor consent decision itself and switches to a cookieless mode that writes no cookies and sends no identifiers when statistics consent is declined or not yet given. Gating this tag makes declining and undecided visitors invisible entirely — the failure this behaviour exists to prevent.

MCP tool: tracking_snippets_get

Parameters

No parameters.

Response

FieldTypeAlwaysDescription
hoststring
snippetstring
scriptUrlstring
minimalSnippetstring
Was this page helpful?
Esc

Start typing to search the docs.

navigateselect