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

# Marketing analytics

> Read sessions with their source, medium, campaign and landing page, count them the way your report needs, and get from a traffic number to the companies behind it.

`GET /v1/trackers/{tracker_code}/sessions` returns the raw sessions of a tracker: one row per visit, with the company, traffic source and landing page. Count the rows by the field your report needs, such as medium, campaign or landing page.

## Sessions

```bash cURL theme={null}
curl --request GET \
  --url "https://data.leadinfo.com/v1/trackers/LI-5A14070B93509/sessions?start_date=2026-09-21&end_date=2026-09-27&limit=500&include_total=true" \
  --header "Authorization: Bearer <token>"
```

Each row carries:

| Field | Meaning |
| - | - |
| `event_date`, `duration`, `pages` | When the session took place, its active time in seconds and its page views |
| `company_id`, `company_name`, `domain` | The identified company |
| `source`, `medium`, `campaign`, `term`, `content` | The UTM fields of the visit |
| `click_id`, `click_provider` | The ad click id and the network it belongs to, such as Google Ads |
| `referrer_host` | The site the visitor came from |
| `landing_page` | The path of the session's first page view |

Sessions come back newest first, up to 1,000 per call (`limit`). `include_total=true` adds the number of matching sessions to `meta`, and `domain_filter` narrows the rows to one company domain. When `meta.has_more` is true, narrow the date window (see [Pagination](https://docs.leadinfo.com/concepts/pagination.md)).

## Filter sessions

`POST .../sessions` takes the same dates plus `filters` on `source`, `medium`, `campaign`, `term`, `content`, `referrer_host`, `click_provider`, `duration` and `pages`:

```json theme={null}
{
  "start_date": "2026-09-21",
  "end_date": "2026-09-27",
  "filters": [
    { "field": "medium", "operator": "equals", "value": "cpc" },
    { "field": "pages", "operator": "greater_than", "value": 1 }
  ]
}
```

Count the rows by `landing_page` to see which pages your paid traffic lands on, and compare `duration` and `pages` per landing page: a page where most sessions have one page view and a few seconds of active time is a page people leave at once. Swap it around and count by `campaign` to see which campaigns bring visitors to one page.

## From a campaign to the companies behind it

A channel or campaign number becomes a company list by applying the same field as a filter on `POST /companies`:

```json theme={null}
{
  "start_date": "2026-09-21",
  "end_date": "2026-09-27",
  "sort": "sessions",
  "filters": { "conditions": [ { "field": "campaign", "operator": "equals", "value": "demandgenUK" } ] }
}
```

`paid_source equals "Linkedin Ads"` gives the companies that arrived from LinkedIn paid, `medium equals ai` the companies referred by an AI assistant, `click_provider equals "Google Ads"` the companies that came in with a Google click id.

## Pages of one company

`GET .../companies/{company_id}/pages` lists the pages one company viewed with views, first and last seen and average duration, and `GET .../companies/{company_id}/sessions` every session of that company in the window.

## AI assistants reading your site

Companies with `is_ai_agent` are Claude, ChatGPT, Perplexity, Meta AI and Gemini fetching pages for their users. `POST /companies` with `is_ai_agent equals true` plus `GET .../companies/{company_id}/pages` per agent shows which of your pages the assistants read, a useful input for generative engine optimisation.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.