# Datablocks

A datablock answers a question once and stays answered. You define it (connection + metrics + dimensions + filters + date range), and then you can drop it onto any dashboard, reference it in chat, point an automation at it, or include it in a playbook.

### Two flavors

#### Global datablocks

Pre-built by SMAQ and available in every project. They cover the questions almost everyone asks:

* Campaign performance by week (Google Ads, Meta, TikTok, etc.)
* Channel mix and conversion funnel (GA4)
* Search term breakdown (Google Ads)
* Top landing pages by traffic and conversions
* Top performing creative by ROAS

Global datablocks update automatically as SMAQ adds new ones. You can't edit them — but you can [duplicate one as the starting point for a project datablock](/documentation/features/datablocks/create-project-datablocks.md).

#### Project datablocks

Custom datablocks you build for your project's specific needs. Use these when:

* You need a metric or dimension that isn't in a global datablock.
* You want specific filters baked in (e.g. "only campaigns tagged \[Q2 launch]").
* You're connecting to a SQL database or custom endpoint — there are no global datablocks for those.

See [Create project datablocks](/documentation/features/datablocks/create-project-datablocks.md).

### Where to find datablocks

In any project, click **Datablocks** in the side menu. The page shows:

* **My Datablocks** — your project datablocks
* **Global** — the pre-built library, organized by connection type

> **\[Screenshot needed]** Datablocks page with both tabs visible and the Global tab open, showing a list of GA4 and Google Ads datablocks.

### Custom metrics

If you need a calculated KPI on top of a datablock — ROAS, AOV, CPA, etc. — use [Custom metrics](/documentation/features/datablocks/custom-metrics.md). They live alongside datablocks and can blend across multiple sources.

### How datablocks differ from charts

A datablock is the **query**; a chart is the **visualization**. The same datablock can be rendered as a line chart, a bar chart, a table, a pivot table, or a metric card — all from the same underlying data. See [Adding custom charts](/documentation/features/dashboard/adding-custom-charts.md).

### Datablocks in chat

When you chat with SMAQ AI, it uses your datablocks as the primary way to answer data questions. The more well-named, well-described project datablocks you have, the better the AI's chat answers. See [Search Datablock agent](/documentation/features/chat/capabilities.md) for how the AI finds them.

### What's next

* [Create project datablocks](/documentation/features/datablocks/create-project-datablocks.md) — full walkthrough.
* [Custom metrics](/documentation/features/datablocks/custom-metrics.md) — calculated KPIs.
* [Adding custom charts](/documentation/features/dashboard/adding-custom-charts.md) — turn a datablock into a chart.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.smaq.io/documentation/features/datablocks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
