# Sharing agents and sessions Source: https://docs.dema.ai/guides/agent/access-and-sharing Learn what people can use through a shared agent and who can see its sessions. See [Access and sharing](/guides/organization/access-and-sharing) for the rules that apply across Dema. This page explains what happens when you share an agent or one of its sessions. *** ## What people can use through a shared agent Anyone you share an agent with can use its skills and apps through that agent, including private ones. Those private skills and apps do not appear in anyone else's library. Other people cannot open or edit private apps directly. People you share an agent with can edit the skills linked to it. They can change the skill's instructions, add or change its files, and revert to an earlier version. When the agent saves changes to a linked skill, it updates that skill in place instead of creating a personal copy. Only the skill's owner can change who the skill is shared with or delete it. Global skills and skills without an owner are not affected. > [!NOTE] > > Your *Pricing analyst* agent uses a private skill called *margin-calc*. If you share the agent with the Growth team, the team can run the agent and it can use *margin-calc* for them. The skill stays private and belongs to you. The diagram shows what the Growth team can access after you share the agent: ![Access flow after sharing an agent: the Growth team can use the shared agent and read its sessions, while the private skill, private app, and your connected accounts are reachable only through the agent](https://mintcdn.com/demaai/-QBoxgr91D2DfDZm/images/agent-sharing-flow-light.svg?fit=max\&auto=format\&n=-QBoxgr91D2DfDZm\&q=85\&s=a599652bd1185069cd762e6dfdbf106a) The shared agent is the only path to the items on the right. If you stop sharing the agent, the team loses that access. The items still belong to you. *** ## Connected accounts People who use a shared agent can also use its [integrations](/guides/agent/integrations/overview), such as Slack, Gmail, or Shopify. These integrations use the accounts connected to the agent. Before you share an agent more widely, Dema lists the connections and resources that its new audience will be able to use. > [!WARNING] > > Review this list before you confirm. For example, people who use an agent connected to Gmail may be able to read or send email from that account, depending on its tool permissions. You can also share a connection directly with teams or your whole organization. People can then link it to their own agents. Existing connections stay private until their owner shares them. When someone uses a connection you own, your tool-approval limits for it still apply. A connection someone else owns limits who you can share an agent with. You can't share an agent or its apps with a wider audience than those connections are shared with. Dema blocks the change and lists the integrations involved. To continue, remove the integration from the agent or ask its owner to share it with more people. If the owner narrows a connection's audience, Dema removes it from agents it no longer covers. *** ## Linking apps and skills to an agent Linking an app or skill to an agent does not change the item's visibility. However, everyone who can use the agent can use the linked item through it. If a link gives more people access, Dema shows who gains access and how to remove it before you confirm. *** ## Making things private again What happens depends on the new visibility: * **Specific teams:** Links stay in place. Dema lists the agents that can still use the skill or app. * **Private:** Dema removes the skill or app from agents with a wider audience. People who used it through those agents lose access. You keep access as the owner. Making an agent private removes access for everyone else who could use it. Dema shows the effect before you confirm. *** ## Transfer ownership The owner of an agent or app can hand it over to another member of your organization from the **Owner** row on the agent's Configuration page or the app's details panel. Only the current owner can do this. Before you confirm, Dema shows an impact preview: * **Routines that move with the agent.** Any routine you own on the agent transfers to the new owner. It keeps its schedule and stays active. Its next runs will fail on any connected accounts the new owner has not reconnected yet. * **Linked skills and apps.** Skills and apps you own that are linked to the agent are listed as candidates to transfer alongside it. Everything is ticked by default; untick the ones you want to keep. Anything left unticked stays with you, and other agents that link to it are unaffected. * **Connected accounts to reconnect.** Integrations you connected to the agent are switched off during the transfer. The new owner needs to reconnect each listed toolkit before the agent can use it again. * **Loss of access.** If the agent or app is private, you lose access to it once the transfer completes. Share it with a team you belong to before transferring if you want to keep viewing it. > [!WARNING] > > Read the list of connections to reconnect before you confirm. Once the transfer commits, neither you nor the new owner can see the previous owner's connections, so you cannot look them up afterwards. *** ## Who can see an agent's sessions Anyone who can use an agent can open and read its sessions, including scheduled runs. Sessions owned by someone else are read-only. You can read the messages and download files, but you cannot send messages, rename the session, or delete it. You can also share one conversation directly. **Share conversation** makes it available by URL to everyone in your organization, including people without access to the agent. A conversation is either private or shared with the whole organization. You can make it private again. # Apps Source: https://docs.dema.ai/guides/agent/apps Build reusable apps with the Dema Agent, link them to agents, and update them from a conversation. **Apps** are interactive tools built by the Dema Agent in a conversation. An app might be a dashboard, calculator, or report. Dema saves it to your **app library**, where you and your agents can use it again. You own the apps created for you. Linking an app to an agent lets that agent open and update it, but does not change the owner. *** ## The app library The **Apps** panel lists every app you own. Open an app there, check its visibility, or see which agents use it. Link an app to an agent when updating it requires analysis or a skill. A simple data refresh does not require a linked agent. | Update type | What to do | | - | - | | A data refresh with the same view and newer numbers | A **Refresh** button in the app is enough. | | Analysis or a skill, such as ranking results or writing a summary | **Link it to an agent** so the agent can update it on demand or on a schedule. | ### Example: a standalone app A **Promo Margin Calculator** shows how a discount affects margin. It loads current product costs when you open it, and its **Refresh** button loads the latest values. It can stay in your library without being linked to an agent. ### Example: a linked app kept current on a schedule A **Weekly Margin Review** ranks markets and summarizes the largest changes. Each update requires new analysis, so you [link it to an agent](#linking-an-app-to-an-agent) and schedule the agent to run, for example, every Monday at 07:00. Each run updates the app with the latest review. > [!NOTE] > > An app does not need to be linked to an agent. You can still open, rename, and update it from your library. *** ## Linking an app to an agent Linking gives an agent access to an app during conversations and scheduled runs. **1. Open the agent's Apps section** Open the agent and select **Configuration → Apps**. **2. Click + Add** This opens the **Add app** dialog. **3. Search for the app and click Add next to it** The Apps section includes apps the agent created in earlier conversations and apps you linked from your library. To unlink later, hover the app in the agent's Apps list and click the trash icon (**Remove app**). Removing the link doesn't delete the app. It stays in your library. *** ## Telling the agent how to use a linked app Linking makes the app available to the agent. Add guidance to the agent's [instructions](/guides/agent/your-agents#instructions) if it should use the app for a particular task. For example: When I ask for a weekly performance review, open the Weekly Margin app and fill it in for the latest full week. When I ask for a weekly performance review, open the Weekly Margin app and fill it in for the latest full week. Edit the instructions at **Agents → Configuration → Instructions**, or ask the agent to save an instruction during a conversation. For example: "From now on, use the Weekly Margin app for weekly reviews." > [!TIP] > > Keep instructions short and specific: name the app and the situation that should trigger it. *** ## Visibility An app's **visibility** controls who can see it: | Visibility | Who can see it | | - | - | | **Private** | Only you | | **Teams** | Everyone on the selected team(s) | | **Everyone** | Everyone in your organization | Linking an app to an agent does not change its visibility. The agent can use a private app, but other people cannot open it from their libraries. Making an app more private may unlink it from agents with a wider audience. See [Sharing agents and sessions](/guides/agent/access-and-sharing) for details. *** ## Updating an app Manage an app's name, visibility, and deletion from the **Actions** (`⋯`) menu in the library. These actions are available for linked and unlinked apps. Only the owner can use them. Select **Version history** in the app's actions to browse past versions, preview one in place, and restore it. Restoring brings back the app as it was in that version. Anyone who can view the app can restore a previous version. That includes the owner, teammates the app is shared with through team or organization-wide visibility, and people who reach it through a linked agent. Restoring creates a new version and doesn't change the app's name or who can see it. To change an app's layout, logic, or data, ask an agent to edit it in a conversation. The steps depend on whether the app is linked to an agent: > [tab] Linked to an agent > > Open a conversation with the agent and describe the change, such as "Add a column for return rate" or "Group this by market." The agent edits the app in your library. > [tab] Not linked to an agent > > You can update an app without linking it to an agent first. > > **1. Open the app from the library** > > **2. Click Ask app** > > This opens the **Open app** dialog. > > **3. Choose where to work** > > **Continue in latest session** opens the most recent conversation where the > app was built or changed, if you have access. **Start new session** opens a > new conversation with the app attached. > > **4. Tell the agent what to change** > > Your edits apply to the same app in your library. > [!TIP] > > To keep using the same agent for future updates, [link the app to that agent](#linking-an-app-to-an-agent). Both methods edit the same app. *** ## Transferring an app to another owner The owner can hand an app to another member of your organization from the **Owner** row on the app's details panel. Dema previews the impact before you confirm: routines you own that update the app move with it, connected accounts you linked to those routines need to be reconnected by the new owner, and you lose access when the app is private. See [Transfer ownership](/guides/agent/access-and-sharing#transfer-ownership). *** ## Removing vs. deleting These two actions are different: | Action | Where | Effect | | - | - | - | | **Remove app** | Agent's Apps list | Unlinks the app from that agent. The app stays in your library. | | **Delete** | App Actions (`⋯`) menu | Permanently deletes the app and all its versions. This cannot be undone; only the owner can do it. | # Files and memory Source: https://docs.dema.ai/guides/agent/files-and-memory Upload reference files, browse conversation outputs, and review the notes your agent keeps in memory. The Files tab contains the files you upload, the files an agent creates, and the notes it keeps for later conversations. There are three kinds: | | Who writes it | How long it lives | | - | - | - | | **Shared files** | You | With the agent, across every conversation | | **Memory** | The agent | With the agent, across conversations | | **Outputs** | The agent | In one conversation | In a conversation, all three appear in one file tree: **Shared files (shared/)** **company\_inventory\_guidelines.md** **supplier\_lead\_times.csv** **Memory (state/)** **notes** **methodology.md** **flagged\_products\_log.csv** **Outputs** **stock\_health\_report.csv** **stock\_health\_chart.png** *** ## Where to find them > [tab] In a conversation > > Open the workspace panel and select **Files**. Shared files and memory appear under the agent, with the current conversation's outputs below them. Select the cog next to **Agent** to open the agent's settings. > > ![The workspace panel open on the Files tab, showing the agent's shared files and memory above the conversation's outputs](https://mintcdn.com/demaai/-QBoxgr91D2DfDZm/images/agent-files-workspace-panel.png?fit=max\&auto=format\&n=-QBoxgr91D2DfDZm\&q=85\&s=39b3dd249c10cf6ecce183382c72885a) > [tab] In the agent's settings > > The **Files** section of the agent's configuration shows the same tree. > > ![The Files section on the agent's configuration page, with shared files and memory folders expanded](https://mintcdn.com/demaai/-QBoxgr91D2DfDZm/images/agent-files-configuration.png?fit=max\&auto=format\&n=-QBoxgr91D2DfDZm\&q=85\&s=7aa1ebd61a73140d6cbb68d7505765a6) Both views show the same agent files. > [!NOTE] > > The agent section appears when the conversation runs on one of your agents. Conversation outputs are always there. *** ## Shared files Shared files are reference files you upload for the agent, such as brand guidelines, product catalogs, target margins, or campaign calendars. They are available in every conversation with that agent. The agent can read them but never changes them. | Action | How | | - | - | | Add files | Select **+** next to **Shared files**, then choose **Upload files** or **Upload folder**. Uploaded folders keep their structure. | | Preview a file | Select the file. | | Remove a file or folder | Hover over it and select remove. The agent will no longer be able to read it. | > [!TIP] > > Use shared files for reference material the agent needs across conversations. Attach a file to the message when it is only relevant to that conversation. *** ## Memory Memory contains notes the agent writes for itself. It can record information about your data, preferences, or earlier results and read those notes in later conversations. You can review and manage these notes: * Open a memory file to read it. * Delete a memory file if the information is wrong or outdated. The agent will no longer have that note. You cannot upload files to memory. Only the agent can write there. > [!NOTE] > > The agent may mention a path such as `state/notes.md`. The `state/` folder is memory, and its name appears next to **Memory** in the file tree. *** ## Outputs Files created during a conversation, such as CSV exports, images, and reports, appear under **Outputs**. Select a file to preview it or download it from the row. Outputs belong to their conversation: a new conversation starts with an empty Outputs section. *** ## Spotting what changed The file tree marks changes since you last opened it: * A **green dot** marks a new file. * An **orange dot** marks an updated file. The **Files** tab itself shows a dot when there's something you haven't seen. Open or download a file and its mark clears. *** ## Mention a file with `@` Type `@` in the message box to search integrations, apps, and files in the current session. To mention a file, search for a shared file, memory file, or earlier output: **1. Type @ and start typing the file name** **2. Pick the file** It turns into a pill in your message. **3. Send** The file is attached to your message. ![The @ menu open in the message box, listing recent workspace files with their paths and an Add files action](https://mintcdn.com/demaai/-QBoxgr91D2DfDZm/images/agent-file-mention-menu.png?fit=max\&auto=format\&n=-QBoxgr91D2DfDZm\&q=85\&s=fd4bc37a93fcd9b566d81bf4be4afe39) After you send the message, hover over a file pill for a quick view or select it to open the full preview. To attach a new file, select **Add files** from the `@` menu. *** ## Shared conversations Files are read-only when you open someone else's shared conversation. You can preview and download them, but only people who can run the agent can add or remove files. # Microsoft Agent 365 integrations Source: https://docs.dema.ai/guides/agent/integrations/agent-365 One-time Microsoft 365 tenant setup shared by the Dema Agent's Teams, Outlook, and SharePoint integrations. ## Overview Dema connects to Microsoft 365 through Microsoft's hosted **Agent 365 / Work IQ** MCP servers. Three Microsoft Agent 365 integrations are available, and all three use one tenant setup, one sign-in, and one permission model: > [card] [Microsoft Teams](/guides/agent/integrations/microsoft-teams) > > Chats, channels, messages, threads, and members > [card] [Microsoft Outlook (MCP)](/guides/agent/integrations/microsoft-outlook) > > Mail: read, search, organize, compose, and send > [card] [Microsoft SharePoint](/guides/agent/integrations/microsoft-sharepoint) > > Sites, lists, document libraries, files, and sharing Each integration talks to a server address unique to your Microsoft 365 tenant, which is why connecting takes an **MCP URL** and not just a sign-in. The agent acts only when you ask it to, and Dema asks you to confirm sensitive changes first. It signs in as whoever authorized the connection, so it cannot reach anything that person cannot open. > [!NOTE] > > The Microsoft Agent 365 integrations are in **preview**, and so are the Work IQ MCP servers behind them. Tools can change without notice. Your workspace might need preview integrations enabled before these show up. *** ## Prerequisites | What you need | Why | | - | - | | A **Microsoft 365** work or school account | Personal Microsoft accounts cannot reach Agent 365 servers | | A **Microsoft 365 Copilot** license for each person who connects | Microsoft's Work IQ servers run on the Copilot Chat API and reject tool calls without one | | A **Global Administrator** in Microsoft Entra | For the one-time tenant setup below | | Your **Entra tenant ID**, a GUID | It goes into the MCP URL | > [!TIP] > > Find your tenant ID in the [Entra admin center](https://entra.microsoft.com) under **Overview → Tenant ID**, or run `az account show --query tenantId -o tsv`. *** ## One-time tenant setup An admin does this **once per Microsoft 365 tenant**, not once per integration. Afterwards, anyone with a Copilot license can connect Teams, Outlook, and SharePoint. **1. Provision the Agent 365 Tools service principal** Microsoft exposes its Agent 365 tools through a shared resource called **Agent 365 Tools**, application ID `ea9ffc3e-8a23-4a7d-836d-234d7c7565c1`. Its service principal is not created in your tenant automatically, so a Global Administrator adds it once. Either method works: > [tab] Azure CLI > > With the [Azure CLI](https://learn.microsoft.com/cli/azure/install-azure-cli) installed, signed in as an admin: > > ```bash Provision the service principal theme={null} > az ad sp create --id ea9ffc3e-8a23-4a7d-836d-234d7c7565c1 > ``` > > > [!TIP] > > > > The command prints the new service principal as JSON. `Another object with the same value for property appId already exists` means it was already provisioned. > [tab] Graph Explorer > > No CLI needed. Open [Microsoft Graph Explorer](https://developer.microsoft.com/graph/graph-explorer), sign in as an admin, and send: > > ```http Request theme={null} > POST https://graph.microsoft.com/v1.0/servicePrincipals > Content-Type: application/json > > { > "appId": "ea9ffc3e-8a23-4a7d-836d-234d7c7565c1" > } > ``` > > > [!TIP] > > > > A `201 Created` response means it worked. A `409 Conflict` means it was already provisioned. > [!WARNING] > > Skip this and connecting fails with **AADSTS650052**, *"your organization lacks a service principal"*, and the `McpServers` permissions never appear in Entra. **2. Decide who approves the permission** Whoever connects is asked to approve one permission during sign-in: | Integration | Permission | | - | - | | Microsoft Teams | `McpServers.Teams.All` | | Microsoft Outlook (MCP) | `McpServers.Mail.All` | | Microsoft SharePoint | `McpServers.SharePoint.All` | If your tenant does not allow users to approve permissions themselves, that step fails and a Global Administrator grants it for everyone once. Replace `{tenant_id}` with your tenant ID, open the URL, and sign in as an admin: ```text Admin consent URL theme={null} https://login.microsoftonline.com/{tenant_id}/adminconsent?client_id=a268336e-61fb-483f-a9f9-df76dff26c93 ``` > [!NOTE] > > One grant covers all three integrations, and nobody in the tenant sees a consent prompt afterwards. *** ## Build your MCP URL Every Agent 365 integration asks for an MCP URL. Copy the one for the integration you are connecting, and replace `{tenant_id}` with your Entra tenant ID: ```text Microsoft Teams theme={null} https://agent365.svc.cloud.microsoft/agents/tenants/{tenant_id}/servers/mcp_TeamsServer ``` ```text Microsoft Outlook (MCP) theme={null} https://agent365.svc.cloud.microsoft/agents/tenants/{tenant_id}/servers/mcp_MailTools ``` ```text Microsoft SharePoint theme={null} https://agent365.svc.cloud.microsoft/agents/tenants/{tenant_id}/servers/mcp_SharePointRemoteServer ``` > [!NOTE] > > Replace the whole `{tenant_id}` placeholder, braces included. Dema rejects a URL that still has braces in it. A tenant ID is a GUID, like `8f7a1b2c-3d4e-4f56-a7b8-9c0d1e2f3a4b`. *** ## Connect in Dema **1. Open the integration** In Dema, go to **Agents → Settings → Integrations**, find the Agent 365 integration you want and click **Connect**. The entries are **Microsoft Teams**, **Microsoft Outlook (MCP)**, and **Microsoft SharePoint**. **2. Enter the MCP URL** Paste the URL you built above, then click **Add**. **3. Sign in and approve** Sign in with a Microsoft **work or school** account belonging to the same tenant as the URL, and approve the permission Dema asks for. > [!TIP] > > You are returned to Dema with the integration marked as Active. > [!TIP] > > Connecting a second Agent 365 integration repeats only these three steps, since the tenant setup is already done. *** ## When the connection expires Access tokens last about an hour, and Dema refreshes them in the background. A connection lapses only if the refresh window passes while Dema is disconnected, if the authorizing user's account is disabled, or if an admin revokes consent for the Dema app. When that happens, reconnect from **Agents → Settings → Integrations**. *** ## Troubleshooting > [accordion] Dema says the MCP URL is invalid > > The URL still contains the placeholder. Replace `{tenant_id}` and its braces with your tenant GUID, so the address ends in `/agents/tenants//servers/`. Check the server name matches [the list above](#build-your-mcp-url) exactly, including capitalization. > [accordion] AADSTS650052: your organization lacks a service principal > > The Agent 365 Tools service principal is missing from your tenant. An admin runs the provisioning step in [One-time tenant setup](#one-time-tenant-setup). > [accordion] Sign-in says approval is required by an administrator > > Your tenant does not allow users to approve permissions themselves, usually reported as **AADSTS65001** or **AADSTS90094**. A Global Administrator grants it once with the [admin consent URL](#one-time-tenant-setup), and connecting works normally afterwards. > [accordion] Sign-in is rejected > > Two things to check: > > * You signed in with a **personal** Microsoft account. Only work or school accounts are supported. > * The account belongs to a **different tenant** than the one in your MCP URL. They have to be the same organization. > [accordion] The connection is Active but the agent sees nothing, or gets a 403 > > This is usually a missing **Microsoft 365 Copilot** license for the user who authorized the connection. Assign one, wait for it to propagate, then ask again. If it still fails, reconnect so Dema picks up a fresh token. > [accordion] The permission does not appear in Entra > > An Entra admin has to register or consent the relevant Work IQ MCP server in your tenant before anyone can grant its `McpServers` permission. Still stuck? Contact [support](mailto:info@dema.ai) with the error message, including the Entra `AADSTS` code if you have one. *** ## Additional resources * [Set up the Agent 365 Tools service principal](https://learn.microsoft.com/microsoft-agent-365/developer/tooling) * [Manage tools for agents in the Microsoft 365 admin center](https://learn.microsoft.com/microsoft-agent-365/bring-your-own-mcp) * [Work IQ API permissions](https://learn.microsoft.com/microsoft-365/copilot/extensibility/work-iq/permissions) # Algolia Source: https://docs.dema.ai/guides/agent/integrations/algolia Enable Algolia Productivity MCP and connect it to your Dema agents. Connect Algolia to let your Dema agents search your indices and review search analytics. The integration is read-only and uses your Algolia account's access permissions. *** ## Enable in Algolia 1. Open the [Algolia dashboard](https://dashboard.algolia.com/) and go to **Generative AI → MCP Servers → Productivity**. 2. Turn on **Algolia Productivity MCP**. This only needs to be enabled once per Algolia account. Leave it enabled while using the integration. See [Algolia's Productivity MCP guide](https://www.algolia.com/doc/guides/model-context-protocol/productivity-mcp) for details. *** ## Connect in Dema 1. Go to **Agents → Settings → Integrations** and click **Add integration**. 2. Find **Algolia** and click **Connect**. 3. Sign in to Algolia and approve access. You'll return to Dema with the connection ready to use. No API keys or OAuth app setup are needed. Each user signs in with their own Algolia account. To use the connection with an agent you created, open that agent and add it under **Configuration → Integrations**. See [Your agents](/guides/agent/your-agents#integrations). # Apify Source: https://docs.dema.ai/guides/agent/integrations/apify Let the Dema Agent run Apify Actors for web scraping, enrichment, and automated data collection. ## Overview Once Apify is connected, the Dema Agent can discover and run Apify Actors, access your datasets and key-value stores, and use Apify as a research and enrichment tool during conversations. *** ## Prerequisites * An Apify account with permission to run Actors. *** ## Connect Apify 1. In Dema, go to **Agents → Settings → Integrations**. 2. Find **Apify** and click **Connect**. 3. Sign in to Apify and approve access. 4. You are returned to Dema with the integration marked as Active. *** ## Scopes Dema requests | Scope | What it allows | | - | - | | `full_api_access` | Discover Actors, run them, and read their outputs from your Apify account | *** ## Troubleshooting * **An Actor fails to run.** Check that your Apify plan has enough compute units remaining and that the Actor is not paused in your Apify console. *** ## Additional resources * [Apify account settings](https://console.apify.com/account) # Attentive Source: https://docs.dema.ai/guides/agent/integrations/attentive Let the Dema Agent manage SMS and email subscriptions, record ecommerce events, and update customer attributes in Attentive when you ask. ## Overview Once Attentive is connected, the Dema Agent can manage subscriptions and customer data directly inside a conversation — opt customers in or out of SMS/email subscriptions and look up subscription status by phone or email, record ecommerce events (add-to-cart, product view, purchase) that trigger Attentive journeys, set or read custom user attributes, send custom events to fire automations, and submit privacy/GDPR deletion requests. The agent only acts when you ask it to, and Dema asks you to confirm sensitive changes before they are applied. *** ## Prerequisites * An Attentive account with access to the custom-app management page. * A custom app created in Attentive to obtain an API key (see below). *** ## Connect Attentive **1. Create a custom app in Attentive to get an API key** 1. Log in to Attentive and open **App Marketplace → custom-app management** (`ui.attentivemobile.com/integrations/custom-app/management`). 2. Click **+ Create App** (top-right). 3. Enter an app name (e.g. `Dema Agent`) and a contact email. 4. In **Permissions**, set each API the agent needs to **Write** (each defaults to **No Access**): Custom Attributes, Custom Events, eCommerce, Privacy Request, Product Catalog, Subscribers. 5. Click **Create**. 6. In the **Copy API key** dialog, click **Copy** and save the key — it is shown only once. > [!NOTE] > > The API key is shown only once. If you lose it, regenerate it in Attentive (**Built by you** tab → open the app → **API key → Regenerate**) and reconnect — regenerating invalidates the old key. Treat the key like a password. **2. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Attentive**, and click **Connect**. Enter: * **API key** — the key you copied from Attentive. Click **Add**. Dema marks the integration as Active. *** ## Permissions to grant Set each of these to **Write** when you create the custom app so the agent can read and act on your Attentive data: | Permission | What it covers | | - | - | | Custom Attributes | Read and set custom user attributes | | Custom Events | Send custom events that trigger journeys | | eCommerce | Record add-to-cart, product view, and purchase events | | Privacy Request | Submit GDPR/deletion requests | | Product Catalog | Read product catalog data | | Subscribers | Subscribe and unsubscribe users; read subscription status | *** ## Troubleshooting > [accordion] A request failed for one API > > Each API defaults to **No Access**. Make sure you set every API the agent needs to **Write** when creating the app, then reconnect. > [accordion] I lost the API key > > The key is shown only once. Regenerate it on the **Built by you** tab in Attentive, then reconnect in Dema with the new key. > [accordion] I cannot reach the custom-app page > > Email [api-tokens@attentivemobile.com](mailto:api-tokens@attentivemobile.com) to request access to the custom-app management page. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [Create and manage custom apps](https://docs.attentive.com/docs/create-and-manage-custom-apps) * [Attentive API authentication](https://docs.attentive.com/pages/authentication/) # Azure SQL Source: https://docs.dema.ai/guides/agent/integrations/azure-sql Let the Dema Agent query and explore data in your Azure SQL Database through a SQL MCP Server you host. ## Overview Once Azure SQL is connected, the Dema Agent can explore schemas, read records, and run governed queries against your Azure SQL Database — useful for bringing live operational data into an analysis alongside Dema metrics without rebuilding the data into a separate warehouse. The agent connects over MCP to a **Microsoft SQL MCP Server** that you run in your own Azure subscription using [Data API builder (DAB)](https://learn.microsoft.com/en-us/azure/data-api-builder/). Your database stays in your tenant — Dema only sees the entities you expose and the rows the agent reads. What the agent is allowed to do (read vs. write, and which tables) is controlled entirely by your DAB configuration, not by Dema. The agent only acts when you ask it to. ### What the agent can do The SQL MCP Server exposes a fixed, predictable set of tools over the entities you publish. The agent never writes raw SQL or sees your internal schema directly — it works through Data API builder's secure abstraction layer, so every call is deterministic and governed by your role-based permissions. The tools cover: * **Discover** — list and describe the entities you've exposed (`describe_entities`). * **Read** — fetch and summarize records (`read_records`, `aggregate_records`). * **Write** — create, update, and delete records (`create_record`, `update_record`, `delete_record`) — only on entities where you grant those actions. * **Stored procedures** — run a stored procedure mapped as an entity (`execute_entity`). To suppress this tool, do not expose any stored-procedure entities in `dab-config.json`. The read and write tools map to your DAB permissions, so a read-only setup (grant only `read`) refuses every create, update, and delete. Stored-procedure entities are a separate entity type: `execute_entity` runs whatever the procedure does internally regardless of read/write grants, so control it by choosing which procedures — if any — you expose as entities. *** ## Prerequisites * An **Azure SQL Database** (or SQL Server) with the data you want the agent to access. * The ability to deploy the SQL MCP Server — **Data API builder 2.0** — to **Azure Container Apps** or **Azure App Service** with network access to your database. * Permission in **Microsoft Entra ID** to register an application and create a client secret. * An Azure role that can grant the MCP Server access to your database (for example to assign a managed identity). > [!NOTE] > > The SQL MCP Server ships with Data API builder version 1.7 and later. Use the latest **2.0** release for the current capabilities and fixes. > [!WARNING] > > Dema connects only to MCP endpoints on `.azurecontainerapps.io`, `.azurewebsites.net`, or `.azure-api.net` (the default Azure Container Apps, App Service, and API Management hosts). Custom domains — Azure Front Door, an API Management custom domain, or your own ingress hostname — aren't accepted as the connect URL yet, so deploy where the endpoint is reachable on one of these hosts. If you need a custom domain, contact [support](mailto:info@dema.ai). *** ## Set up the SQL MCP Server This is a one-time setup in your own Azure environment. The steps below are the essentials — follow the linked Microsoft Learn guides for full detail. **1. Deploy Data API builder pointed at your database** Deploy the DAB SQL MCP Server to Azure Container Apps (or App Service) and point its connection string at your Azure SQL Database. For outbound database authentication, Microsoft recommends **managed identity** rather than a SQL username and password: ```text theme={null} Server=tcp:.database.windows.net,1433;Initial Catalog=;Authentication=Active Directory Managed Identity; ``` The server exposes a streamable HTTP MCP endpoint at `https:///mcp`. See the [Azure Container Apps quickstart](https://learn.microsoft.com/en-us/azure/data-api-builder/mcp/quickstart-azure-container-apps). **2. Expose only the entities the agent needs** In `dab-config.json`, add an entity for each table or view you want the agent to reach, and grant **read-only** access with the `authenticated:read` permission so only authenticated callers (Dema) can read them: ```bash theme={null} dab update Products --permissions "authenticated:read" ``` Anything you don't expose as an entity is invisible to the agent. The MCP Server turns each entity into the tool surface described in [What the agent can do](#what-the-agent-can-do) above. **3. Register an app in Microsoft Entra ID** Register **one** application in Microsoft Entra ID. It serves as both the API that the MCP Server protects and the identity Dema uses to call it. Record the: * **Directory (tenant) ID** — used to build the issuer and token URLs. * **Application (client) ID** and **Application ID URI** in the form `api://`. Then create a **client secret** on the app. Dema uses the client ID and secret to obtain a token. See [Register an application in Microsoft Entra ID](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app). **4. Configure inbound authentication on the MCP Server** Data API builder 2.0 starts **unauthenticated** by default, so you must turn on Entra ID JWT validation. Set the provider to `EntraId` and point the audience at your Application ID URI and the issuer at your tenant: ```bash theme={null} dab configure --runtime.host.authentication.provider EntraId dab configure --runtime.host.authentication.jwt.audience "api://" dab configure --runtime.host.authentication.jwt.issuer "https://login.microsoftonline.com//v2.0" ``` See [Configure authentication for SQL MCP Server](https://learn.microsoft.com/en-us/azure/data-api-builder/mcp/how-to-configure-authentication). *** ## Connect Azure SQL in Dema **1. Open the Azure SQL connector** In Dema, go to **Agents → Settings → Integrations**, find **Azure SQL**, and click **Connect**. **2. Enter the connection details** Fill in the values from your setup: * **MCP URL** — your server's endpoint, in the form `https:///mcp` (for example `https://.azurecontainerapps.io/mcp`). * **Token URL** — `https://login.microsoftonline.com//oauth2/v2.0/token`. * **Client ID** — the Application (client) ID of the Entra app you registered. * **Client secret** — the secret you created on that app. Click **Add**. Dema obtains a token from Entra ID and marks the integration as Active. > [!NOTE] > > Use the **same Entra app** as both the protected API (the DAB `jwt.audience`) and Dema's client. That keeps the Application ID URI `api://` aligned with the client ID, so the connection works with just the four values above — no extra configuration in Dema. *** ## Permissions Dema does not request named scopes of its own. What the agent can do is governed entirely by the **entity permissions in your `dab-config.json`**. Grant the authenticated role only the access the agent should have: * For read-only access, expose each entity with `authenticated:read`. * The agent can only see entities you explicitly define — unexposed tables and views stay out of reach. > [!WARNING] > > Access is enforced on **your** side, in Data API builder. Dema can only do what your DAB entity permissions allow, so review them before connecting and keep the exposed surface to what the agent actually needs. *** ## When the connection expires Dema uses a machine-to-machine (client-credentials) flow: it mints a fresh access token from your client ID and secret for each session and refreshes automatically. There is no interactive sign-in to repeat. The connection breaks only when the **client secret expires or is rotated** in Microsoft Entra ID. When that happens, create a new secret on the app, then go to **Agents → Settings → Integrations**, find **Azure SQL**, click **Reconnect**, and enter the new secret. *** ## Troubleshooting > [accordion] Authentication fails when connecting > > Double-check the **Client ID**, **Client secret**, and **Token URL**. The secret must be current (not expired or rotated), and the token URL must use your **Directory (tenant) ID**. Confirm the Entra app exposes the `api://` Application ID URI that the MCP server validates as its audience. > [accordion] Dema says the MCP URL is invalid > > The MCP URL must be an HTTPS URL on your own tenant — on `.azurecontainerapps.io`, `.azurewebsites.net`, or `.azure-api.net` — and must end in `/mcp`. Copy it from your deployed app rather than typing it by hand. > [accordion] Dema says the Token URL is invalid > > The token URL must be on `login.microsoftonline.com`, in the form `https://login.microsoftonline.com//oauth2/v2.0/token`. Use your **Directory (tenant) ID**. > [accordion] The agent gets a 401 or 403 from the MCP server > > The token Dema sends must match what Data API builder validates. Confirm `runtime.host.authentication.jwt.audience` is `api://` and `jwt.issuer` is `https://login.microsoftonline.com//v2.0` (note the `/v2.0`). For a 403, make sure the entity grants `authenticated:read` (or the action the agent needs). > [accordion] The agent cannot see a table I expected > > Only entities defined in `dab-config.json` are visible. Add the table or view as an entity and grant it `authenticated:read`, then ask the agent again. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [SQL MCP Server overview](https://learn.microsoft.com/en-us/azure/data-api-builder/mcp/overview) * [Configure authentication for SQL MCP Server](https://learn.microsoft.com/en-us/azure/data-api-builder/mcp/how-to-configure-authentication) * [Quickstart: deploy to Azure Container Apps](https://learn.microsoft.com/en-us/azure/data-api-builder/mcp/quickstart-azure-container-apps) * [Configure Microsoft Entra ID authentication in Data API builder](https://learn.microsoft.com/en-us/azure/data-api-builder/concept/security/authenticate-entra) * [Register an application in Microsoft Entra ID](https://learn.microsoft.com/en-us/entra/identity-platform/quickstart-register-app) # BigQuery Source: https://docs.dema.ai/guides/agent/integrations/bigquery Let the Dema Agent query data, explore schemas, and run SQL against Google BigQuery. ## Overview Once BigQuery is connected, the Dema Agent can list datasets, inspect table schemas, and run SQL queries against your BigQuery project. Useful for pulling warehouse data into an analysis alongside Dema metrics. *** ## Prerequisites * A Google Cloud project with BigQuery enabled. * A Google account with at least `BigQuery User` or equivalent permissions on the datasets you want Dema to access. *** ## Connect BigQuery 1. In Dema, go to **Agents → Settings → Integrations**. 2. Find **BigQuery** and click **Connect**. 3. Sign in to Google and approve the scopes Dema requests. 4. You are returned to Dema with the integration marked as Active. *** ## Scopes Dema requests | Scope | What it allows | | - | - | | `https://www.googleapis.com/auth/bigquery` | Run queries, list datasets, and read table schemas in projects you can access | *** ## Troubleshooting * **Query fails with permission denied.** Confirm your Google account has access to the dataset or table. BigQuery honors your existing IAM permissions, so Dema only sees what you already see. *** ## Additional resources * [BigQuery access control](https://cloud.google.com/bigquery/docs/access-control) # Microsoft Dynamics 365 Business Central Source: https://docs.dema.ai/guides/agent/integrations/business-central Connect the Dema Agent to Business Central records and business processes through Microsoft's hosted MCP server. ## Overview Once Microsoft Dynamics 365 Business Central is connected, the Dema Agent can work with ERP records from one company in your Business Central online environment. It can answer questions about customers, items, sales orders, invoices, and other records exposed through Business Central APIs. Business Central exposes read-only tools by default. A Business Central administrator can create an MCP configuration to allow selected create, modify, delete, or business-process actions. The agent signs in as the person who connects the integration. It cannot access records or perform actions that person is not allowed to use in Business Central. *** ## Prerequisites * A **Business Central online** environment. * A Business Central user with access to the company and records the agent should use. * Your Business Central environment name and company name. You can [find your Microsoft Entra tenant ID](#find-your-microsoft-entra-tenant-id) using the steps below. * A Microsoft Entra administrator to approve Dema's Business Central permission the first time your tenant connects. * For a custom MCP configuration, a Business Central administrator with the **MCP - ADMIN** permission set or equivalent permissions. *** ## Choose the agent's access ### Read-only access You do not need to create an MCP configuration for read-only access. Leave **MCP configuration** empty when you connect. The agent can read the standard Business Central API pages that the signed-in user can access. ### Selected read and write access To choose which API pages and actions the agent can use: 1. In Business Central, search for and open **Model Context Protocol (MCP) Server Configurations**. 2. Select **New**, give the configuration a recognizable name, and turn on **Active**. 3. Add the API page objects the agent needs under **Available Tools**. 4. Grant **Allow Read** where needed. 5. To allow changes, turn on **Unblock Edit Tools**, then grant only the required **Allow Create**, **Allow Modify**, **Allow Delete**, and **Allow Bound Actions** permissions. Use the smallest set of tools and actions the agent needs. The signed-in user's Business Central permissions still apply in addition to the MCP configuration. *** ## Collect the connection values Enter these values in Dema: | Dema field | Business Central connection string | Description | | - | - | - | | **Microsoft Entra tenant ID** | `TenantId` | The tenant GUID for your Business Central environment | | **Business Central environment** | `EnvironmentName` | The environment name, such as `Production` or the name of a sandbox | | **Business Central company** | `Company` | The exact company name in the selected environment | | **MCP configuration** | `ConfigurationName` | Optional; the active MCP configuration to use | ### Find your Microsoft Entra tenant ID The tenant ID is a GUID in a format such as `aaaabbbb-0000-cccc-1111-dddd2222eeee`. It is not your company name, Microsoft login email, or a domain such as `example.onmicrosoft.com`. The quickest way to find it is in Business Central: 1. Open the **Help** menu in the upper-right corner of Business Central. 2. Select **Help & Support**. 3. Copy the tenant ID shown on the page and paste it into the **Microsoft Entra tenant ID** field in Dema. You can also find it in the [Microsoft Entra admin center](https://entra.microsoft.com/): 1. Sign in with a work account from the same organization as your Business Central environment. 2. Go to **Entra ID → Overview → Properties**. 3. Scroll to **Tenant ID** and copy the GUID. If you belong to more than one Microsoft organization, check that you selected the directory used by Business Central. If you cannot open the Entra properties, ask your Microsoft 365 or Business Central administrator to copy the tenant ID from the Business Central **Help & Support** page. If you created an MCP configuration, open it in Business Central and select **Advanced → Connection String** to copy all the connection values at once. The value after `TenantId=` is the tenant ID. Company and configuration names may include spaces and non-English characters; paste their original names into Dema. *** ## Connect Business Central **1. Open the integration** In Dema, go to **Agents → Settings → Integrations**, find **Microsoft Dynamics 365 Business Central**, and click **Connect**. **2. Enter the connection values** Enter the Microsoft Entra tenant ID, environment, and company you collected above. Enter the MCP configuration name if you created one; otherwise leave it empty for the default read-only tools. Click **Add**. **3. Sign in and approve** Sign in with a Microsoft work account from the same Entra tenant. The account must have access to the selected Business Central environment and company. The first connection from your tenant may require a Microsoft Entra administrator to approve Dema's Business Central permission. > [!TIP] > > You are returned to Dema with the integration marked as Active. **4. Check the connection** Ask the agent a read-only question, for example: *"Which sales orders are still open?"* If you enabled a write tool, test it with a low-risk record and confirm the proposed action before it runs. To use the connection with an agent you created, open that agent and add it under **Configuration → Integrations**. See [Your agents](/guides/agent/your-agents#integrations). *** ## Access Dema requests | Microsoft permission | What it allows | | - | - | | `Financials.ReadWrite.All` | Authorize Dema to call the official Business Central MCP server on behalf of the signed-in user | This permission does not make every operation available automatically. The effective access is the intersection of: * The tools and actions exposed by the selected Business Central MCP configuration. * The signed-in user's Business Central permissions. * The tool permissions configured for the Dema agent. *** ## Troubleshooting > [accordion] Microsoft says administrator approval is required > > A Microsoft Entra administrator must approve Dema's Business Central permission for your tenant. After approval, return to Dema and reconnect. > [accordion] The connection is Active, but the agent cannot find records > > Check that the tenant ID, environment, and company exactly match the intended Business Central environment. Also confirm that the account used to connect can open the records in Business Central. > [accordion] The agent only has read tools > > Write tools require an active MCP configuration. In Business Central, confirm **Unblock Edit Tools** is on and the required create, modify, delete, or bound-action permissions are selected. Then confirm the exact configuration name is entered in Dema and that the signed-in user has the matching Business Central permissions. > [accordion] The MCP configuration is not found > > Configuration names are specific to an environment and company. Check the spelling and capitalization against **Advanced → Connection String** in Business Central, and make sure the configuration is Active. > [accordion] The agent connects to the wrong company > > Click **Reconnect** on the integration card and replace the environment or company with the exact values from the intended Business Central connection string. If you are still stuck, contact [support](mailto:info@dema.ai) with the integration name and the error message you see. *** ## Additional resources * [Business Central MCP Server overview](https://learn.microsoft.com/dynamics365/business-central/dev-itpro/ai/mcp-overview) * [Configure the Business Central MCP Server](https://learn.microsoft.com/dynamics365/business-central/dev-itpro/ai/configure-mcp-server) * [Find your Microsoft Entra tenant ID](https://learn.microsoft.com/entra/fundamentals/how-to-find-tenant) # Centra Source: https://docs.dema.ai/guides/agent/integrations/centra Let the Dema Agent work directly with your Centra store — read products, orders, customers, inventory, and pricing, and optionally act on them by updating stock, confirming orders, creating shipments, and managing discounts. ## Overview Once Centra is connected, the Dema Agent can pull live data from your store — products, variants, orders, customers, inventory, markets, pricelists, categories, and discounts — directly inside a conversation. With write permissions, it can also take action for you: correct stock, confirm or cancel orders, create shipments, update products and customers, and turn discounts on or off. The agent only acts when you ask it to, and Dema asks you to confirm sensitive changes before they are applied. You stay in control of both what the agent can see and what it can do. > [!NOTE] > > This is a **separate connection** from the [Centra data integration](/integrations/ecommerce/centra) that syncs orders and inventory into Dema's analytics. That one is a read-only background sync; this one lets the agent read **and act** in real time when you ask. They use different credentials — see below. *** ## Use a dedicated token for the agent Create a **new Integration API token just for the agent**, separate from the one your data sync uses. The agent can act on your store, not just read it, so its own token keeps access independently scoped, auditable, and revocable — cutting the agent off or rotating its token never touches your analytics sync. Name it something obvious like `Dema Agent`. *** ## Prerequisites * A Centra account with permission to create **Integration API tokens** (System → API Tokens). * Your store URL, in the form `https://your-store.centra.com`. *** ## Connect Centra **1. Create a dedicated API token in Centra** 1. In Centra, go to **System → API Tokens**. 2. Click **Create integration API token** in the top right. 3. Give it a description and set **Integration name** to `Dema Agent` (create it if it does not exist). 4. Set an **expiry date**. Centra tokens are time-limited (30 days by default); pick a window that fits your rotation policy. 5. Leave **Restrictions** unchecked, or scope them if your security team requires it. 6. Under **Permissions**, select the permissions listed in [Permissions to grant](#permissions-to-grant) below. Grant the read set for analysis; add write permissions only if you want the agent to make changes. 7. Click **Save** and copy the generated token. **2. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Centra**, and click **Connect**. Enter: * **API token** — the token you just created. * **Account URL** — your store URL, for example `https://your-store.centra.com`. Click **Add**. Dema verifies the credentials and marks the integration as Active. *** ## Permissions to grant Centra permissions are granular and chosen when you create the token. We recommend the principle of least privilege: grant the **read** set so the agent can analyze your store, and add **write** permissions only for the actions you actually want it to perform. > [!NOTE] > > Centra tells you the exact permission every request uses. If the agent ever reports a missing permission, Centra's error names the precise one — add it to the token and reconnect. This is also the surest way to grant the agent the minimum it needs and nothing more. ### Read access (recommended baseline) Grant these so the agent can answer questions across your catalogue, orders, customers, inventory, and pricing. > [accordion] Products & catalogue > > | Permission | What it unlocks | > | - | - | > | `Product:read` | Read products and their details | > | `ProductVariant:read` | Read variants (colours, styles) | > | `ProductSize:read` | Read sizes, SKUs, and EANs | > | `Brand:read` | Read the brand on a product | > | `Collection:read` | Read the collection a product belongs to | > | `Display:read` | Read catalogue items shown to shoppers | > | `Bundle:read` | Identify bundle products | > [accordion] Inventory > > | Permission | What it unlocks | > | - | - | > | `Warehouse:read` | Read warehouses and stock locations | > | `ProductVariant.stock:read` | Read stock levels per variant | > | `ProductSize.stock:read` | Read stock levels per size | > [accordion] Orders & returns > > | Permission | What it unlocks | > | - | - | > | `Order:read` | Read orders, line items, and totals | > | `Order.shippingAddress:read` | Read shipping addresses on orders | > | `Order.billingAddress:read` | Read billing addresses on orders | > | `Return:read` | Read return details on an order | > [accordion] Customers > > | Permission | What it unlocks | > | - | - | > | `Customer:read` | Look up customers and their order history | > | `Customer.billingAddress:read` | Read a customer's billing address | > [accordion] Markets, pricing & merchandising > > | Permission | What it unlocks | > | - | - | > | `Market:read` | Read markets and sales channels | > | `Store:read` | Read stores | > | `Pricelist:read` | Read pricelists | > | `Category:read` | Read the merchandising category tree | > | `Voucher:read` | Read discount codes and vouchers | > | `Campaign:read` | Read scheduled price campaigns | > [accordion] Reference data > > These cover currency and country values that appear on prices, totals, addresses, markets, and pricelists. > > | Permission | What it unlocks | > | - | - | > | `Currency:read` | Read currencies on prices and totals | > | `Country:read` | Read countries on addresses, markets, and pricelists | The full read baseline, ready to copy: ```text Read permissions theme={null} Product:read ProductVariant:read ProductSize:read Brand:read Collection:read Display:read Bundle:read Warehouse:read ProductVariant.stock:read ProductSize.stock:read Order:read Order.shippingAddress:read Order.billingAddress:read Return:read Customer:read Customer.billingAddress:read Market:read Store:read Pricelist:read Category:read Voucher:read Campaign:read Currency:read Country:read ``` ### Write access (optional) Add these only if you want the agent to make changes in Centra. Write tools run only when you ask, and Dema prompts you to approve sensitive changes before they are applied. > [accordion] Inventory > > | Permission | What it unlocks | > | - | - | > | `StockChange:write` + `WarehouseDelivery:read` | Set or correct stock quantities | > [accordion] Order operations > > | Permission | What it unlocks | > | - | - | > | `Order:write` | Confirm or cancel orders | > | `Purchaser:read` | Required to cancel an order | > | `OrderHistory:write` | Add notes to an order | > | `Shipment:write`, `Shipment:read`, `Shipment.shippingAddress:read`, `AdminUser:read`, `StorePlugin:read` | Create shipments and fulfil orders | > [accordion] Catalogue & customers > > | Permission | What it unlocks | > | - | - | > | `Product:write` | Update product fields (name, status, number, internal comment) | > | `Customer:write` | Update customer fields (status, internal comment) | > | `Attribute:write` | Set custom attributes (custom fields) on any object | > [accordion] Merchandising > > | Permission | What it unlocks | > | - | - | > | `Category:write` | Create categories and add or remove displays | > [accordion] Pricing & promotions > > | Permission | What it unlocks | > | - | - | > | `Price:write` | Set a product's price in a pricelist | > | `Voucher:write` | Disable or delete vouchers | > [!NOTE] > > Creating a shipment also requires `AdminUser:read` and `StorePlugin:read` on the token — Centra needs them to resolve the shipping configuration even though the agent never reads that data directly. The write permissions, ready to add on top of the read baseline: ```text Write permissions theme={null} StockChange:write WarehouseDelivery:read Order:write Purchaser:read OrderHistory:write Shipment:write Shipment:read Shipment.shippingAddress:read AdminUser:read StorePlugin:read Product:write Customer:write Attribute:write Category:write Price:write Voucher:write ``` *** ## When your token expires Centra Integration API tokens are static and expire on the date you set (30 days by default). When a token expires, the integration shows as expired in Dema and the agent stops using it. To restore access, create a fresh token in Centra and paste it in via **Reconnect** on the integration card. > [!TIP] > > Set a calendar reminder a few days before the expiry date so the agent never loses access unexpectedly. A longer expiry window means fewer rotations, at the cost of a longer-lived credential — pick what fits your security policy. *** ## Troubleshooting > [accordion] The agent says it is missing a permission > > Centra names the exact permission in the error (it returns `permissionsUsed` on every request). Open the token in **System → API Tokens**, add the named permission, save, and click **Reconnect** in Dema. If the token cannot be edited, create a new one with the added permission and reconnect. > [accordion] Dema says the Account URL is invalid > > The Account URL must be an HTTPS URL pointing at your Centra store, in the form `https://your-store.centra.com`. Use your real store hostname, not a hand-written value. > [accordion] Dema says my connection has expired > > Your Centra token reached its expiry date. Create a new token in Centra and click **Reconnect** on the Centra integration card to paste it in. > [accordion] The agent cannot see a write action working > > Make sure you granted the matching write permission when you created the token (see [Write access](#write-access-optional)). Write permissions are not included in the read baseline and must be added deliberately. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [Centra Integration API documentation](https://centra.dev/docs) * [Centra data integration (analytics sync)](/integrations/ecommerce/centra) — the separate read-only connection that feeds Dema's reporting # Commercetools Source: https://docs.dema.ai/guides/agent/integrations/commercetools Let the Dema Agent query orders, products, customers, inventory, and categories from Commercetools Composable Commerce. ## Overview Once Commercetools is connected, the Dema Agent can query orders, products, customers, inventory, and categories from your Commercetools project. Useful for bringing composable commerce data into a Dema analysis. *** ## Prerequisites * A Commercetools project you have admin access to. * Permission to create API Clients in the Commercetools Merchant Center. * Your project's region — it appears in the Auth URL shown when you create the API Client (for example `europe-west1.gcp`, `us-central1.gcp`, or an AWS region like `eu-central-1.aws`). > [!NOTE] > > Commercetools uses long-lived API credentials rather than an interactive login. You create an API Client in Merchant Center and paste its credentials into Dema. *** ## Connect Commercetools **1. Create an API Client in Merchant Center** 1. Open Merchant Center and go to **Settings → Developer settings → API clients**. 2. Click **Create new API client**. 3. Give it a recognizable name such as `Dema Agent`. 4. Under **Scopes**, select the scopes listed under [Scopes Dema requests](#scopes-dema-requests) below. You can scope access to specific stores if you only want Dema to see part of the project. 5. Click **Create New API Client**. **2. Copy the credentials** Merchant Center shows the credentials only once. Copy the following values: * **Client ID** * **Secret** * **Auth URL** (for example `https://auth.europe-west1.gcp.commercetools.com/oauth/token`). This is the value you paste into Dema as the **Token URL**. **3. Paste the credentials into Dema** In Dema, go to **Agents → Settings → Integrations**, find **Commercetools**, and click **Connect**. Enter: * **Client ID** * **Client secret** * **Token URL** (the auth URL from the previous step) Click **Add**. Dema verifies the credentials and marks the integration as Active. > [!NOTE] > > You do not need to enter a project key. Dema reads the project key from the scopes you granted the API Client (for example `view_orders:my-project-key`) during the first token exchange. *** ## Scopes Dema requests Dema honors whichever scopes you assign to the API Client. For typical agent use, grant at least: | Scope pattern | What it allows | | - | - | | `view_orders:{projectKey}` | Read order history | | `view_products:{projectKey}` | Read products and catalog | | `view_customers:{projectKey}` | Read customer records | | `view_categories:{projectKey}` | Read category tree | | `manage_customers:{projectKey}` | Update customer records and groups (optional, only if you want write access) | Replace `{projectKey}` with your project's key. When you select scopes in Merchant Center, they apply to the project the API Client belongs to — you don't type the key by hand. > [!NOTE] > > There is no separate inventory scope. `view_products:{projectKey}` also grants read access to inventory entries (stock levels). *** ## Rotating the credentials Commercetools API Client secrets do not expire, but a client is **immutable** once created — you cannot change its scopes or regenerate its secret. To rotate: 1. In Merchant Center, create a **new** API Client with the same scopes. 2. In Dema, click **Reconnect** on the Commercetools integration card and enter the new Client ID, Client secret, and Token URL. 3. Delete the old API Client in Merchant Center. Rotate periodically, and immediately if you suspect the secret was exposed. *** ## Troubleshooting * **Dema says the token URL is invalid.** The auth URL must be HTTPS and must end with `.commercetools.com`. Use the URL shown in Merchant Center for your region, not a hand-written value. * **Dema cannot authenticate.** Double-check the client secret. Merchant Center only shows it once, so if you lost it, create a new API Client and paste the new credentials. * **Missing scopes.** If the agent reports it cannot see a resource, add the matching scope to the API Client in Merchant Center and reconnect in Dema. *** ## Additional resources * [Commercetools: Developer settings (API clients)](https://docs.commercetools.com/merchant-center/developer-settings) * [Commercetools OAuth scopes](https://docs.commercetools.com/api/scopes) # Contentful Source: https://docs.dema.ai/guides/agent/integrations/contentful Let the Dema Agent search, create, and publish entries and assets, audit the content model, and run AI Actions in Contentful when you ask. ## Overview Once Contentful is connected, the Dema Agent can work with your content directly inside a conversation. It can find entries missing key fields before a launch, bulk-update entries (pricing, seasonal copy), create and publish new entries, upload and publish assets, audit the content model — content types, tags, and locales — for localization gaps, and invoke reusable AI Actions to localize or refresh content. The agent only acts when you ask it to, and Dema asks you to confirm sensitive changes before they are applied. > [!NOTE] > > Installing the MCP app in Contentful and connecting in Dema are **both required**. The MCP app gates which tools work in each space and environment, so a connection in Dema only reaches the spaces and environments where the app is installed and authorized. *** ## Prerequisites * A Contentful account with permission to install Marketplace apps in the target space. * The Contentful MCP app installed and configured per space and per environment (see below). * Your data region — Global/US or EU — which determines the MCP URL. *** ## Connect Contentful **1. Install and configure the Contentful MCP app (per space + environment)** 1. Log in to the Contentful web app (use `be.eu.contentful.com` if your org is EU-resident, otherwise `be.contentful.com`). 2. In the top navigation open **Apps** then **Marketplace**. 3. Find the **Contentful MCP** app and click **Install**. 4. Select the target space and environment and click **Authorize access**. 5. Choose which tool categories are enabled and set each to **read-only** or **read/write** (start read-only). Save. 6. Repeat for every space + environment the agent needs. > [!TIP] > > Start with everything read-only and enable write only on the spaces and environments where you actually want the agent to make changes. **2. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Contentful**, and click **Connect**. Enter: * **MCP URL** — your region's URL: Global/US `https://mcp.contentful.com/mcp` or EU `https://mcp.eu.contentful.com/mcp`. Click **Add**. Complete the one-click OAuth sign-in and select the space/environment pair(s) in Contentful's configuration UI. Dema marks the integration as Active. > [!NOTE] > > Reference the **environment ID**, not an alias. Environment aliases are not supported and cause a `Forbidden` error. *** ## Troubleshooting > [accordion] The agent has nothing to work on > > You must select the space/environment in Contentful's configuration UI on each connection, and the MCP app must also be installed in that space + environment. Confirm both, then reconnect. > [accordion] Failed to fetch app installation: Forbidden > > Reference the environment ID directly — environment aliases are not supported. Replace the alias with the actual environment ID and reconnect. > [accordion] EU data residency > > If your org is EU-resident, use `https://mcp.eu.contentful.com/mcp` and sign in via `be.eu.contentful.com`. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [Contentful MCP server](https://www.contentful.com/developers/docs/tools/mcp-server/) * [App installation (App Framework)](https://www.contentful.com/developers/docs/extensibility/app-framework/app-installation/) * [EU data residency](https://www.contentful.com/help/faq/eu-data-residency/) # Contentsquare Source: https://docs.dema.ai/guides/agent/integrations/contentsquare Connect Contentsquare so the Dema Agent can analyze site metrics, funnels, customer journeys, page groups, and errors that affect your conversion rate. Connect Contentsquare to let your Dema agents analyze your site experience data: site metrics, funnels, customer journeys, page groups, and errors that hurt conversion. Use it to add on-site behavior to a Dema analysis, for example to explain a drop in conversion rate. *** ## Prerequisites * A Contentsquare account with access to the sites you want to analyze. * The MCP integration turned on in Contentsquare by a Customer Admin, with you on the list of users who can use it. *** ## Connect in Dema 1. Go to **Agents → Settings → Integrations** and click **Add integration**. 2. Find **Contentsquare** and click **Connect**. 3. Sign in to Contentsquare and approve access. You'll return to Dema with the connection ready to use. No API keys or OAuth app setup are needed. Dema requests the `metrics` scope, and each user signs in with their own Contentsquare account. The agent only sees the data that account can access. To use the connection with an agent you created, open that agent and add it under **Configuration → Integrations**. See [Your agents](/guides/agent/your-agents#integrations). *** ## Approvals Sending feedback to Contentsquare always asks for your approval first, because it shares text you or the agent wrote with Contentsquare. # Convert Source: https://docs.dema.ai/guides/agent/integrations/convert Let the Dema Agent read A/B test results and conversion goals from Convert.com, and create or control experiences when you ask. ## Overview Once Convert is connected, the Dema Agent can pull live experimentation data from your Convert.com account — accounts, projects, experiences, reports (overall and daily), change history, and conversion goals — directly inside a conversation. With account management access, it can also act for you: create, update, clone, and start or pause experiences, and deploy the winning variation. The agent only acts when you ask it to, and Dema asks you to confirm sensitive changes before they are applied. *** ## Prerequisites * A Convert.com account with permission to create **API keys** (Account Settings → API-keys). * The key must use **Request Signing** authentication (see below) — this is the only type Dema supports. > [!NOTE] > > Convert offers two API key types: **Request Signing** and **Secret Key**. Dema signs every request with HMAC, so you must create a **Request Signing** key. A Secret Key will not authenticate. *** ## Connect Convert **1. Create an API key in Convert** 1. In Convert, click your account name in the top-right corner and open **Account Settings**. 2. Go to the **API-keys** tab and click **New API key**. 3. Set **Key Name** to something recognizable such as `Dema Agent`. 4. Under **Select Project**, choose the projects the agent should work with (or **All Projects**). 5. Set **Access level** — pick **Account Manager** (account management access) if you want the agent to create or change experiences; a read-only level is enough for analysis only. 6. Under **Authentication Type**, select **Request Signing (Most Secure)**. ![Convert Create API Key dialog with Request Signing selected](https://mintcdn.com/demaai/-XkvN6fwLodkZ_XU/images/convert-create-api-key.png?fit=max\&auto=format\&n=-XkvN6fwLodkZ_XU\&q=85\&s=6fb74be4ae35c40d32cb0072f9bcfae2) **2. Copy the Key and Key Secret** Click **Create**. Convert shows the **Key** and **Key Secret** once — copy both now. You will not be able to retrieve the Key Secret again. ![Convert API key showing Key and Key Secret](https://mintcdn.com/demaai/-XkvN6fwLodkZ_XU/images/convert-api-key-secret.png?fit=max\&auto=format\&n=-XkvN6fwLodkZ_XU\&q=85\&s=05f985f6d2eb988b0266dc290ee39286) **3. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Convert**, and click **Connect**. Enter: * **Key** — the Key you copied from Convert. * **Key Secret** — the Key Secret you copied from Convert. Click **Add**. Dema marks the integration as Active. *** ## Rotating the key Convert API keys do not expire. To rotate, create a new Request Signing key in Convert, click **Reconnect** on the Convert integration card in Dema, and enter the new Key and Key Secret. Delete the old key in Convert once the new one is connected. *** ## Troubleshooting > [accordion] Dema cannot authenticate > > Check that the key is a **Request Signing** key, not a Secret Key — Dema only supports Request Signing. If you are unsure, create a new Request Signing key and reconnect. > [accordion] The agent cannot see a project or experience > > The key only covers the projects and access level you chose when you created it. Create a key scoped to the right projects (or **All Projects**) with **Account Manager** access, then reconnect. > [accordion] I lost the Key Secret > > Convert shows the Key Secret only once. Create a new Request Signing key in Convert and reconnect in Dema. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [Convert REST API v2 documentation](https://api.convert.com/doc/v2/) # Custom integration Source: https://docs.dema.ai/guides/agent/integrations/custom-integration Connect your own MCP server so the Dema Agent can use its tools. ## Overview A custom integration connects the Dema Agent to an MCP (Model Context Protocol) server that you host or subscribe to. Once it is connected, the tools that server exposes appear alongside the built-in integrations and the agent can use them in conversations and scheduled runs. Use a custom integration when the service you need is not in the [integrations list](/guides/agent/integrations/overview) and it already offers a remote MCP server. > [!WARNING] > > A custom integration gives the agent tools written by whoever runs that server, including the tool descriptions the agent reads. Only add servers you trust, and give the agent a token with the least access it needs. *** ## Prerequisites * A remote MCP server reachable on the public internet over HTTPS. Both Streamable HTTP and SSE are supported: a URL ending in `/sse` connects over SSE, anything else over Streamable HTTP. * Whatever the server needs to authenticate you: an access token, OAuth sign-in, or nothing at all. *** ## Add a custom integration 1. In Dema, go to **Agents → Settings → Integrations** (or, for an agent you created, **Configuration → Integrations**). 2. Click **Add integration**. **Custom Integration** sits at the top of the list, above the integrations enabled for your team. 3. Click **Connect** to open **Add custom integration**. 4. Fill in the form: | Field | Notes | | - | - | | **Name** | How the connection is labelled in Dema, for example `My App`. | | **Description** | Optional. A short reminder of what the server does. | | **MCP server URL** | The server's HTTPS endpoint, for example `https://your-server.example.com/mcp`. | | **Authentication** | **None**, **API Key**, or **OAuth**. See below. | 5. Tick **I understand custom integrations can introduce risks**. 6. Click **Add**. With **None** or **API Key** the connection is created immediately. With **OAuth** you are redirected to your server to sign in, and the connection becomes active when you land back in Dema. > [!TIP] > > You can add several custom integrations. Each server URL becomes its own connection, and its tools are listed under that connection's own name. *** ## Authentication options | Option | When to use it | What Dema stores | | - | - | - | | **None** | The server needs no credentials, or it authenticates by URL alone. | Nothing beyond the URL. | | **API Key** | The server accepts a long-lived token. Dema sends it as `Authorization: Bearer `. | The token, encrypted. | | **OAuth** | The server speaks OAuth, as most managed MCP servers do. Dema discovers the server's authorization endpoints and registers itself automatically. | The access and refresh tokens, encrypted. | For **OAuth**, leave **Client ID** and **Client secret** empty unless your server cannot register clients automatically and gave you credentials to use. A client secret requires a client ID. *** ## Tools and approvals Every tool from a custom integration **requires your approval before it runs**, whatever the server claims about the tool being read-only. When the agent wants to use one, it asks first and shows you the call. To change that for an agent you created, go to **Configuration → Tool permissions** and auto-approve the individual tools you are comfortable with. See [Your agents](/guides/agent/your-agents#tool-permissions). *** ## Manage a custom integration * **Edit** the name and description at any time from the integration card. * **Reconnect** to change the server URL or the authentication method. For an OAuth connection those fields are locked while editing, because the token your server issued is bound to that server — use **Reconnect** instead. * **Disconnect** removes the connection and its stored credentials from Dema. Also revoke the token or OAuth client at your server if it should stop working entirely. *** ## Troubleshooting > [accordion] Dema says the MCP server URL is not allowed > > The URL must be HTTPS and its host must resolve to a public address. A > server on your own network, behind a VPN, or on `localhost` cannot be > reached by the agent — publish it, or put it behind a public HTTPS > endpoint. > [accordion] Dema says the server is already available as a built-in integration > > Connect that integration from the integrations list instead. Ask an admin to > enable it for your organisation if it is not available to you yet. > [accordion] The agent does not see any tools from my server > > Dema lists the server's tools when the agent runs. If the server is > unreachable, rejects the credentials, or returns no tools, that integration > is skipped for the rest of the conversation and the agent reports the error > when it tries to use one of its tools. Check the connection status on the > integration card, then reconnect with a fresh credential. > [accordion] Reconnecting an OAuth connection asks for a client secret > > That happens when you supplied client credentials yourself. Enter the client > secret again, or clear the **Client ID** so Dema registers a new client with > your server. If you are still stuck, contact [support](mailto:info@dema.ai) with the server URL and the error message you see. # Depict.ai Source: https://docs.dema.ai/guides/agent/integrations/depict Let the Dema Agent read your Depict.ai catalog, search results, and recommendations when you ask. ## Overview Once Depict.ai is connected, the Dema Agent can work with your Depict data directly inside a conversation — search your products, browse your listings (collection and category pages) and the products ranked inside them, look up product cards with images, prices and variants, see search query suggestions, and pull recommendations such as cross-sell and products related to a search query. It can also list the markets and locales configured for your Depict store. All access is **read-only** — the agent never changes anything in your Depict account. The agent only acts when you ask it to. > [!NOTE] > > Depict's API offers read access only. The agent can read and analyse your Depict data, but it cannot edit merchandising rules, listings, or any other configuration in Depict. That is a limitation on Depict's side. *** ## Prerequisites * A Depict account with access to **Settings → General** in the Depict portal, where the API key lives — you may need an admin on your Depict account to open this page. * Your Depict **merchant identifier** — the store id Depict uses for your account. You will give this to the agent when you ask it something (see [Ask the agent for Depict data](#ask-the-agent-for-depict-data)). *** ## Connect Depict.ai **1. Copy the API key in Depict** 1. In the Depict portal, go to **Settings**. 2. Open **General**. 3. Copy the API key. **2. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Depict.ai**, and click **Connect**. Enter: * **API Key** — the key you copied from Depict. Click **Add**. Dema marks the integration as Active. To use Depict with an agent you created rather than the built-in assistant, open that agent and go to **Configuration → Integrations**. The API key is the only credential Dema stores — there is no client secret and no account URL to enter. *** ## Ask the agent for Depict data Depict serves several stores, markets and languages from the same API key, so the agent needs to know which store you mean. Name your Depict merchant identifier the first time you ask it something in a conversation: ``` Using our Depict store , list our collection pages and show the top 10 products in the largest one. ``` From there the agent looks up the markets and locales configured for that store itself, and reuses the merchant identifier for the rest of the conversation. > [!TIP] > > Save the merchant identifier to your agent's memory or include it in a scheduled prompt, so you do not have to repeat it every time. *** ## Rotating the key To rotate the key, generate a new API key in Depict under **Settings → General**, then click **Reconnect** on the Depict.ai integration card in Dema and enter the new key. *** ## Troubleshooting > [accordion] Dema cannot authenticate > > Check that you copied the full API key from **Settings → General** in the Depict portal, with no leading or trailing spaces. If the key has been regenerated in Depict since you connected, click **Reconnect** in Dema and enter the current key. > [accordion] I cannot find the API key in Depict > > The **Settings → General** page may be restricted on your account. Ask an admin on your Depict account to copy the key for you, or to grant you access. > [accordion] The agent says it needs a merchant, market, or locale > > Tell it your Depict merchant identifier — the store id Depict uses for your account. It cannot be discovered from the API key alone. Once the agent has it, it can find your markets and locales on its own. > [accordion] The agent returns no products for a listing or search > > Confirm that the market and locale it used are ones your store actually serves — ask it which markets and locales your Depict store has configured, then repeat the question naming the right one. > [accordion] I asked the agent to change something in Depict and it could not > > That is expected. Depict's API is read-only for integrations, so the agent can report on your Depict data but cannot change anything in Depict. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [Depict.ai documentation](https://docs.depict.ai) * [Integrations overview](/guides/agent/integrations/overview) # Fortnox Source: https://docs.dema.ai/guides/agent/integrations/fortnox Let the Dema Agent read customers, invoices, sales orders, articles, supplier invoices, accounts, balances, and vouchers from Fortnox accounting. ## Overview Once Fortnox is connected, the Dema Agent can look up records from your Fortnox accounting environment through the Fortnox API v3. Use it to answer questions about who your customers are, which invoices are unpaid, what an order contained, how a supplier invoice was booked, or what moved an account balance in a given month, without opening Fortnox. The agent only reads from Fortnox. It does not create or modify records. ### What the agent can do * **Customers** — list customers with filters for name, city, and active or inactive status, and load one customer's full record (addresses, contact details, payment terms, VAT type, currency). * **Customer invoices** — list invoices, filter by customer, date range, and status (`cancelled`, `fullypaid`, `unpaid`, `unpaidoverdue`, `unbooked`), and load one invoice with its line items for revenue analysis. * **Sales orders** — list orders with the same filter shape as invoices and load one order with its line items. * **Articles** — list the articles (products and services) in your Fortnox catalog. * **Supplier invoices** — list supplier invoices with date and status filters to review accounts payable. * **Financial years** — list the company's financial years, or find the year that contains a given date. The account, balance, and voucher tools use the current financial year unless you ask about another one. * **Chart of accounts** — list the general ledger accounts for a financial year with their opening balances, and load one account by its four-digit number with its opening and closing balance. * **Account balances** — load the opening balance, closing balance, result, and month-by-month movement for every account with activity in a financial year. Optionally break each account down by cost center or project. Fortnox provides this data through its SIE export. * **Account transactions** — list every entry posted to one account, optionally limited to a date range within the financial year. Use it to see the individual entries behind a balance or profit and loss figure. * **Vouchers** — list vouchers (journal entries) for a financial year, filtered by date range and voucher series, and load one voucher with its debit and credit rows. The account, balance, transaction, and voucher tools need the `bookkeeping` scope. See [Scopes Dema requests](#scopes-dema-requests). *** ## Prerequisites * A Fortnox account with access to the company data the agent should use. * A Fortnox administrator to approve Dema on the first connection from your account. *** ## Connect Fortnox **1. Open the integration** In Dema, go to **Agents → Settings → Integrations**, find **Fortnox**, and click **Connect**. **2. Sign in and approve** You are redirected to `apps.fortnox.se` to sign in to Fortnox and approve the scopes Dema requests. The first connection from your Fortnox account may need a Fortnox administrator to approve access. > [!TIP] > > You are returned to Dema with the integration marked as Active. **3. Check the connection** Ask the agent a read-only question, for example: *"Which invoices are unpaid and overdue?"* or *"How did the balance on account 1930 change month by month this year?"* To use the connection with an agent you created, open that agent and add it under **Configuration → Integrations**. See [Your agents](/guides/agent/your-agents#integrations). *** ## Scopes Dema requests | Scope | What it allows | | - | - | | `customer` | Read customer records | | `invoice` | Read customer invoices and their line items | | `order` | Read sales orders and their line items | | `article` | Read the article (product and service) catalog | | `supplierinvoice` | Read supplier invoices | | `bookkeeping` | Read financial years, accounts, balances, and vouchers (optional) | Fortnox grants read and write on each of these resources. The agent uses them for read operations only. The `bookkeeping` scope is optional. Connections made before Dema requested it keep working for customers, invoices, orders, articles, and supplier invoices. To let the agent read financial years, accounts, balances, transactions, and vouchers, click **Reconnect** on the Fortnox integration card and approve the `bookkeeping` scope in Fortnox. *** ## Troubleshooting > [accordion] Fortnox says administrator approval is required > > A Fortnox administrator must approve Dema for your Fortnox account. After approval, return to Dema and reconnect. > [accordion] Dema says my connection has expired > > This happens when Dema cannot refresh the access token, usually because access was revoked in Fortnox. Click **Reconnect** on the integration card to re-authorize. > [accordion] The agent cannot find a record > > Fortnox references records by their exact identifier. Ask for a customer by its Fortnox customer number, or an invoice or order by its numeric Fortnox document number. Accounts use their four-digit account number, and vouchers use their series and number, for example `A15`. Voucher numbers restart each financial year, so mention the year when the voucher is not from the current one. > [accordion] The agent cannot read accounts, balances, or vouchers > > Your connection was approved without the `bookkeeping` scope. Click **Reconnect** on the Fortnox integration card and approve the `bookkeeping` scope in Fortnox. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [Fortnox Developer Portal](https://developer.fortnox.se/) * [Fortnox API v3 reference](https://developer.fortnox.se/documentation/) # Gmail Source: https://docs.dema.ai/guides/agent/integrations/gmail Let the Dema Agent send emails on your behalf via the Gmail API. ## Overview Once Gmail is connected, the Dema Agent can send emails from your Gmail account. Useful for sharing Dema findings with stakeholders or sending automated updates from a conversation. > [!NOTE] > > The Gmail integration is send-only. Dema does not read your inbox or any > existing messages. *** ## Prerequisites * A Google Workspace or personal Google account. * If you are on Google Workspace, your admin may need to approve third-party apps before you can connect. *** ## Connect Gmail 1. In Dema, go to **Agents → Settings → Integrations**. 2. Find **Gmail** and click **Connect**. 3. Sign in to Google and approve the scopes Dema requests. 4. You are returned to Dema with the integration marked as Active. *** ## Scopes Dema requests | Scope | What it allows | | - | - | | `https://www.googleapis.com/auth/gmail.send` | Send messages on your behalf. Does not grant access to read, search, modify, or delete existing mail. | *** ## Troubleshooting * **Admin approval required.** If your Google Workspace blocks the Dema Agent during sign-in, ask your Workspace admin to approve the app for your organization. * **Send fails with "insufficient permissions".** Disconnect and reconnect the integration to re-approve the `gmail.send` scope. *** ## Additional resources * [Google Workspace app access control](https://support.google.com/a/answer/7281227) * [Gmail API: send scope](https://developers.google.com/gmail/api/auth/scopes) # Google Ads Source: https://docs.dema.ai/guides/agent/integrations/google-ads Let the Dema Agent query campaign performance, research keywords with Keyword Planner, and manage campaign and ad group settings in Google Ads. ## Overview Once Google Ads is connected, the Dema Agent can query campaign, ad group, keyword, and ad performance, and manage campaign and ad group status and budgets. The Dema Agent can also use Google Ads Keyword Planner to get historical search volume and competition for keywords, suggest keyword ideas from seed keywords, a URL, or a site, and forecast keyword performance for a given budget or bid strategy. Forecasts are Google's model estimates, not measured results. Useful for diagnosing spend performance and applying Dema recommendations without leaving a conversation. *** ## Prerequisites * A Google Ads account or manager (MCC) account with permission to access the campaigns you want Dema to see. *** ## Connect Google Ads 1. In Dema, go to **Agents → Settings → Integrations**. 2. Find **Google Ads** and click **Connect**. 3. Sign in to Google and approve the scopes Dema requests. 4. You are returned to Dema with the integration marked as Active. *** ## Scopes Dema requests | Scope | What it allows | | - | - | | `https://www.googleapis.com/auth/adwords` | Read performance data, use Keyword Planner, and update campaign and ad group settings in accounts you can already access | *** ## Troubleshooting * **Account not visible.** If you manage multiple Google Ads accounts, make sure you signed in with the Google account that has access to the target account and that it is linked to the correct manager account. *** ## Additional resources * [Google Ads Help Center](https://support.google.com/google-ads) # Google Analytics Source: https://docs.dema.ai/guides/agent/integrations/google-analytics Let the Dema Agent read GA4 traffic, revenue, and channel performance from Google Analytics when you ask. ## Overview Once Google Analytics is connected, the Dema Agent can read GA4 analytics directly inside a conversation — pull KPIs such as sessions, active users, transactions, revenue, and conversions broken down by date, channel, country, or device; analyze source/medium attribution; monitor a launch or flash sale in near real time; discover custom dimensions and metrics; and look up which properties an account can access and their configuration. The agent only acts when you ask it to. *** ## Prerequisites * A GA4 property (Universal Analytics properties are not supported). * Administrator access on the GA4 account or property so you can grant the connecting account access. * Best practice: a dedicated Google "agent" account rather than a personal login. *** ## Connect Google Analytics **1. Grant the agent account Viewer access in Google Analytics** 1. In Google Analytics (analytics.google.com) click the **Admin** gear. 2. Select the correct **Account** and **Property**. 3. In the **Property** column click **Access Management**. 4. Click **+** then **Add users**. 5. Enter the connecting Google account email. 6. Choose the **Viewer** role (read-only) and click **Add**. Optional: **Property details** shows the numeric **Property ID** — note that this is *not* the `G-` Measurement ID. > [!TIP] > > Use a dedicated agent account and grant only **Viewer** at the property level. This keeps access scoped to the least privilege the agent needs. > [!NOTE] > > The connecting account must already have **Viewer** on the property *before* you connect, or the property will not appear in Dema. **2. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Google Analytics**, and click **Connect**. There are no fields to enter — Dema redirects you to Google sign-in. Sign in with the account you granted access to, approve the read-only `analytics.readonly` access, and pick the GA4 property. Dema marks the integration as Active. *** ## Troubleshooting > [accordion] My property does not appear > > The connecting account needs at least **Viewer** on that property. Grant it in **Access Management**, then reconnect. > [accordion] Wrong property or no data > > Make sure you selected a **GA4** property (not Universal Analytics) and the correct numeric **Property ID**. > [accordion] Connection expired > > Reconnect from the integration card to re-authorize. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [Add, edit, and delete users and user groups](https://support.google.com/analytics/answer/9305788) * [Manage users in a property or account](https://support.google.com/analytics/answer/9305587) * [Find your GA4 Property ID](https://developers.google.com/analytics/devguides/reporting/data/v1/property-id) # Google Merchant Center Source: https://docs.dema.ai/guides/agent/integrations/google-merchant-center Let the Dema Agent read product listings, disapproval issues, pricing and competitor insights, and Shopping performance from Google Merchant Center when you ask. ## Overview Once Google Merchant Center is connected, the Dema Agent can inspect your catalogue directly inside a conversation — read product listings across one or more Merchant Center accounts (including aggregator/MCA sub-accounts), showing title, brand, price, and availability; roll up disapproval issue counts to quantify catalogue health and prioritise what to fix first; and list which accounts and sub-accounts the connection can reach. The agent can also read Merchant Center's reports: | Ask about | What the agent can see | | - | - | | Price benchmarks | How your prices compare with what competitors charge for the same products, per country. | | Suggested prices | Google's suggested sale prices and the predicted effect on impressions, clicks, and conversions. | | Competitor visibility | Which businesses appear alongside you on Google Shopping, how your visibility compares, and how much of it comes from ads versus organic listings. | | Best sellers | The most popular products and brands in your categories and countries, and how their ranking is changing. | | Shopping performance | Impressions, clicks, and conversions per product, from Shopping ads and free listings. | The agent only acts when you ask it to. *** ## Prerequisites * A Google Merchant Center account, with Admin access so you can add the connecting account. * The numeric merchant ID of the account (or sub-account) you want the agent to read. * Best practice: a dedicated Google "agent" account. *** ## Connect Google Merchant Center **1. Grant the agent account access in Merchant Center** 1. Sign in to Merchant Center (merchants.google.com) as an Admin. 2. Open **Settings** and select **Access and services**. 3. On the **People and access** tab, click **Add person**. 4. Enter the connecting Google account email. 5. Choose **Admin** access (Standard users cannot view reports) and save. 6. Have that account accept the invitation. 7. Copy the numeric merchant ID (top-right next to the account name; for an MCA, use the specific sub-account ID). > [!TIP] > > For a multi-client (MCA) account, connect the specific sub-account merchant ID for the data you want, not the parent MCA ID. **2. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Google Merchant Center**, and click **Connect**. Sign in with the granted account, approve the access, and enter: * **Merchant ID** — the numeric merchant ID you copied. Click **Add**. Dema marks the integration as Active. *** ## Troubleshooting > [accordion] The agent cannot see my products > > Confirm the connecting account has Admin access and you entered the correct merchant ID, then reconnect. > [accordion] I have an MCA / aggregator account > > Use the sub-account merchant ID shown when you open that sub-account, not the parent ID. > [accordion] Pricing or competitor data comes back empty > > Price benchmarks, suggested prices, competitor visibility, and best sellers come from Google's market insights, which Google only provides to eligible Merchant Center accounts. If the account is not eligible, the agent gets no data for them. Price benchmarks also need a valid GTIN on each product, and suggested prices need purchase conversions reported to Google. > [accordion] Connection expired > > Reconnect from the integration card. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [Add users and set access levels](https://support.google.com/merchants/answer/12160472) * [Find your Merchant Center ID](https://support.google.com/merchants/answer/188924) * [Price competitiveness report](https://support.google.com/merchants/answer/9626903) * [Price insights](https://support.google.com/merchants/answer/11916926) * [Competitive visibility report](https://support.google.com/merchants/answer/11366442) * [Best sellers report](https://support.google.com/merchants/answer/9488679) # Google Search Console Source: https://docs.dema.ai/guides/agent/integrations/google-search-console Let the Dema Agent query search analytics and URL indexing status from Google Search Console. ## Overview Once Google Search Console is connected, the Dema Agent can query search analytics, list your verified sites, and inspect URL indexing status. Useful for understanding organic search performance alongside paid and direct channels. *** ## Prerequisites * A Google account that owns or has access to one or more verified Search Console properties. *** ## Connect Google Search Console 1. In Dema, go to **Agents → Settings → Integrations**. 2. Find **Google Search Console** and click **Connect**. 3. Sign in to Google and approve the scopes Dema requests. 4. You are returned to Dema with the integration marked as Active. *** ## Scopes Dema requests | Scope | What it allows | | - | - | | `https://www.googleapis.com/auth/webmasters.readonly` | Read search analytics, site lists, and URL inspection results | *** ## Troubleshooting * **No sites visible.** The agent only sees properties your Google account is a verified owner or delegate of. Verify the site in Search Console and reconnect if needed. *** ## Additional resources * [Search Console Help](https://support.google.com/webmasters) # Google Sheets Source: https://docs.dema.ai/guides/agent/integrations/google-sheets Let the Dema Agent read, write, and manage spreadsheet data in Google Sheets. ## Overview Once Google Sheets is connected, the Dema Agent can read data from your spreadsheets, write new rows, and manage sheet structure. Useful for pulling manual inputs into an analysis or exporting Dema results back into an existing reporting workbook. *** ## Prerequisites * A Google Workspace or personal Google account with access to the spreadsheets you want Dema to use. *** ## Connect Google Sheets 1. In Dema, go to **Agents → Settings → Integrations**. 2. Find **Google Sheets** and click **Connect**. 3. Sign in to Google and approve the scopes Dema requests. 4. You are returned to Dema with the integration marked as Active. *** ## Scopes Dema requests | Scope | What it allows | | - | - | | `https://www.googleapis.com/auth/spreadsheets` | Read and write data in Google Sheets you have access to | *** ## Troubleshooting * **Admin approval required.** If your Google Workspace blocks the Dema Agent during sign-in, ask your Workspace admin to approve the app for your organization. *** ## Additional resources * [Google Sheets API overview](https://developers.google.com/sheets/api) # Gorgias Source: https://docs.dema.ai/guides/agent/integrations/gorgias Let the Dema Agent search and triage support tickets, pull customer history, run helpdesk reporting, and add internal notes in Gorgias when you ask. ## Overview Once Gorgias is connected, the Dema Agent can work with your helpdesk directly inside a conversation — search and triage support tickets by status, tag, or customer and summarize conversations; pull a customer's support history for context before outreach; run ad-hoc helpdesk reporting (ticket volume, response and resolution stats, CSAT and satisfaction trends); audit tags, macros, and rules; and add internal notes. Read and write. The agent only acts when you ask it to, and Dema asks you to confirm sensitive changes before they are applied. > [!NOTE] > > The agent can do whatever the authorizing Gorgias user can do — permissions are role-bound. Connect with an appropriately-privileged user so the agent has the access it needs and nothing more. *** ## Prerequisites * A Gorgias Helpdesk account (the MCP connector is available on all Helpdesk plans, open beta). * Your Gorgias subdomain — the "your-brand" part of `your-brand.gorgias.com`. * On Team/Enterprise plans, the Gorgias Owner must add the connector at the organization level first. *** ## Connect Gorgias **1. Find your Gorgias subdomain** Log in to Gorgias in a browser. Your subdomain is the "your-brand" portion of `your-brand.gorgias.com` shown in the address bar. **2. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Gorgias**, and click **Connect**. Enter: * **Subdomain** — the "your-brand" part of `your-brand.gorgias.com`. You are redirected to the Gorgias OAuth screen — click **Continue**, then **Allow Access**, then **Authorize**. No API key is created. Dema marks the integration as Active. > [!NOTE] > > The MCP connector is in **open beta**. Reads are fully live; some write actions are still rolling out. *** ## Troubleshooting > [accordion] Dema cannot connect > > Double-check the subdomain is the "your-brand" part of `your-brand.gorgias.com` — not your Help Center domain. > [accordion] Members cannot complete the connection > > On Team/Enterprise plans, the Gorgias Owner must add the connector at the organization level first. Ask your Owner to enable it, then try again. > [accordion] The agent cannot do something > > The agent's permissions mirror the role of the user who authorized it. Reconnect with a more privileged user if the agent needs broader access. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [Connect your AI assistant to the Gorgias MCP](https://docs.gorgias.com/en-US/connect-your-ai-assistant-to-the-gorgias-mcp-6310546) # Ingrid Source: https://docs.dema.ai/guides/agent/integrations/ingrid Let the Dema Agent read orders, returns, and refunds, report returned items, and mark refunds as externally refunded in Ingrid when you ask. ## Overview Once Ingrid is connected, the Dema Agent can work with your Ingrid returns data directly inside a conversation — retrieve orders, returns, and refund transactions, report returned items, and mark refunds as externally refunded — via the Ingrid Returns Public API. The agent only acts when you ask it to, and Dema asks you to confirm sensitive changes before they are applied. *** ## Prerequisites * An Ingrid Returns account with access to the **Returns backoffice** (the Merchant Returns Platform). * A **production** Returns API key. > [!NOTE] > > Ingrid has more than one kind of API key. Dema needs the **Returns API key** created in the Returns backoffice — not the key in the main Ingrid Merchant Platform (that one is for Checkout, Tracking, and Transport Automation). > > To let the agent look up delivery tracking as well, connect [Ingrid Tracking](/guides/agent/integrations/ingrid-tracking) — a separate integration with its own credential. *** ## Connect Ingrid **1. Create an API key in the Returns backoffice** 1. Sign in to the Returns backoffice at [returns-portal.ingrid.com](https://returns-portal.ingrid.com). 2. Go to **Settings → API Keys** ([returns-portal.ingrid.com/settings/api-keys](https://returns-portal.ingrid.com/settings/api-keys)). 3. Generate a key and copy it. Use your **production** key — Dema connects to Ingrid's production environment. > [!NOTE] > > Keys differ between stage and production. If you do not have access to the Returns backoffice, contact [support@ingrid.com](mailto:support@ingrid.com). **2. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Ingrid**, and click **Connect**. Enter: * **API key** — the production Returns API key you copied. Click **Add**. Dema marks the integration as Active. *** ## Rotating the key To rotate, generate a new key under **Settings → API Keys** in the Returns backoffice, click **Reconnect** on the Ingrid integration card in Dema, and enter the new key. *** ## Troubleshooting > [accordion] Dema cannot authenticate > > Make sure you used the **production Returns API key** from the Returns backoffice (`returns-portal.ingrid.com/settings/api-keys`), not a stage key and not a key from the main Ingrid Merchant Platform. > [accordion] I cannot find the API Keys page > > You need access to the Returns backoffice. If you cannot reach **Settings → API Keys**, contact [support@ingrid.com](mailto:support@ingrid.com). > [accordion] Ingrid's docs show turnr.se URLs > > `turnr.se` is Ingrid's legacy domain — Ingrid acquired Turnr and migrated the Returns service to `ingrid.com`. It is the same service; you do not need to do anything. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [Ingrid Returns Public API](https://developer.ingrid.com/returns/api/) * [Ingrid API keys (support)](https://support.ingrid.com/your-api-keys) # Ingrid Tracking Source: https://docs.dema.ai/guides/agent/integrations/ingrid-tracking Let the Dema Agent look up delivery tracking for an order — carrier, current status, progress history, delivery estimates, and tracking page links — from Ingrid when you ask. ## Overview Once Ingrid Tracking is connected, the Dema Agent can look up where a delivery is directly inside a conversation — the carrier, the current delivery step and its full progress history, the estimated delivery time, any alerts or exceptions Ingrid has raised, and a customer-facing tracking page link. Ingrid Tracking is read-only: the agent looks data up, it does not change anything in Ingrid. > [!NOTE] > > This is a **separate integration from Ingrid (Returns)**. Ingrid runs Returns and Delivery Tracking as two different APIs with different credentials, so if you use both, connect Ingrid twice — once on the **Ingrid** card with your Returns API key, and once on the **Ingrid Tracking** card with the values below. Your Returns API key does not work for tracking. The agent only acts when you ask it to. *** ## Prerequisites * **Ingrid's Tracking product enabled on your Ingrid agreement.** If you only use Ingrid Returns, there is no tracking data to read. * **A production Delivery Tracking API token** for your Ingrid account. * **Your Ingrid site ID** — the identifier of the site whose deliveries the agent should look up. It is the same `siteId` used when Ingrid's tracking widget is installed on your site. > [!NOTE] > > Ingrid's API tokens are specific to one environment. Dema connects to Ingrid's **production** environment, so a test or stage token will not work. If you cannot find a Delivery Tracking token or your site ID in the Ingrid platform, ask your Ingrid contact or [support@ingrid.com](mailto:support@ingrid.com) — Ingrid may need to issue the tracking token for you. *** ## Connect Ingrid Tracking **1. Collect your site ID and tracking token from Ingrid** You need two values from Ingrid: | Value | What it is | | - | - | | **Site ID** | Identifies the site (storefront) the agent looks up deliveries for | | **Delivery Tracking API token** | The production API token for Ingrid's Delivery Tracking API | **2. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Ingrid Tracking**, and click **Connect**. In the **siteId:token** field, paste your site ID and tracking token joined by a colon, with no spaces: ```text theme={null} siteId:trackingApiToken ``` Click **Add**. Dema marks the integration as Active. > [!NOTE] > > There is a single field — combine both values into one string separated by a colon. **3. Check it works** Ask the agent about a recent order, for example: *"Where is order 100542, and has it been delivered?"* If it comes back with the carrier and the delivery steps, the connection works. > [!NOTE] > > If you have several Ingrid sites, connect the one you ask about most. You can name another site in a question when you need to, and the agent will look it up there. *** ## What you can ask for > [accordion] Track a specific order or parcel > > | Ask the agent to | For example | > | - | - | > | Find an order's parcels and status | *"Where is order 100542?"* | > | Look up a tracking number | *"What has happened to tracking number 1Z999AA10123456784?"* | > | Explain a delay | *"Order 100542 hasn't arrived — which step is it stuck on and what does the carrier say?"* | > | Check a customer's deliveries | *"Show me the deliveries for [customer@example.com](mailto:customer@example.com)."* | > [accordion] Share a tracking page > > | Ask the agent to | For example | > | - | - | > | Generate a tracking page link | *"Give me the tracking page link for order 100542."* | > | Localize the page | *"Send me that tracking link in Swedish."* | > [accordion] Use tracking alongside your Dema data > > | Ask the agent to | For example | > | - | - | > | Combine an order with its delivery | *"Summarize order 100542 — what was bought, and where is the parcel now?"* | > | Draft a customer reply | *"Write a reply to this customer explaining where their parcel is and when it should arrive."* | > [!NOTE] > > Ingrid's Delivery Tracking API answers **one order, tracking number, or customer at a time** — it cannot list deliveries for a date range. So the agent can answer *"where is this order and is it late"*, but not *"what share of deliveries missed the promised date last month"*. Delivery statistics over a period need the tracking data loaded into Dema as a data source instead; talk to us if that is what you are after. > [!NOTE] > > The estimated delivery time the agent reports is Ingrid's **current** estimate, and it is revised as carriers report progress. It is not the delivery promise the customer saw at checkout. *** ## Rotating the token Get a new Delivery Tracking token from Ingrid, then click **Reconnect** on the Ingrid Tracking integration card in Dema and enter the new `siteId:token` string. *** ## Troubleshooting > [accordion] Dema says the credential format is wrong > > The **siteId:token** field must contain your site ID and your tracking token joined by a single colon, with no spaces, and both halves present — for example `my-site-id:eyJhbGciOi...`. > [accordion] Dema cannot authenticate > > Check that it is a **Delivery Tracking** token for Ingrid's **production** environment. The Returns API key from the Returns backoffice does not work here, and neither does a stage token. > [accordion] The agent finds no parcels for an order that exists > > Two common causes: the order belongs to a different Ingrid site than the one you connected — name that site in your question — or Ingrid has no tracking data for it, which happens for orders placed before Tracking was enabled. > [accordion] I asked for delivery statistics and the agent looked orders up one by one > > That is the API's limit, not the agent's. Ingrid's tracking API only answers point lookups, so period-level delivery performance is not something the integration can report. Contact us about loading tracking data into Dema instead. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [Ingrid (Returns) integration](/guides/agent/integrations/ingrid) * [Ingrid Delivery Tracking documentation](https://developer.ingrid.com/delivery_tracking/) * [Ingrid API tokens and environments](https://developer.ingrid.com/introduction/) * [Ingrid support](mailto:support@ingrid.com) # Intelligems Source: https://docs.dema.ai/guides/agent/integrations/intelligems Let the Dema Agent read A/B test results, experiences, analytics, and audience data from Intelligems when you ask. ## Overview Once Intelligems is connected, the Dema Agent can pull live experimentation data from your account — directly inside a conversation. It can read results for a running price or content test and see which variant wins on profit-per-visitor, list active experiments and experiences, analyze sitewide conversion and revenue analytics, inspect audience segments, and browse the connected Shopify catalog to find test candidates. The agent only acts when you ask it to. *** ## Prerequisites * An active Intelligems account on a connected Shopify store (install the Intelligems app from the Shopify App Store; a 14-day trial is available on the Core plan). *** ## Connect Intelligems **1. Confirm your Intelligems account** Intelligems must be installed on your Shopify store (script/theme connected) and the account activated. **2. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Intelligems**, and click **Connect**. You are redirected to the Intelligems sign-in — log in and select your organization. No fields are entered. Once you authorize access, you are returned to Dema and the integration is marked as Active. > [!NOTE] > > The organization you pick is used for authentication only. The token spans every organization your account can access. > [!TIP] > > If you belong to multiple organizations, ask the agent to target a specific one — the connection can reach every organization your account can access. *** ## Troubleshooting > [accordion] The agent says there is no data to read > > Confirm Intelligems is installed on a Shopify store and the account is active. Without a connected store there is nothing to authenticate against. > [accordion] I cannot see an organization > > Verify your Intelligems account has access to that organization, then reconnect. > [accordion] Dema says my connection has expired > > Click **Reconnect** on the Intelligems integration card to re-authorize. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [Intelligems](https://intelligems.io/) * [Intelligems documentation](https://docs.intelligems.io/) # Intercom Source: https://docs.dema.ai/guides/agent/integrations/intercom Let the Dema Agent search Intercom conversations and access contact and company data. ## Overview Once Intercom is connected, the Dema Agent can search conversations, look up contacts, and read company data from your Intercom workspace. Useful for bringing support context into a Dema analysis. *** ## Prerequisites * An Intercom workspace with permission to install apps. *** ## Connect Intercom 1. In Dema, go to **Agents → Settings → Integrations**. 2. Find **Intercom** and click **Connect**. 3. Sign in to Intercom and approve the scopes Dema requests. 4. You are returned to Dema with the integration marked as Active. *** ## Scopes Dema requests | Scope | What it allows | | - | - | | Read and list users and companies | Look up contacts and their associated companies | | Read conversations | Search and read support conversations | *** ## Troubleshooting * **Conversations missing.** Dema only sees conversations visible to the workspace role you authorized with. Make sure the authorizing user has access to the inboxes or teams you need. *** ## Additional resources * [Intercom app authorization](https://developers.intercom.com/docs/build-an-integration/learn-more/authentication) # Klaviyo Source: https://docs.dema.ai/guides/agent/integrations/klaviyo Let the Dema Agent analyze campaigns and flows, manage profiles and segments, and draft email campaigns in Klaviyo. ## Overview Once Klaviyo is connected, the Dema Agent can read campaign and flow performance, look up profiles, manage lists and segments, and draft email campaigns from templates. Useful for diagnosing campaign performance and pushing Dema findings into Klaviyo audiences. *** ## Prerequisites * A Klaviyo account with permission to install apps. *** ## Connect Klaviyo 1. In Dema, go to **Agents → Settings → Integrations**. 2. Find **Klaviyo** and click **Connect**. 3. Sign in to Klaviyo and approve the scopes Dema requests. 4. You are returned to Dema with the integration marked as Active. *** ## Scopes Dema requests | Scope | What it allows | | - | - | | `accounts:read` | Read account metadata | | `campaigns:read`, `campaigns:write` | View and draft email campaigns | | `catalogs:read` | Read product catalogs | | `events:read` | Read customer events | | `flows:read` | View automated flows | | `images:write` | Upload images used by campaigns | | `lists:read` | View lists | | `metrics:read` | Read metric performance | | `profiles:read`, `profiles:write` | View and update customer profiles | | `segments:read`, `segments:write` | View and manage segments | | `subscriptions:read`, `subscriptions:write` | View and manage subscription status | | `tags:read` | Read tags | | `templates:read`, `templates:write` | View and update email templates | *** ## Troubleshooting * **Agent cannot see a campaign.** Make sure the campaign belongs to the Klaviyo account you used during the approval step. Dema only sees the account you authorized. *** ## Additional resources * [Klaviyo API scopes](https://developers.klaviyo.com/en/docs/authenticate_#api-scopes) # Meta Ads Source: https://docs.dema.ai/guides/agent/integrations/meta-ads Let the Dema Agent read ad performance and manage campaigns across Facebook and Instagram. Coming Soon ## Overview Once Meta Ads is connected, the Dema Agent will be able to read ad performance, inspect campaign structures, and manage campaigns across Facebook and Instagram. Useful for diagnosing paid social performance and applying adjustments without leaving a conversation. The Dema Agent can create campaigns, ad sets, and ads, update them, and upload images to your ad account, including files from the conversation. Everything the agent creates starts paused. Setting an item to active or deleting it always requires your explicit approval, even if you chose **Always approve** for the tool. The `pages_show_list` permission is optional. Existing connections keep working without it, and you only need to reconnect if you want the agent to look up the Pages linked to an ad account. *** ## Prerequisites * A Meta Business account with access to the ad accounts you want Dema to use. * Permission to approve third-party apps on the Meta Business Manager. *** ## Connect Meta Ads 1. In Dema, go to **Agents → Settings → Integrations**. 2. Find **Meta Ads** and click **Connect**. 3. Sign in to Facebook and approve the scopes Dema requests. 4. Choose which ad accounts and pages Dema can access. 5. You are returned to Dema with the integration marked as Active. *** ## Scopes Dema requests | Scope | What it allows | | - | - | | `ads_read` | Read ad account performance and structure | | `ads_management` | Create and update campaigns, ad sets, and ads | | `pages_read_engagement` | Read engagement data on linked pages | | `pages_show_list` | List pages your account has access to | *** ## Troubleshooting * **Ad account missing.** Meta asks you to pick which ad accounts and pages to share with the Dema Agent during the approval step. If an account is missing, reconnect and select it in the approval screen. *** ## Additional resources * [Meta Business Help Center](https://www.facebook.com/business/help) # Microsoft Outlook (MCP) Source: https://docs.dema.ai/guides/agent/integrations/microsoft-outlook Let the Dema Agent read, search, send, and manage Outlook mail through Microsoft's hosted Mail MCP server. ## Overview Once Microsoft Outlook (MCP) is connected, the Dema Agent can read your mail and send mail on your behalf without you leaving the conversation. The agent acts only when you ask it to, and Dema asks you to confirm sensitive changes first. It signs in as whoever authorized the connection, so it sees only that person's mailbox. > [!NOTE] > > The Microsoft Agent 365 integrations are in **preview**, and so are the Work IQ MCP servers behind them. Tools can change without notice. Your workspace might need preview integrations enabled before these show up. > [!TIP] > > Don't have Microsoft 365 Copilot licences or Agent 365 set up? The [Microsoft Outlook](/guides/agent/integrations/outlook) integration connects any Microsoft 365 work mailbox through Microsoft Graph, with no tenant setup or MCP URL. > [!TIP] > > This integration covers **mail** only. Outlook Calendar runs on a separate Microsoft MCP server. *** ## What you can ask for > [accordion] Find and read mail > > | Ask the agent to | For example | > | - | - | > | Search your mailbox | *"Find emails from Acme about the Q3 invoice."* | > | Read a specific message | *"Open the latest email from our 3PL and tell me what they need."* | > | Summarize a conversation | *"Summarize the thread about the Black Friday campaign."* | > | Triage the inbox | *"List the five most recent unread emails."* | > [accordion] Organize your inbox > > | Ask the agent to | For example | > | - | - | > | Move messages | *"Move everything from that supplier into the Suppliers folder."* | > | Work with folders | *"What folders do I have, and how much unread is in each?"* | > | Mark messages | *"Mark the newsletters from last week as read."* | > [accordion] Compose and send > > | Ask the agent to | For example | > | - | - | > | Send an update | *"Email this week's margin summary to the buying team."* | > | Reply in a thread | *"Reply to Acme confirming the new delivery date."* | > | Forward with context | *"Forward that stock alert to ops with a one-line summary."* | *** ## Before you connect Every Agent 365 integration needs the same prerequisites, plus a tenant setup an admin does once per Microsoft 365 tenant. Start there, then come back: > [card] [Microsoft Agent 365 integrations](/guides/agent/integrations/agent-365) > > Prerequisites, one-time tenant setup, and shared troubleshooting *** ## Connect Microsoft Outlook (MCP) **1. Build your MCP URL** Outlook mail is served by `mcp_MailTools`. Replace `{tenant_id}` with your Entra tenant ID: ```text MCP URL theme={null} https://agent365.svc.cloud.microsoft/agents/tenants/{tenant_id}/servers/mcp_MailTools ``` > [!NOTE] > > Replace the whole `{tenant_id}` placeholder, braces included. Dema rejects a URL that still has braces in it. A tenant ID is a GUID, like `8f7a1b2c-3d4e-4f56-a7b8-9c0d1e2f3a4b`. **2. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Microsoft Outlook (MCP)**, and click **Connect**. Paste the MCP URL you built, then click **Add**. **3. Sign in and approve** Sign in with a Microsoft **work or school** account that belongs to the same tenant as the URL, and approve the permission Dema asks for. > [!TIP] > > You are returned to Dema with the integration marked as Active. **4. Check it works** Ask the agent something only Outlook can answer, for example: *"List the five most recent unread emails in my inbox."* If it comes back with real subject lines, the connection works. > [!TIP] > > Authorize with a dedicated agent mailbox instead of your personal inbox, and forward only what the agent needs. See [Best practices](/guides/agent/integrations/overview#best-practices) in the integrations overview. *** ## Scopes Dema requests | Scope | What it allows | | - | - | | `McpServers.Mail.All` | Read, search, list, compose, and send Outlook mail, and manage folders, on your behalf | | `offline_access` | Keep the connection alive so you do not have to reconnect often | Dema requests these against your tenant's own MCP server, so the grant covers that server and not your Microsoft 365 account as a whole. *** ## Troubleshooting > [!NOTE] > > Invalid MCP URLs, `AADSTS` codes, admin approval, and 403 responses work the same way for every Agent 365 integration. [Microsoft Agent 365 integrations → Troubleshooting](/guides/agent/integrations/agent-365#troubleshooting) covers them. > [accordion] The agent cannot find an email you can see > > The agent searches only the mailbox of the account that authorized the connection. It cannot read someone else's mailbox, or a shared mailbox that account has no access to. Reconnect with an account that can open it. > [accordion] The agent cannot see calendar events or meetings > > This integration is mail only. Outlook Calendar runs on a separate Microsoft MCP server, which Dema does not support yet. > [accordion] McpServers.Mail.All does not appear in Entra > > An Entra admin has to register or consent the Work IQ Mail MCP server (`mcp_MailTools`) in your tenant before anyone can grant the permission. Still stuck? Contact [support](mailto:info@dema.ai) with the error message, including the Entra `AADSTS` code if you have one. # Microsoft SharePoint Source: https://docs.dema.ai/guides/agent/integrations/microsoft-sharepoint Let the Dema Agent work with SharePoint sites, lists, document libraries, files, and sharing through Microsoft's hosted SharePoint MCP server. ## Overview Once Microsoft SharePoint is connected, the Dema Agent can read the documents and lists your team keeps in SharePoint, and file its own output back into them. The agent acts only when you ask it to, and Dema asks you to confirm sensitive changes first. It signs in as whoever authorized the connection, so it sees the same sites and files that person sees. > [!NOTE] > > The Microsoft Agent 365 integrations are in **preview**, and so are the Work IQ MCP servers behind them. Tools can change without notice. Your workspace might need preview integrations enabled before these show up. > [!TIP] > > File operations work on files up to **5 MB**. *** ## What you can ask for > [accordion] Find and read documents > > | Ask the agent to | For example | > | - | - | > | Locate a document | *"Find the supplier agreement for Acme in the Buying site."* | > | Read a file into a conversation | *"Open the returns policy document and summarize the exceptions."* | > | Browse a library | *"List the files in the Marketing site's Documents library."* | > [accordion] Work with lists > > | Ask the agent to | For example | > | - | - | > | Read list data | *"What is in the Campaign Tracker list for this quarter?"* | > | Cross-check against Dema data | *"Compare the planned spend in that list with what we actually spent."* | > | Update items | *"Mark the Black Friday campaign as complete in the tracker."* | > [accordion] Organize and share > > | Ask the agent to | For example | > | - | - | > | File the agent's output | *"Save this margin report to the Trading site's Reports folder."* | > | Tidy up | *"Move last season's files into the Archive folder."* | > | Share a document | *"Create a link to that report for the buying team."* | *** ## Before you connect Every Agent 365 integration needs the same prerequisites, plus a tenant setup an admin does once per Microsoft 365 tenant. Start there, then come back: > [card] [Microsoft Agent 365 integrations](/guides/agent/integrations/agent-365) > > Prerequisites, one-time tenant setup, and shared troubleshooting *** ## Connect Microsoft SharePoint **1. Build your MCP URL** SharePoint is served by `mcp_SharePointRemoteServer`. Replace `{tenant_id}` with your Entra tenant ID: ```text MCP URL theme={null} https://agent365.svc.cloud.microsoft/agents/tenants/{tenant_id}/servers/mcp_SharePointRemoteServer ``` > [!NOTE] > > Replace the whole `{tenant_id}` placeholder, braces included. Dema rejects a URL that still has braces in it. A tenant ID is a GUID, like `8f7a1b2c-3d4e-4f56-a7b8-9c0d1e2f3a4b`. **2. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Microsoft SharePoint**, and click **Connect**. Paste the MCP URL you built, then click **Add**. **3. Sign in and approve** Sign in with a Microsoft **work or school** account that belongs to the same tenant as the URL, and approve the permission Dema asks for. > [!TIP] > > You are returned to Dema with the integration marked as Active. **4. Check it works** Ask the agent something only SharePoint can answer, for example: *"List the files in the Marketing site's Documents library."* If it comes back with real file names, the connection works. *** ## Scopes Dema requests | Scope | What it allows | | - | - | | `McpServers.SharePoint.All` | Work with SharePoint sites, lists, list items, columns, document libraries, files, folders, and sharing on your behalf | | `offline_access` | Keep the connection alive so you do not have to reconnect often | Dema requests these against your tenant's own MCP server, so the grant covers that server and not your Microsoft 365 account as a whole. *** ## Troubleshooting > [!NOTE] > > Invalid MCP URLs, `AADSTS` codes, admin approval, and 403 responses work the same way for every Agent 365 integration. [Microsoft Agent 365 integrations → Troubleshooting](/guides/agent/integrations/agent-365#troubleshooting) covers them. > [accordion] A file operation fails on a large file > > File operations are capped at **5 MB**. The agent cannot read or upload anything larger. Share a link to the file instead, or work from a smaller extract. > [accordion] The agent cannot find a site, library, or file > > The agent sees only what the authorizing account can open. Grant that account access to the site or library, or reconnect with one that already has it. Name searches need the exact site or library name, so try the site URL if the name does not match. > [accordion] McpServers.SharePoint.All does not appear in Entra > > An Entra admin has to register or consent the Work IQ SharePoint MCP server (`mcp_SharePointRemoteServer`) in your tenant before anyone can grant the permission. Still stuck? Contact [support](mailto:info@dema.ai) with the error message, including the Entra `AADSTS` code if you have one. # Microsoft Teams Source: https://docs.dema.ai/guides/agent/integrations/microsoft-teams Let the Dema Agent read and manage Microsoft Teams chats, channels, members, and messages through Microsoft's hosted Teams MCP server. ## Overview Once Microsoft Teams is connected, the Dema Agent can read Teams discussions and post messages back to them without you leaving the conversation. The agent acts only when you ask it to, and Dema asks you to confirm sensitive changes first. It signs in as whoever authorized the connection, so it sees the same chats and channels that person sees in Teams. > [!NOTE] > > The Microsoft Agent 365 integrations are in **preview**, and so are the Work IQ MCP servers behind them. Tools can change without notice. Your workspace might need preview integrations enabled before these show up. *** ## What you can ask for > [accordion] Read chats and channels > > | Ask the agent to | For example | > | - | - | > | Catch up on a channel | *"Summarize the last 20 messages in #trading."* | > | Follow a thread | *"What was decided in the thread about the delivery delay?"* | > | Search conversations | *"Find where we discussed the supplier price increase."* | > | Pull context into analysis | *"Compare last week's sales with what the team reported in #weekly-review."* | > [accordion] Post messages > > | Ask the agent to | For example | > | - | - | > | Share an analysis | *"Post this margin breakdown to #trading."* | > | Reply in a thread | *"Reply to that thread with the corrected forecast."* | > | Send a direct message | *"Send Alex a chat with the top five underperforming SKUs."* | > [accordion] Find teams, channels, and people > > | Ask the agent to | For example | > | - | - | > | List what you have access to | *"Which teams and channels am I in?"* | > | Check membership | *"Who is in the #trading channel?"* | > | Manage channel members | *"Add Sam to the #forecasting channel."* | *** ## Before you connect Every Agent 365 integration needs the same prerequisites, plus a tenant setup an admin does once per Microsoft 365 tenant. Start there, then come back: > [card] [Microsoft Agent 365 integrations](/guides/agent/integrations/agent-365) > > Prerequisites, one-time tenant setup, and shared troubleshooting *** ## Connect Microsoft Teams **1. Build your MCP URL** Teams is served by `mcp_TeamsServer`. Replace `{tenant_id}` with your Entra tenant ID: ```text MCP URL theme={null} https://agent365.svc.cloud.microsoft/agents/tenants/{tenant_id}/servers/mcp_TeamsServer ``` > [!NOTE] > > Replace the whole `{tenant_id}` placeholder, braces included. Dema rejects a URL that still has braces in it. A tenant ID is a GUID, like `8f7a1b2c-3d4e-4f56-a7b8-9c0d1e2f3a4b`. **2. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Microsoft Teams**, and click **Connect**. Paste the MCP URL you built, then click **Add**. **3. Sign in and approve** Sign in with a Microsoft **work or school** account that belongs to the same tenant as the URL, and approve the permission Dema asks for. > [!TIP] > > You are returned to Dema with the integration marked as Active. **4. Check it works** Ask the agent something only Teams can answer, for example: *"Summarize the last 20 messages in the #general channel."* If it comes back with real messages, the connection works. *** ## Scopes Dema requests | Scope | What it allows | | - | - | | `McpServers.Teams.All` | Read and manage Teams chats, channels, messages, threads, and members on your behalf | | `offline_access` | Keep the connection alive so you do not have to reconnect often | Dema requests these against your tenant's own MCP server, so the grant covers that server and not your Microsoft 365 account as a whole. *** ## Troubleshooting > [!NOTE] > > Invalid MCP URLs, `AADSTS` codes, admin approval, and 403 responses work the same way for every Agent 365 integration. [Microsoft Agent 365 integrations → Troubleshooting](/guides/agent/integrations/agent-365#troubleshooting) covers them. > [accordion] The agent cannot see a channel or chat > > The agent sees only what the authorizing account is a member of. Add that account to the team or chat, or reconnect with one that already has access. Private channels need an explicit join, even for members of the parent team. > [accordion] Posting a message fails > > Check that the authorizing account can post in that channel itself. Moderated and read-only channels reject posts from members, and the agent inherits those limits. > [accordion] McpServers.Teams.All does not appear in Entra > > An Entra admin has to register or consent the Work IQ Teams MCP server (`mcp_TeamsServer`) in your tenant before anyone can grant the permission. Still stuck? Contact [support](mailto:info@dema.ai) with the error message, including the Entra `AADSTS` code if you have one. # NetSuite Source: https://docs.dema.ai/guides/agent/integrations/netsuite Let the Dema Agent access NetSuite ERP data, records, and business processes through the NetSuite AI Connector. ## Overview Once NetSuite is connected, the Dema Agent can query ERP data and records exposed by the NetSuite AI Connector Service. Use it to answer questions about orders, inventory, financials, and other NetSuite records during a conversation. *** ## Prerequisites * A NetSuite account with **OAuth 2.0** and **Server SuiteScript** enabled (Setup → Company → Enable Features → SuiteCloud subtab). The **AI Connector Service** is the service this integration talks to — it is not a separate feature checkbox. * An administrator to create the integration record (step 1 below). * A **non-administrator** role for the person who signs in during the approval step. NetSuite's AI Connector Service does **not** support the Administrator role, or any role with full permissions. That role needs the **MCP Server Connection** and **Log in using OAuth 2.0 Access Tokens** permissions. * Your NetSuite **Account ID** — find your account-specific URL under **Setup → Company → Company Information → Company URLs** subtab and copy it from there rather than building it by hand. Sandbox account IDs append `_SB1`; in the URL the underscore becomes a hyphen and letters are lowercased (for example `123456_SB1` → `123456-sb1`). > [!NOTE] > > NetSuite requires you to create your own OAuth integration record and paste > its credentials into Dema. You only need to do this once per NetSuite account. *** ## Connect NetSuite **1. Create an integration record in NetSuite** * In NetSuite, go to **Setup → Integration → Manage Integrations → New**. * Give the integration a recognizable name, for example `Dema Agent`. * Set **State** to **Enabled**. * Under **OAuth 2.0**, check **Authorization Code Grant** and, under **Scope**, select **NetSuite AI Connector Service**. * **Uncheck Public Client** — Dema authenticates with a client secret. Leave **Client Credentials (Machine to Machine) Grant**, **Dynamic Client Registration**, and all **Token-Based Authentication** boxes off. * In **Redirect URI**, enter `https://app.dema.ai/agents/oauth/callback` exactly. * Save the integration. > [!NOTE] > > **NetSuite AI Connector Service** must be the only scope on the record — it cannot be combined with REST Web Services, RESTlets, or SuiteAnalytics. If the scope is not listed, confirm the AI Connector Service is available for your account. **2. Copy the client ID and client secret** NetSuite shows the **Consumer Key / Client ID** and **Consumer Secret / Client Secret** only once, immediately after saving. Copy both values now. If you lose the secret you must reset it from the integration record (which generates a new one) and reconnect in Dema. **3. Paste the credentials into Dema** In Dema, go to **Agents → Settings → Integrations**, find **NetSuite**, and click **Connect**. Enter: * **Client ID** from the previous step * **Client secret** from the previous step * **MCP URL** in the form `https://{accountId}.suitetalk.api.netsuite.com/services/mcp/v1/all`, replacing `{accountId}` with your NetSuite Account ID (lowercase, sandboxes use a hyphen, e.g. `123456-sb1`) Click **Add**. Sign in to NetSuite and approve the authorization. You are returned to Dema with the integration marked as Active. *** ## Scopes Dema requests | Scope | What it allows | | - | - | | `mcp` | Access records and actions exposed by the NetSuite AI Connector Service | The session runs with the role you sign in with during the approval step, so the agent only sees data that role can already access. Use a non-administrator role (see [Prerequisites](#prerequisites)) scoped to the records the agent should be able to read or update. *** ## Tokens and rotation Dema refreshes access automatically: NetSuite access tokens last 60 minutes, and refresh tokens are single-use and rotate on each refresh (expiring after 2 days by default, configurable on the integration record). The Consumer Key and Secret themselves do not expire — but if you reset them in NetSuite, click **Reconnect** in Dema and enter the new values. *** ## Troubleshooting * **Dema says the URL is invalid.** The MCP URL must be `https://{accountId}.suitetalk.api.netsuite.com/services/mcp/v1/all`. Make sure you replaced `{accountId}` with your real Account ID (lowercase, sandboxes use a hyphen, for example `123456-sb1`). * **Redirect URI mismatch.** The Redirect URI on the integration record must be exactly `https://app.dema.ai/agents/oauth/callback`, including protocol and path. * **Approval screen fails or the scope is missing.** Confirm **OAuth 2.0** and **Server SuiteScript** are enabled in **Setup → Company → Enable Features → SuiteCloud**, and that the integration record has the **NetSuite AI Connector Service** scope. * **Sign-in is rejected or the agent gets no access.** The AI Connector Service does not support the **Administrator** role, or any role with full permissions. Sign in during approval with a non-admin role that has the **MCP Server Connection** and **Log in using OAuth 2.0 Access Tokens** permissions. * **Dema cannot authenticate with the client secret.** NetSuite shows the secret only once. If you lost it, reset it on the integration record and reconnect in Dema with the new value. *** ## Additional resources * [Get started with the NetSuite AI Connector Service](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/article_3200541651.html) * [Connect to the NetSuite AI Connector Service](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_0714082142.html) * [Create integration records for OAuth 2.0](https://docs.oracle.com/en/cloud/saas/netsuite/ns-online-help/section_157771733782.html) # Nosto Source: https://docs.dema.ai/guides/agent/integrations/nosto Let the Dema Agent read products, segments, affinities, recommendations, and orders from Nosto when you ask. ## Overview Once Nosto is connected, the Dema Agent can work with your Nosto data directly inside a conversation — browse your product catalog, look up individual products, list customer segments, pull account-level affinity insights (top brands, categories, and product types), fetch product recommendations such as best-sellers and related items, and look up individual orders. All access is **read-only** — the agent never changes anything in your Nosto account. The agent only acts when you ask it to. *** ## Prerequisites * A Nosto account with access to **Settings → Authentication Tokens** — you may need an admin on your account to open this page. > [!NOTE] > > Nosto has several token types. Dema needs the **Apps** token from **Settings → Authentication Tokens**. A **public** token only covers a subset of the API and will not work for everything the agent does. *** ## Connect Nosto **1. Copy the Apps token in Nosto** 1. In Nosto, go to **Settings**. 2. Open **Authentication Tokens**. 3. Find the **Apps** token and copy it. **2. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Nosto**, and click **Connect**. Enter: * **Connection name** — a name for this Nosto account, up to 80 characters. For example, use the market it covers, such as `Sweden`. Each name must be unique, ignoring case. * **Nosto Apps API token** — the Apps token you copied from Nosto. Click **Add**. Dema marks the integration as Active. Each connection uses one Apps token. To connect several Nosto accounts, repeat these steps with a different connection name and that account's Apps token. The agent uses the connection names to tell your accounts apart and pick the right one. *** ## Rotating the token To rotate the token, regenerate the **Apps** token in Nosto under **Settings → Authentication Tokens**, then click **Reconnect** on the Nosto integration card in Dema and enter the new token. Reconnecting only replaces the token. The connection name stays the same. *** ## Troubleshooting > [accordion] Dema cannot authenticate > > Check that you copied the full **Apps** token from **Settings → Authentication Tokens**. Other token types — such as the **public** token — will not authenticate correctly here. > [accordion] I cannot find the Authentication Tokens page > > The **Settings → Authentication Tokens** page may be restricted on your account. Ask an admin on your Nosto account to copy the Apps token for you, or to grant you access. > [accordion] A connection with this name already exists > > Connection names must be unique, ignoring case. Choose a different name, or click **Reconnect** on the existing connection to replace its token. > [accordion] The agent's Nosto requests are failing > > Confirm the Apps token has not been regenerated or revoked in Nosto. If it has, copy the current token and click **Reconnect** in Dema. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [Nosto authentication tokens](https://help.nosto.com/en/articles/613616-settings-authentication-tokens) * [Nosto GraphQL API documentation](https://docs.nosto.com/techdocs/apis/graphql-an-introduction) # Ometria Source: https://docs.dema.ai/guides/agent/integrations/ometria Let the Dema Agent read contacts, orders, products, and segments from Ometria, push records, and send transactional emails when you ask. ## Overview Once Ometria is connected, the Dema Agent can work with your Ometria data directly inside a conversation — read contacts, orders, products, and segments, push records into Ometria, and send transactional emails. The agent only acts when you ask it to, and Dema asks you to confirm sensitive changes before they are applied. *** ## Prerequisites * An Ometria account with **administrator** permissions — only admins can open the API keys page. > [!NOTE] > > Ometria has two different APIs. Dema uses the **Data API** (the key created under **Settings → API keys**). Do not use a **Query API** key from "Query API Access" — it authenticates differently and will not work here. *** ## Connect Ometria **1. Create an API key in Ometria** 1. In Ometria, go to **Settings**. 2. Open the **API keys** tab. 3. Click **Add new API key**. 4. Give it a unique title you will recognize, such as `Dema Agent`. 5. Save the key, click the **eye icon** to reveal it, and copy it. > [!NOTE] > > A new key can take up to **10 minutes** to become active. If the agent cannot authenticate right after you create the key, wait a few minutes and try again. **2. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Ometria**, and click **Connect**. Enter: * **API key** — the key you copied from Ometria. Click **Add**. Dema marks the integration as Active. A single Data API key covers everything the agent does — reading data, pushing records, and sending transactional emails. You do not need separate keys for read and write. *** ## Rotating the key Ometria keys do not have a rename or regenerate option. To rotate, create a new key under **Settings → API keys**, click **Reconnect** on the Ometria integration card in Dema, enter the new key, then revoke the old key in Ometria. *** ## Troubleshooting > [accordion] Dema cannot authenticate > > Check that you copied the full key from **Settings → API keys** (the **Data API** key, not a Query API key). Also wait up to 10 minutes after creating a key — new keys take a short while to activate. > [accordion] I cannot find the API keys tab > > The API keys page is only available to **administrators**. Ask an admin on your Ometria account to create the key, or to grant you admin access. > [accordion] The agent's Ometria requests are failing > > Confirm the key has not been revoked in Ometria. If it has, create a new key and click **Reconnect** in Dema. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [Ometria API keys](https://support.ometria.com/hc/en-gb/articles/360012199857-API-keys) * [Creating a new API key](https://support.ometria.com/hc/en-gb/articles/9882706389917-Creating-a-new-API-key) * [Ometria Data API introduction](https://docs.ometria.com/docs/ometria-data-api-introduction) # Ongoing WMS Source: https://docs.dema.ai/guides/agent/integrations/ongoing-wms Let the Dema Agent read article data, stock balances, and warehouse information for a goods owner from Ongoing WMS when you ask. ## Overview Once Ongoing WMS is connected, the Dema Agent can pull live warehouse data for a goods owner directly inside a conversation — article data, stock balances, and warehouse information. The agent only acts when you ask it to. *** ## Prerequisites * An Ongoing WMS account with **administrator** access, so you can create an integration user for a goods owner. > [!NOTE] > > Ongoing WMS does not use a sign-in (OAuth) flow. You create an integration user in the Ongoing admin, and Ongoing generates the two values you paste into Dema — an **API URL** and an **Authorization header**. Copy both exactly as shown. *** ## Connect Ongoing WMS **1. Create an integration user in Ongoing WMS** 1. In Ongoing WMS, go to **Administration → API for goods owners**. 2. Select the goods owner the agent should access. 3. Click **Add new user for AI tool integrations**. 4. Ongoing generates an **API URL** and an **Authorization header** value for that goods owner. Copy both. > [!NOTE] > > The API URL looks like `https://api.ongoingsystems.se/{warehouse}/api/v1/mcp`, where `{warehouse}` is your system name. Use the exact URL Ongoing shows you. **2. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Ongoing WMS**, and click **Connect**. Enter: * **MCP URL** — the API URL Ongoing generated. * **Authorization header** — the Authorization header value Ongoing generated. Paste it exactly as given, including any prefix. Click **Add**. Dema marks the integration as Active. > [!NOTE] > > One credential connects **one goods owner**. To give the agent access to another goods owner, create a separate integration user in Ongoing and add it as another connection. *** ## Troubleshooting > [accordion] Dema cannot authenticate > > Paste the **Authorization header** value exactly as Ongoing generated it — do not trim or change it. If you are unsure, create a fresh integration user under **Administration → API for goods owners** and copy the new values. > [accordion] Dema says the URL is invalid > > The MCP URL must be the API URL Ongoing generated for your goods owner, on `api.ongoingsystems.se`. Copy it directly from the Ongoing admin rather than typing it by hand. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [Ongoing WMS API access](https://docs.ongoingwarehouse.com/manuals/api-access) * [Ongoing WMS API basics](https://developer.ongoingwarehouse.com/basics) # Microsoft Outlook Source: https://docs.dema.ai/guides/agent/integrations/outlook Let the Dema Agent send email from any Microsoft 365 work mailbox through Microsoft Graph. ## Overview Once Microsoft Outlook is connected, the Dema Agent can send email from your Outlook mailbox without you leaving the conversation. The integration only sends mail. It cannot read, search, or change messages in your mailbox. This integration talks to your mailbox through Microsoft Graph. It works with any Microsoft 365 work mailbox. You don't need a Microsoft 365 Copilot licence, Agent 365 tenant setup, a tenant ID, or an MCP URL. The agent acts only when you ask it to. It sends as whoever authorized the connection. > [!TIP] > > Need the agent to read or search your mail? [Microsoft Outlook (MCP)](/guides/agent/integrations/microsoft-outlook) connects through Microsoft's hosted Mail MCP server instead. Both integrations cover mail only. *** ## What you can ask for | Ask the agent to | For example | | - | - | | Send an email | *"Email this week's margin summary to the buying team."* | | Send a file from the conversation | *"Send the stock report CSV to ops with a one-line summary."* | The agent can format the body as plain text or as styled Markdown. *** ## Prerequisites * A Microsoft 365 **work or school** account with an Outlook mailbox. * If your organization does not let users approve app permissions themselves, a Microsoft Entra admin may need to approve Dema for your tenant. *** ## Connect Microsoft Outlook **1. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Microsoft Outlook**, and click **Connect**. **2. Sign in and approve** Sign in with your Microsoft work or school account and approve the permissions Dema requests. > [!TIP] > > You are returned to Dema with the integration marked as Active. **3. Check it works** Ask the agent to send a short test email to yourself, for example: *"Send me a test email from Outlook."* If it arrives in your inbox, the connection works. > [!TIP] > > Authorize with a dedicated agent mailbox instead of your personal inbox, so the agent's emails come from that address. See [Best practices](/guides/agent/integrations/overview#best-practices) in the integrations overview. *** ## Scopes Dema requests | Scope | What it allows | | - | - | | `Mail.Send` | Send mail as you | | `offline_access` | Keep the connection alive so you do not have to reconnect often | These are delegated permissions. Dema does not request access to read your mailbox. *** ## Limits * **Attachments:** Keep the total size of attachments under about 2 MB per message. Larger messages fail to send. Ask the agent to share a link instead, or split files across several emails. * **Mail only:** The integration does not cover Outlook Calendar or contacts. *** ## Troubleshooting > [accordion] Sign-in says approval is required by an administrator > > Your tenant does not allow users to approve app permissions themselves. Ask a Microsoft Entra admin to approve Dema for your organization, then connect again. > [accordion] The agent cannot find or read an email > > This integration only sends mail and cannot read your mailbox. Use [Microsoft Outlook (MCP)](/guides/agent/integrations/microsoft-outlook) if the agent needs to read or search mail. > [accordion] Sending fails because the message is too large > > The attachments exceed the roughly 2 MB limit. Remove or shrink attachments and try again. Still stuck? Contact [support](mailto:info@dema.ai) with the error message, including the Entra `AADSTS` code if you have one. *** ## Additional resources * [Microsoft Graph Mail API overview](https://learn.microsoft.com/graph/outlook-mail-concept-overview) * [Microsoft Graph permissions reference](https://learn.microsoft.com/graph/permissions-reference) # Integrations overview Source: https://docs.dema.ai/guides/agent/integrations/overview Connect the Dema Agent to third-party tools it can use in conversations and scheduled runs. Integrations let the Dema Agent use services such as Shopify, Slack, and Google Sheets in conversations and scheduled runs. You choose which integrations to connect and which actions to allow. *** ## Supported integrations ### Commerce & operations > [card] [Shopify](/guides/agent/integrations/shopify) > [card] [Centra](/guides/agent/integrations/centra) > [card] [Commercetools](/guides/agent/integrations/commercetools) > [card] [Nosto](/guides/agent/integrations/nosto) > [card] [Depict.ai](/guides/agent/integrations/depict) > [card] [NetSuite](/guides/agent/integrations/netsuite) > [card] [Microsoft Dynamics 365 Business Central](/guides/agent/integrations/business-central) > [card] [Fortnox](/guides/agent/integrations/fortnox) > [card] [Ongoing WMS](/guides/agent/integrations/ongoing-wms) > [card] [Ingrid](/guides/agent/integrations/ingrid) > [card] [Ingrid Tracking](/guides/agent/integrations/ingrid-tracking) > [card] [Google Merchant Center](/guides/agent/integrations/google-merchant-center) ### Marketing > [card] [Google Ads](/guides/agent/integrations/google-ads) > [card] [Pinterest](/guides/agent/integrations/pinterest) > [card] [Klaviyo](/guides/agent/integrations/klaviyo) > [card] [Attentive](/guides/agent/integrations/attentive) > [card] [Ometria](/guides/agent/integrations/ometria) > [card] [Rule](/guides/agent/integrations/rule) ### Analytics & experimentation > [card] [Algolia](/guides/agent/integrations/algolia) > [card] [Google Analytics](/guides/agent/integrations/google-analytics) > [card] [Google Search Console](/guides/agent/integrations/google-search-console) > [card] [Semrush](/guides/agent/integrations/semrush) > [card] [Convert](/guides/agent/integrations/convert) > [card] [Intelligems](/guides/agent/integrations/intelligems) > [card] [Contentsquare](/guides/agent/integrations/contentsquare) > [card] [Viametrics](/guides/agent/integrations/viametrics) ### Data & spreadsheets > [card] [BigQuery](/guides/agent/integrations/bigquery) > [card] [Snowflake](/guides/agent/integrations/snowflake) > [card] [Azure SQL](/guides/agent/integrations/azure-sql) > [card] [Google Sheets](/guides/agent/integrations/google-sheets) ### Communication & documents > [card] [Slack](/guides/agent/integrations/slack) > [card] [Microsoft Teams](/guides/agent/integrations/microsoft-teams) > [card] [Gmail](/guides/agent/integrations/gmail) > [card] [Microsoft Outlook](/guides/agent/integrations/outlook) > [card] [Microsoft Outlook (MCP)](/guides/agent/integrations/microsoft-outlook) > [card] [Microsoft SharePoint](/guides/agent/integrations/microsoft-sharepoint) ### Customer support > [card] [Gorgias](/guides/agent/integrations/gorgias) > [card] [Intercom](/guides/agent/integrations/intercom) ### Content & data collection > [card] [Contentful](/guides/agent/integrations/contentful) > [card] [Storyblok](/guides/agent/integrations/storyblok) > [card] [Typeform](/guides/agent/integrations/typeform) > [card] [Apify](/guides/agent/integrations/apify) ### Bring your own > [card] [Custom integration](/guides/agent/integrations/custom-integration) *** ## Connecting an integration Choose where to connect an integration based on which agent needs it: | Agent | Where to connect it | | - | - | | The built-in assistant | **Agents → Settings → Integrations** | | An agent you created | Open the agent, then go to **Configuration → Integrations** | For an agent you created, reuse an existing connection or authorize a new one. A new connection is private to you. You can link it to your other agents or share it with teams or your whole organization. Connections that other people share with you can also be linked to your agents. Pick the integration and click **Connect** or **Add**, depending on the screen. You can also connect from the conversation. If you ask for something that needs an integration that isn't connected, or whose connection has expired or lacks permissions, the agent can show a card in the chat so you can connect or reconnect it there. This works only for integrations enabled for your organization. Where cards can't be shown, the agent sends a link to the integration settings instead. The integration page shows which connection method it uses. ### One-click connect Select **Connect**, sign in to the service, and approve the requested access. Most integrations use this method. ### Create an app at the vendor Some services require an OAuth app. The guide for that integration includes the required settings: 1. Create the app in the service's admin area. 2. Copy the client ID, client secret, and your account URL. 3. Paste the values into the Dema connect dialog. ### API client credentials Some services use API credentials instead of an interactive login. Create an API client in the service's admin area, then copy its credentials into Dema. ### Your own MCP server For a service that is not in the list, add a **Custom Integration**: give Dema the HTTPS URL of an MCP server and, if it needs one, an access token or OAuth sign-in. Its tools then work like any other integration, except that each one asks for your approval before it runs. See [Custom integration](/guides/agent/integrations/custom-integration) for the setup steps. > [!TIP] > > Each integration guide lists what you need before you connect. *** ## Managing a connection Each connection shows the provider account it uses, such as an email address, workspace, or shop name. Only the owner of a connection can rename it. ### Sharing a connection You can share a connection you own directly with specific teams or your whole organization. People it's shared with can link it to their own agents. Existing connections stay private until you share them. * When other people use your connection, your tool-approval limits for it still apply. * Narrowing a connection's audience removes it from agents it no longer covers. See [Sharing agents and sessions](/guides/agent/access-and-sharing#connected-accounts) for how shared connections limit who you can share an agent with. ### Removing or disconnecting an integration * **Unlink** removes a connection from one agent. Open the agent and go to **Configuration → Integrations**. * **Disconnect** deletes the connection everywhere it is used. Go to **Agents → Settings → Integrations**, find the connection, and click **Disconnect**. See [Your agents](/guides/agent/your-agents#integrations) for more about agent-specific connections. ### Revoking Dema's access at the vendor Disconnecting removes the credentials from Dema. To revoke the authorization at the service as well, use the service's admin area: * Look for a **Connected apps** or **Authorized apps** page. * If you created an app for the integration, revoke or delete that app. *** ## Best practices ### Use a dedicated account for the agent When an integration uses a user account, create a separate account for the agent instead of connecting your personal account. Give that account access only to the files, folders, properties, or ad accounts the agent needs. This approach works for Google Workspace, Google Ads, and other services that grant access at the account level. With a separate account: * The agent cannot access unrelated content in your personal account. * You can remove access without changing your own account. * Audit logs show the agent under a separate identity. * The connection remains available when a team member leaves. > [!TIP] > > Treat the agent account like any other service account. Use a strong password, enable 2FA, and limit who can sign in. ### Scope access to what the agent actually needs Share only the resources the agent needs, such as one spreadsheet folder, ad account, or inbox label. You can grant more access later. *** ## Security * Dema uses stored credentials only when the agent calls the integration. * Each integration guide lists the access Dema requests. * Dema refreshes OAuth tokens automatically. If a refresh fails, the connection appears as expired and the agent stops using it. Reconnect from the same screen to restore access. *** ## Tool permissions Each integration exposes a mix of **read** and **write** tools. * **Read tools** let the agent fetch data (for example, list Shopify orders or search Slack messages). * **Write tools** let the agent make changes (for example, send a Slack message or update a customer tag). The agent chooses a tool based on your request. For an agent you created, use **Configuration → Tool permissions** to require approval for sensitive actions. See [Your agents](/guides/agent/your-agents#tool-permissions). *** ## Troubleshooting > [accordion] I cannot finish the approval screen at the vendor > > Make sure you are signed in with an account that has permission to approve > third-party apps or install integrations. If your organization restricts > third-party app installs, ask an admin to complete the connection for you. > [accordion] Dema says my connection has expired > > This happens when Dema cannot refresh the access token, usually because you > revoked access at the vendor or rotated credentials. Click **Reconnect** on > the integration card to re-authorize. > [accordion] Dema says the URL I entered is invalid > > For integrations that require an account URL or MCP URL, the value must be > an HTTPS URL pointing at your own tenant. Double-check the format shown in > the input placeholder and that it matches your vendor account. > [accordion] The agent says it is missing scopes > > The scopes Dema requests may have expanded since you first connected. > Disconnect and reconnect the integration to approve the new scopes. If you are still stuck, contact [support](mailto:info@dema.ai) with the integration name and the error message you see. # Pinterest Source: https://docs.dema.ai/guides/agent/integrations/pinterest Let the Dema Agent read Pinterest ad account, campaign, and pin performance, and manage campaigns, ad groups, ads, audiences, boards, and pins. ## Overview Once Pinterest is connected, the Dema Agent can browse your ad accounts, campaigns, ad groups, and ads, read their performance, and make changes — create and update campaigns, ad groups, ads, and targeting audiences. It can also work with your organic content: list boards and pins, read pin analytics, and create new pins and boards. Useful for diagnosing paid social performance and applying Dema recommendations without leaving a conversation. The agent only acts when you ask it to, and you can ask it to describe any change before it applies it. ### What the agent can do * **Ad accounts** — list the ad accounts you've shared and read account-level analytics. * **Campaigns** — list, read, create, and update campaigns, and read campaign analytics. * **Ad groups** — list, read, create, and update ad groups, and read ad group analytics. * **Ads** — list, read, create, and update ads, and read ad analytics. * **Audiences** — list, create, and update targeting audiences. * **Boards and pins (organic)** — list boards and pins, read pin analytics, and create pins and boards. * **Account** — read your Pinterest user profile. *** ## Prerequisites * A Pinterest Business account with access to the ad accounts you want Dema to use. *** ## Connect Pinterest 1. In Dema, go to **Agents → Settings → Integrations**. 2. Find **Pinterest** and click **Connect**. 3. Sign in to Pinterest and approve the scopes Dema requests. 4. Choose which ad accounts Dema can access. 5. You are returned to Dema with the integration marked as Active. *** ## Scopes Dema requests | Scope | What it allows | | - | - | | `user_accounts:read` | Read your Pinterest account profile | | `ads:read` | Read ad accounts, campaigns, ad groups, ads, audiences, and their analytics | | `ads:write` | Create and update campaigns, ad groups, ads, and audiences | | `boards:read`, `boards:read_secret` | List and read boards, including secret boards | | `boards:write`, `boards:write_secret` | Create boards, including secret boards | | `pins:read`, `pins:read_secret` | List and read pins and pin analytics, including secret pins | | `pins:write`, `pins:write_secret` | Create pins, including secret pins | *** ## Troubleshooting > [accordion] An ad account is missing > > Dema only works with the ad accounts you shared during the connect step. If an account is missing, click **Reconnect** on the Pinterest integration card and select it. > [accordion] Dema says my connection has expired > > This happens when Dema cannot refresh the access token, usually because access was revoked in Pinterest. Click **Reconnect** on the integration card to re-authorize. > [accordion] The agent cannot create or update campaigns > > Creating and updating campaigns, ad groups, ads, and audiences requires that the connected Pinterest account has permission to manage the target ad account. Confirm the account has advertiser access, then ask the agent again. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [Pinterest Business Help Center](https://help.pinterest.com/en/business) * [Pinterest API (v5) documentation](https://developers.pinterest.com/docs/api/v5/) # Rule Source: https://docs.dema.ai/guides/agent/integrations/rule Let the Dema Agent manage subscribers and tags, read campaign performance, and send transactional email or SMS in Rule when you ask. ## Overview Once Rule is connected, the Dema Agent can work with your [Rule](https://www.rule.io) email and SMS marketing data directly inside a conversation — list tags, look up a subscriber by email or phone, browse campaigns, and read campaign statistics. It can also create or update subscribers (with custom fields and tags), add tags to a subscriber to trigger automations, and send transactional email or SMS. The agent only acts when you ask it to, and Dema asks you to confirm sensitive changes before they are applied. *** ## Prerequisites * A Rule account with access to the **Developer** settings page (to create an API key). *** ## Connect Rule **1. Create an API key in Rule** 1. In Rule, open the account dropdown menu and click **Settings**. 2. Go to **Developer**. 3. Click **New API key**. The new key appears shortly — copy it. > [!NOTE] > > A Rule API key is a sensitive credential, much like a password — it grants access to your account and data. Store it securely and do not share it. **2. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Rule**, and click **Connect**. Enter: * **API key** — the key you copied from Rule. Click **Add**. Dema marks the integration as Active. A single API key covers everything the agent does — reading tags, subscribers, and campaign statistics, pushing subscriber records and tags, and sending transactional messages. You do not need separate keys for read and write. *** ## Rotating the key To rotate, create a new key under **Settings → Developer**, click **Reconnect** on the Rule integration card in Dema, enter the new key, then delete the old key in Rule. *** ## Troubleshooting > [accordion] Dema cannot authenticate > > Check that you copied the full API key from **Settings → Developer**. A failed key returns an authorization error — recreate the key in Rule and click **Reconnect** in Dema. > [accordion] I cannot find the Developer page > > The API key is created under the account dropdown menu → **Settings → Developer**. If you do not see it, ask an admin on your Rule account to create the key for you. > [accordion] The agent's Rule requests are failing > > Confirm the key has not been deleted in Rule. If it has, create a new key and click **Reconnect** in Dema. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [Rule API key and documentation](https://help.rule.io/en/support/solutions/articles/103000274805-api-key-and-documentation) * [Rule REST API reference](https://apidoc.rule.se/) # Semrush Source: https://docs.dema.ai/guides/agent/integrations/semrush Let the Dema Agent pull SEO, keyword, backlink, and domain analytics plus market and competitive intelligence from Semrush when you ask. ## Overview Once Semrush is connected, the Dema Agent can pull live data from your Semrush account — keyword and domain analytics, backlinks, and market and competitive intelligence — directly inside a conversation. Semrush is read-only: the agent fetches data, it does not change anything in your Semrush account. The agent only acts when you ask it to. *** ## Prerequisites * A Semrush subscription with **API units** (the Standard and Trends APIs are billed in API units — see [API units](#api-units) below). * Permission to view the **Subscription Info** page on the account, where the API key lives. *** ## Connect Semrush **1. Find your API key in Semrush** 1. In Semrush, open the **Subscription Info** page. 2. Go to the **API Units** tab. Your API key is shown there. 3. Copy the key. > [!NOTE] > > Your API key gives access to your API units balance — treat it like a password and do not share it publicly. **2. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Semrush**, and click **Connect**. Enter: * **API key** — the key you copied from Semrush. Click **Add**. Dema marks the integration as Active. *** ## API units Semrush bills the API in **API units**, and every request the agent makes spends them from your balance. Each call costs a set number of units depending on the report and the number of lines returned — for example, Backlinks calls cost 40 units per line — so a broad question that pulls large reports consumes more units than a narrow one. Units are included in your subscription and unused units expire at each renewal rather than carrying over. The agent draws from the same units balance as the rest of your Semrush usage. Keep an eye on it on the **Subscription Info** page; if you run out, the agent's Semrush requests will fail until you top up or your units renew. > [!TIP] > > Ask the agent for what you actually need rather than broad sweeps across many domains or keywords — narrower questions return smaller reports and spend fewer units. *** ## Rotating the key To rotate, generate a new key on the **API Units** tab in Semrush, click **Reconnect** on the Semrush integration card in Dema, and enter the new key. *** ## Troubleshooting > [accordion] Dema cannot authenticate > > Check that you copied the full API key from the **API Units** tab on the Subscription Info page. If you are unsure, copy it again and reconnect. > [accordion] The agent's Semrush requests are failing > > You may be out of API units. Check your balance on the **Subscription Info** page and top up or wait for your units to renew. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [How to find your API key](https://www.semrush.com/kb/92-api-key) * [Semrush API documentation](https://www.semrush.com/kb/5-api-documentation) # Shopify Source: https://docs.dema.ai/guides/agent/integrations/shopify Let the Dema Agent query products, orders, customers, and inventory from your Shopify store. ## Overview Once Shopify is connected, the Dema Agent can query products, orders, customers, and inventory from your Shopify store through the Admin GraphQL API. Useful for pulling live commerce data into an analysis and for light write actions such as updating customer records, discounts, and product publications. The agent can also read and write your store's translations, the same ones you manage in Shopify's Translate & Adapt app. *** ## Prerequisites * A Shopify store you own, or staff access with permission to manage and install apps. * Access to the [Shopify Dev Dashboard](https://dev.shopify.com/dashboard) to create the app. > [!NOTE] > > Shopify requires you to create your own app and paste its credentials into Dema. You only need to do this once per store. When the Dev Dashboard asks how to distribute the app, choose **Custom distribution** — it is for an app installed on a single store you own and is not listed on the App Store. *** ## Connect Shopify **1. Create an app in the Shopify Dev Dashboard** 1. Open the [Shopify Dev Dashboard](https://dev.shopify.com/dashboard) and go to **Apps → Create app**. 2. Give the app a recognizable name, for example `Dema Agent`. 3. Choose **Custom distribution** and select the store you want to connect. **2. Add the app URL, redirect URL and scopes in a new version** Shopify app **versions are immutable** — to set or change the URLs or scopes, you create a new version based on the current one and release it. Changing them later works the same way. 1. Open the app and click **Create version**. 2. Under **Access → Scopes**, enter the scopes listed under [Scopes Dema requests](#scopes-dema-requests) below as a comma-separated list. 3. Under **Access → Redirect URLs**, add `https://app.dema.ai/agents/oauth/callback`. 4. Under **URLs → App URL**, enter the **same value again**. Shopify only starts the install when the App URL and the redirect URL are on the same domain, and leaving your own website or Shopify's placeholder here is the most common reason connecting Shopify fails. 5. Click **Release** to make the version active. ![Shopify app configuration with App URL and Redirect URLs both set to https://app.dema.ai/agents/oauth/callback](https://mintcdn.com/demaai/0GNMskf_4RXwG1m-/images/shopify-app-url-redirect-url.png?fit=max\&auto=format\&n=0GNMskf_4RXwG1m-\&q=85\&s=97cc7dea2ee022149f602df18fde6a41) > [!NOTE] > > Clicking this app's tile inside your Shopify admin will now open a Dema page rather than an app home screen. That is expected: the app exists only to authorize Dema's connection to your store. **3. Copy the app credentials** In the app's **Settings**, copy the **Client ID** and **Client secret**. **4. Paste the credentials into Dema** In Dema, go to **Agents → Settings → Integrations**, find **Shopify**, and click **Connect**. Enter: * **Client ID** from Shopify * **Client secret** from Shopify * **Account URL** in the form `https://{store}.myshopify.com`, replacing `{store}` with your store's subdomain Click **Add**. Shopify will ask you to install the app on the store. Approve it and you are returned to Dema with the integration marked as Active. *** ## Scopes Dema requests Optional scopes are only needed for the tools that use them. Without them, the connection keeps working, and only those tools are unavailable. | Scope | What it allows | Required | | - | - | - | | `read_products`, `write_products` | Read and update products and variants | Yes | | `read_orders`, `write_orders` | Read and update orders | Yes | | `read_customers`, `write_customers` | Read and update customer records and tags | Yes | | `read_inventory` | Read inventory levels | Yes | | `read_locations` | Read store locations, used for per-location inventory views | Yes | | `read_publications`, `write_publications` | Read and update product publications across sales channels | Yes | | `read_discounts`, `write_discounts` | Read and update discounts and promotions | Yes | | `read_translations`, `write_translations` | Read and update translations of products, collections, pages and other store content | Optional | | `read_locales` | Read which languages are enabled on the store, and which are published | Optional | > [!WARNING] > > A translation the agent saves for a published language is visible to shoppers immediately. To review translations first, keep the language unpublished in Shopify until you are ready. > [!NOTE] > > By default `read_orders` returns only the last 60 days of orders. Older orders require the `read_all_orders` scope, which Shopify must approve separately — it is not requested here. *** ## When the connection expires Dema uses expiring offline tokens. The access token lasts about an hour and Dema refreshes it automatically (the refresh token is valid 90 days and rotates on each refresh). If Dema stays disconnected past the refresh window, or you uninstall the app in Shopify, the connection lapses — reconnect from **Agents → Settings → Integrations → Shopify**. *** ## Troubleshooting * **`The redirect_uri and application url must have matching hosts`.** Your app's **App URL** is not on the same domain as the redirect URL. Create a new version, set both **URLs → App URL** and **Access → Redirect URLs** to `https://app.dema.ai/agents/oauth/callback`, and release it. * **Redirect URI mismatch.** The redirect URI in your Shopify app must be `https://app.dema.ai/agents/oauth/callback` exactly, including protocol and path. * **Dema says the store URL is invalid.** The account URL must be HTTPS and must end with `.myshopify.com`. Use your store's real subdomain, not a custom domain. * **The agent says the Shopify connection is missing permissions.** Your app's released version does not include a scope the tool needs, for example `write_translations`. Create a new version, add the scopes the message names under **Access → Scopes**, release it, and reconnect Shopify in Dema. * **Install fails on the store.** The staff account installing the app needs a role with permission to manage and install apps. Store owners can adjust staff permissions in the store admin under **Settings → Users and permissions**. *** ## Additional resources * [Shopify: create apps using the Dev Dashboard](https://shopify.dev/docs/apps/build/dev-dashboard/create-apps-using-dev-dashboard) * [Shopify Admin API access scopes](https://shopify.dev/docs/api/usage/access-scopes) * [Shopify offline access tokens](https://shopify.dev/docs/apps/build/authentication-authorization/access-tokens/offline-access-tokens) # Slack Source: https://docs.dema.ai/guides/agent/integrations/slack Let the Dema Agent search Slack messages, post updates, and collaborate on Slack canvases. ## Overview Once your Slack account is linked, the Dema Agent can search conversations across your workspace, read channel history, write messages on your behalf, react to messages, and create or update Slack canvases. It is useful for pulling context from past discussions and sharing Dema analyses directly into a channel. The agent always acts with your own Slack identity, so it can only see and do what your Slack user already can. Reading private channels, group DMs, direct messages, and canvases now requires your approval by default, even though the agent still acts under your own Slack identity. For an overview of everything Dema can do inside Slack — DMs, channel mentions, and installation — see [Dema for Slack](/guides/slack-integration). *** ## Prerequisites * Your Slack workspace is already connected to Dema by a Dema admin. If it is not, see the [installation steps](/guides/slack-integration#installation) — the **Link** button stays disabled until the workspace is connected. * A Slack user account in that workspace, since the agent acts on your behalf. > [!NOTE] > > If your Slack workspace restricts third-party app installs, the admin connecting the workspace may need a Slack admin to approve the Dema app first. *** ## Link your Slack account 1. In Dema, go to **Settings → Connected accounts**. 2. On the **Slack** card, find the **Your account** row and click **Link**. 3. Sign in to Slack and approve the permissions Dema requests. 4. You are returned to Dema with your Slack account linked. Linking your account automatically connects the Slack agent integration — there is no separate integration setup step. *** ## Permissions Dema requests Linking your account authorizes the following Slack user scopes. This is exactly the scope set required by [Slack's MCP server](https://docs.slack.dev/ai/slack-mcp-server/), which the agent uses to act on your behalf — and every request is bounded by what your own Slack user can already see and do. | Scope | What it allows | | - | - | | `search:read.public`, `search:read.private`, `search:read.mpim`, `search:read.im`, `search:read.files`, `search:read.users` | Search across public channels, private channels, group DMs, direct messages, files, and users you can see | | `channels:history`, `groups:history`, `mpim:history`, `im:history` | Read message history from channels, private channels, group DMs, and direct messages | | `channels:read`, `groups:read`, `mpim:read` | List the channels and conversations you are in | | `chat:write`, `channels:write`, `groups:write`, `im:write`, `mpim:write` | Post messages and manage conversations on your behalf | | `canvases:read`, `canvases:write` | Read and update Slack canvases | | `files:read` | Read files shared in conversations you can access | | `reactions:write`, `emoji:read` | Add emoji reactions to messages | | `users:read`, `users:read.email` | Look up user profiles and emails to resolve mentions | *** ## Disconnect Unlink your account from **Settings → Connected accounts** in Dema. Your stored OAuth token and account link are deleted, and the Slack agent integration is disconnected for you. A Dema admin disconnecting the workspace, or removing the app from Slack, does the same for everyone. *** ## Troubleshooting * **The Link button is disabled.** Your workspace is not connected yet — a Dema admin needs to [install the Dema app first](/guides/slack-integration#installation) from the **Workspace** row of the same page. * **Approval screen blocked.** Your workspace admin has restricted third-party app installs. Ask them to approve the Dema app. * **Agent cannot find a message.** The search scopes only cover conversations your own Slack user can already see. If the message lives in a channel you have not joined, the agent cannot reach it either. *** ## Additional resources * [Dema for Slack](/guides/slack-integration) * [Slack app management](https://slack.com/help/articles/222386767-Manage-app-approval-for-your-workspace) # Snowflake Source: https://docs.dema.ai/guides/agent/integrations/snowflake Let the Dema Agent query data, run Cortex AI tools, and execute SQL through your Snowflake account. ## Overview Once Snowflake is connected, the Dema Agent can query data, run Cortex AI tools, and execute SQL through your Snowflake-managed MCP server. Useful for bringing governed warehouse data into an analysis alongside Dema metrics. *** ## Prerequisites * A Snowflake account with an active Cortex MCP server deployed. * A Snowflake role with permission to create security integrations (typically `ACCOUNTADMIN` or a role granted `CREATE INTEGRATION`). * The database, schema, and name of your Cortex MCP server, plus your Snowflake account identifier in the form `{orgname}-{account}`, so you can build the MCP server URL. *** ## Connect Snowflake **1. Create an OAuth security integration in Snowflake** In a Snowflake worksheet, run the following. The `OAUTH_REDIRECT_URI` is the fixed Dema callback URL, which you will use again when you connect: ```sql theme={null} CREATE SECURITY INTEGRATION dema_agent TYPE = OAUTH ENABLED = TRUE OAUTH_CLIENT = CUSTOM OAUTH_CLIENT_TYPE = 'CONFIDENTIAL' OAUTH_REDIRECT_URI = 'https://app.dema.ai/agents/oauth/callback' OAUTH_ISSUE_REFRESH_TOKENS = TRUE OAUTH_REFRESH_TOKEN_VALIDITY = 7776000; ``` **2. Fetch the client ID and client secret** Run: ```sql theme={null} SELECT SYSTEM$SHOW_OAUTH_CLIENT_SECRETS('DEMA_AGENT'); ``` Copy the `OAUTH_CLIENT_ID` and `OAUTH_CLIENT_SECRET` values from the result. **3. Paste the credentials into Dema** In Dema, go to **Agents → Settings → Integrations**, find **Snowflake**, and click **Connect**. Enter: * **Client ID** from the previous step * **Client secret** from the previous step * **MCP URL** in the form `https://{orgname}-{account}.snowflakecomputing.com/api/v2/databases/{db}/schemas/{schema}/mcp-servers/{name}`, using the database, schema, and name of your Cortex MCP server Click **Add**. Sign in to Snowflake and approve the authorization. You are returned to Dema with the integration marked as Active. *** ## Permissions Dema does not request named OAuth scopes in Snowflake. The Snowflake-managed MCP server runs the session with the **authorizing user's `DEFAULT_ROLE`** — there is no role picker during sign-in, and secondary roles are not used. Grant that role only the access the agent should have. A typical setup creates a dedicated role (for example `DEMA_AGENT_ROLE`) with `USAGE` on the warehouse, database, schema, and MCP server plus the per-tool grants (see [Troubleshooting](#mcp-server-access-errors)), then makes it the authorizing user's default: ```sql theme={null} ALTER USER your_user SET DEFAULT_ROLE = DEMA_AGENT_ROLE; ``` > [!WARNING] > > If the authorizing user's `DEFAULT_ROLE` is not the role you granted access to, the agent's requests will fail even when the grants are correct. The session always uses the default role. *** ## When the connection expires The OAuth refresh token issued by the security integration is valid for up to 90 days (`OAUTH_REFRESH_TOKEN_VALIDITY = 7776000`, which is Snowflake's maximum). When it expires, Snowflake requires the user to authorize again. To restore access, go to **Agents → Settings → Integrations**, find **Snowflake**, and click **Reconnect**, then sign in and approve. You do not need to recreate the security integration or re-enter the Client ID and secret unless they have changed. *** ## Troubleshooting ### Integration setup * **Dema says the MCP URL is invalid.** The MCP URL must be HTTPS and must be on `.snowflakecomputing.com`. Use the `{orgname}-{account}` format (not a deprecated region-specific URL) and double-check the database, schema, and MCP server name. * **Authorization fails.** Make sure the security integration is `ENABLED = TRUE` and that `OAUTH_REDIRECT_URI` is exactly `https://app.dema.ai/agents/oauth/callback`. ### MCP server access errors If the agent cannot connect to your MCP server (error message: "MCP server does not exist or not authorized"), verify the following in your Snowflake account: **Confirm the MCP server exists** List all MCP servers in your schema: ```sql theme={null} SHOW MCP SERVERS IN SCHEMA YOUR_DATABASE.YOUR_SCHEMA; ``` Or describe the specific server to verify its configuration: ```sql theme={null} DESCRIBE MCP SERVER YOUR_DATABASE.YOUR_SCHEMA.YOUR_MCP_SERVER; ``` If the server does not exist, you need to [create an MCP server](https://docs.snowflake.com/en/sql-reference/sql/create-mcp-server) in Snowflake or update the database, schema, and name in your Dema integration settings. **Verify role permissions** The role you use to authorize the OAuth connection must have `USAGE` privilege on the MCP server, database, and schema. Check existing grants: ```sql theme={null} SHOW GRANTS ON MCP SERVER YOUR_DATABASE.YOUR_SCHEMA.YOUR_MCP_SERVER; ``` If your role is missing the required privileges, grant them: ```sql theme={null} GRANT USAGE ON MCP SERVER YOUR_DATABASE.YOUR_SCHEMA.YOUR_MCP_SERVER TO ROLE YOUR_ROLE; GRANT USAGE ON DATABASE YOUR_DATABASE TO ROLE YOUR_ROLE; GRANT USAGE ON SCHEMA YOUR_DATABASE.YOUR_SCHEMA TO ROLE YOUR_ROLE; ``` Note that `USAGE` on the MCP server does not automatically grant access to the tools configured within it. Each tool (Cortex Search, Cortex Analyst, etc.) requires its own permissions. See [Snowflake MCP server access control](https://docs.snowflake.com/en/user-guide/snowflake-cortex/cortex-agents-mcp#access-control) for details. **Check object name casing** Snowflake converts unquoted identifiers to uppercase. If you created your database, schema, or MCP server with quoted names (for example `"MyDatabase"`), the MCP URL must match that casing exactly. Most setups use unquoted names, so the URL should use uppercase (for example `YOUR_DATABASE.YOUR_SCHEMA.YOUR_MCP_SERVER`). *** ## Additional resources * [Snowflake Cortex MCP server overview](https://docs.snowflake.com/en/user-guide/snowflake-cortex/cortex-agents-mcp) * [Create an OAuth security integration](https://docs.snowflake.com/en/sql-reference/sql/create-security-integration-oauth-snowflake) * [Create MCP server](https://docs.snowflake.com/en/sql-reference/sql/create-mcp-server) * [SHOW MCP SERVERS](https://docs.snowflake.com/en/sql-reference/sql/show-mcp-servers) * [DESCRIBE MCP SERVER](https://docs.snowflake.com/en/sql-reference/sql/desc-mcp-server) * [SHOW GRANTS](https://docs.snowflake.com/en/sql-reference/sql/show-grants) # Storyblok Source: https://docs.dema.ai/guides/agent/integrations/storyblok Let the Dema Agent read and manage stories, components, assets, spaces, and workflows in your Storyblok space when you ask. ## Overview Once Storyblok is connected, the Dema Agent can work with your Storyblok content directly inside a conversation — read and manage stories, components, assets, spaces, and workflows. The agent only acts when you ask it to, and Dema asks you to confirm sensitive changes before they are applied. > [!NOTE] > > This integration uses Storyblok's official hosted MCP server, currently offered through **Storyblok Labs**. Its capabilities may evolve over time. *** ## Prerequisites * A Storyblok account with permission to create a personal access token. * The token must be a **Personal Access Token (Management Token)** — not a Content Delivery API token. The agent manages content, so it needs Management API access. *** ## Connect Storyblok **1. Create a personal access token in Storyblok** 1. In the Storyblok app, go to **My Account → Account settings → Personal access tokens**. 2. Click **Generate Token**. 3. Name the token something recognizable, such as `Dema Agent`. 4. Under **Scopes**, select the scopes the agent needs — Stories, Components, Assets, Spaces, and the workflow-related scopes — or enable **Full user permission** to grant the same access as your own account. 5. Under **Spaces**, choose the spaces the agent should reach (defaults to all spaces you own). 6. Optionally set an **expiration date**. 7. Create the token and copy it now — Storyblok shows it only once. > [!NOTE] > > A token's scopes and spaces cannot be changed after it is created. To adjust them later, generate a new token. **2. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Storyblok**, and click **Connect**. Enter: * **Personal access token** — the token you copied. Click **Add**. Dema marks the integration as Active. *** ## Rotating the key To rotate, generate a new personal access token in Storyblok, click **Reconnect** on the Storyblok integration card in Dema, enter the new token, then delete the old token in Storyblok. *** ## Troubleshooting > [accordion] Dema cannot authenticate > > Make sure the token is a **Personal Access Token (Management Token)** from **My Account → Personal access tokens**, not a Content Delivery API token from a space's access tokens. Only the Management token works here. > [accordion] The agent cannot see a space > > The token only covers the spaces you selected when you created it. Generate a new token with the right space scope and click **Reconnect**. > [accordion] The agent says it is missing a permission > > The token's scopes do not cover the action. Generate a new token with the needed scopes (or **Full user permission**) and reconnect. > [accordion] I lost the token > > Storyblok shows the token only once. Generate a new one and reconnect. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [Storyblok MCP server](https://mcp.labs.storyblok.com/) * [Storyblok access tokens](https://www.storyblok.com/docs/concepts/access-tokens) # Typeform Source: https://docs.dema.ai/guides/agent/integrations/typeform Let the Dema Agent build and manage your typeforms, browse workspaces, and read form responses from Typeform when you ask. ## Overview Once Typeform is connected, the Dema Agent can work with your Typeform account directly inside a conversation — browse workspaces and forms, read responses, and create or update forms. The agent only acts when you ask it to, and Dema asks you to confirm sensitive changes before they are applied. > [!NOTE] > > Typeform's MCP server is in **beta** and its capabilities are still expanding, so some actions may not be available yet. *** ## Prerequisites * A Typeform account with permission to create a personal access token. *** ## Connect Typeform **1. Create a personal access token in Typeform** 1. In Typeform, open the menu next to your username in the top-left corner and click **Account**. 2. In the left menu, click **Personal tokens**. 3. Click **Generate a new token**. 4. Give the token a name you will recognize, such as `Dema Agent`. 5. Select the **scopes** the agent needs (see below). 6. Click **Generate token** and copy it now — Typeform shows it only once. **2. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Typeform**, and click **Connect**. Enter: * **Personal access token** — the token you copied. * **MCP URL** — your region's Typeform MCP URL: US `https://api.typeform.com/mcp` or EU `https://api.eu.typeform.com/mcp`. Click **Add**. Dema marks the integration as Active. > [!NOTE] > > Your data region is fixed by the MCP URL: US accounts use `https://api.typeform.com/mcp`, EU-resident accounts use `https://api.eu.typeform.com/mcp`. Use the URL that matches your Typeform account, or the agent will not reach your data. *** ## Scopes to grant Select these when you create the token so the agent can read and manage your forms: | Scope | What it unlocks | | - | - | | `accounts:read` | Read basic account info | | `workspaces:read` | List and read workspaces | | `forms:read` | List and read forms | | `forms:write` | Create and update forms | | `responses:read` | Read form responses | Add `workspaces:write` or `responses:write` only if you want the agent to manage workspaces or delete responses. *** ## Rotating the key Personal access tokens do not have a documented expiry. To rotate, regenerate the token on the **Personal tokens** page in Typeform (or generate a new one), click **Reconnect** on the Typeform integration card in Dema, and enter the new token. Leave the **MCP URL** as the one you used initially — US `https://api.typeform.com/mcp` or EU `https://api.eu.typeform.com/mcp` — since your data region does not change when you rotate the token. *** ## Troubleshooting > [accordion] Dema cannot authenticate > > Check that you copied the full token and that it has the scopes listed above. If you are unsure, generate a new token with the right scopes and reconnect. > [accordion] The agent cannot see a form or workspace > > The token only covers what its scopes allow. Make sure `workspaces:read`, `forms:read`, and `responses:read` are granted, then reconnect. > [accordion] Dema says the MCP URL is invalid, or the agent finds no data > > Check you entered the URL for your region — US `https://api.typeform.com/mcp` or EU `https://api.eu.typeform.com/mcp` — and that it matches where your Typeform account is hosted. An EU account connected to the US URL (or vice versa) will not return data. > [accordion] I lost the token > > Typeform shows the token only once. Generate a new one on the **Personal tokens** page and reconnect. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [Create a personal access token](https://www.typeform.com/developers/get-started/personal-access-token/) * [Typeform OAuth 2.0 scopes](https://www.typeform.com/developers/get-started/scopes/) * [Typeform MCP server](https://www.typeform.com/developers/get-started/mcp/) # Viametrics Source: https://docs.dema.ai/guides/agent/integrations/viametrics Let the Dema Agent read people-counting visitor data — in/out counts, counter groups, and occupancy — for your stores from Viametrics when you ask. ## Overview Once Viametrics is connected, the Dema Agent can pull live people-counting data from your Viametrics account directly inside a conversation — in/out counts, counter groups, and occupancy for a store, area, or shopping centre. Viametrics is read-only: the agent fetches data, it does not change anything in your Viametrics account. The agent only acts when you ask it to. *** ## Prerequisites * A Viametrics account. * A **ClientID** and an **apiKey** for the ViaCustomerApi. > [!NOTE] > > Viametrics issues API credentials manually — there is no self-serve key page. You request them from Viametrics Support (see below). *** ## Connect Viametrics **1. Request your credentials from Viametrics** Email [support@viametrics.com](mailto:support@viametrics.com) and ask for API access to the **ViaCustomerApi**. They will send you: * a **ClientID** — a 1–4 digit number that identifies your company, and * an **apiKey** — a secret string. **2. Connect in Dema** In Dema, go to **Agents → Settings → Integrations**, find **Viametrics**, and click **Connect**. In the **ClientID:apiKey** field, paste your ClientID and apiKey joined by a colon, with no spaces: ```text theme={null} ClientID:apiKey ``` For example: `1234:a1b2c3d4e5...` Click **Add**. Dema marks the integration as Active. > [!NOTE] > > There is a single field — combine both values into one string separated by a colon. *** ## Rotating the key Ask Viametrics Support for new credentials, then click **Reconnect** on the Viametrics integration card in Dema and enter the new `ClientID:apiKey` string. *** ## Troubleshooting > [accordion] Dema cannot authenticate > > Check the format. The **ClientID:apiKey** field must contain your ClientID and apiKey joined by a single colon with no spaces, for example `1234:a1b2c3d4e5...`. Both halves must be present. > [accordion] The agent's Viametrics requests are failing > > Viametrics rate-limits the API. If the agent makes many requests in a short window, some may be throttled — ask narrower questions, or wait and retry. If you are still stuck, contact [support](mailto:info@dema.ai) with the error message you see. *** ## Additional resources * [ViaCustomerApi documentation](https://apidocs.viametrics.com/) * [Viametrics support](https://support.viametrics.com/hc/en-us) # Overview Source: https://docs.dema.ai/guides/agent/overview Use the Dema Agent to explore your data, build reports and dashboards, and automate recurring work. The **Dema Agent** is an AI analyst built into Dema. Ask a question in plain language to explore your data, create a chart or table, build a dashboard, or write an analysis. *** ## Your first conversation Open **Agents** and enter a question: Show me revenue by channel for the last 4 weeks. How does it compare to the same period last year? Show me revenue by channel for the last 4 weeks. How does it compare to the same period last year? If you are not sure where to start, choose one of the suggested prompts. Conversations are saved, so you can return and continue where you left off. The agent keeps the earlier messages as context for follow-up requests such as "Now break that down by market." > [!TIP] > > Keep related questions in one conversation, and start a new one when you switch topics. *** ## The message box The message box also lets you attach files, select tools, dictate messages, and choose a model: | Feature | How to use it | | - | - | | Attach files | Select **+**, paste a file, or drag it into the message box. Each spreadsheet, CSV, image, or PDF can be up to 10 MB. | | `@` menu | Search integrations, apps, and files in the current session. See [Files and memory](/guides/agent/files-and-memory). | | `/` menu | Run a [skill](/guides/agent/skills) or open an [app](/guides/agent/apps). | | Dictation | Select the microphone and speak instead of typing. Your browser must have microphone permission for Dema. Dictation recognizes English, Swedish, Norwegian, Danish, German, French, Italian, and Spanish, and you can switch language mid-dictation. Dictation stops automatically after 6 minutes and keeps the text heard so far. | | Model picker | Choose the AI model for the conversation, or keep the default. | The `@` and `/` menus also work in instruction fields, such as routine instructions, agent instructions, Settings instructions, and skill bodies. Files are not available there because those inputs are not tied to a conversation. *** ## Model selection The model picker in the message box lets you choose the AI model for your conversation. You can select a specific model or use **Auto**. ### Auto model selection Auto picks a model for you at each turn depending on the task complexity: a quick lookup gets a light model; a turn that needs deeper reasoning gets a stronger one. Based on our internal benchmarking, Auto is the better default for: * **Short sessions - under \~7 turns.** One-off questions, ad-hoc analysis, exploration. Around **20% cheaper** than typical current usage with same response quality. Single-question sessions save the most, closer to 40%. * **Sessions where difficulty varies turn to turn** - a few demanding turns among lighter ones. For **longer iterative work** - building an app, refining a skill, developing an analysis over many turns - we recommend choosing one model and staying with it for the session. These conversations build up shared context, and changing model mid-thread means rebuilding it, which costs more than the per-turn saving is worth. *** ## The workspace panel The workspace panel on the right has two tabs: * **Workspace** shows the agent's plan and the charts, tables, or apps it creates. * **Files** shows the agent's files and the outputs from the current conversation. See [Files and memory](/guides/agent/files-and-memory). *** ## Competitor ad research The agent can look up a competitor's public ads in the Meta (Facebook and Instagram) Ad Library and the TikTok Ads Library. Search by brand name or keyword, and narrow the results by country and date. For Meta ads, you can also filter by active or inactive status. These are built-in tools, so you don't need to connect an integration. Which Meta and TikTok ads has Acme been running in Sweden over the last 30 days? Summarize their main messages and formats. Which Meta and TikTok ads has Acme been running in Sweden over the last 30 days? Summarize their main messages and formats. For some ads, the agent can also return details such as reach or impressions by region. > [!NOTE] > > Reach and demographic breakdowns are only available for ads shown in EU countries or the UK. *** ## Instructions Instructions tell the built-in assistant how to respond. Use them for language, formatting, or company-specific guidelines that should apply to every conversation. Manage them at **Agents → Settings → Instructions**. Yours are private by default; share one and your teammates can enable it too. Keep instructions short and direct, for example: "Always report in EUR" or "Round percentages to one decimal." Use a [skill](/guides/agent/skills) instead when the guidance applies only to a particular task. > [!NOTE] > > [Agents you create](/guides/agent/your-agents) also have their own instructions, set in their configuration. Those belong to one agent; the instructions here apply to all. *** ## Going further > [card] [Your agents](/guides/agent/your-agents) > > Create agents with their own instructions, files, and routines. > [card] [Routines](/guides/agent/routines) > > Schedule agents, app updates, and standalone instructions. > [card] [Skills](/guides/agent/skills) > > Teach agents reusable workflows. > [card] [Files and memory](/guides/agent/files-and-memory) > > Give agents files to work with, and see what they remember. > [card] [Apps](/guides/agent/apps) > > Build interactive tools that you can use again. > [card] [Integrations](/guides/agent/integrations/overview) > > Connect Slack, Shopify, Snowflake, and more. > [card] [Sharing](/guides/agent/access-and-sharing) > > Share agents and sessions with your team. *** ## Getting good answers 1. Ask a specific question. "Show revenue by channel for the last four weeks" is clearer than "How is revenue doing?" 2. Include the comparison or business context you need, such as "Compare it with the same period last year." 3. Use follow-up messages to refine the result. The agent keeps the earlier messages as context. # Quality and evaluation Source: https://docs.dema.ai/guides/agent/quality How we monitor the quality of the Dema agent. To ensure the top quality of the Dema agent, we continuosly monitor its performance in production and measure the agent's behaviour offline before any significant changes in the system. *** ## Testing before the major changes Before going live with a large change - a new model, capability, or a change in how the agent works - we evaluate the agent on a benchmark of scenarios that mirror how the Dema users interact with it: asking deep analytical questions, creating apps and dashboards, maintaining longer conversations where the goal takes shape over several messages. We grade the responses using a set of criteria: did the agent actually solve the problem, did it use the correct data and produce accurate conclusions, did it follow the internal rules, and did it stay consistent across the conversation. New models are compared side by side on identical scenarios before we adopt them. ## Monitoring in production Quality is also measured continuously in production, where we track the trend of the performance and investigate anything that falls short, ensuring the high quality of the platform. > [!NOTE] > > If an answer ever looks inaccurate, use the thumbs down on the message. The feedback is stored with the > conversation and helps the team find cases to review. # Routines Source: https://docs.dema.ai/guides/agent/routines Schedule agents, app updates, or standalone instructions to run automatically. A **routine** runs a task automatically on a daily or weekly schedule. Use routines for work that should happen consistently, such as reviewing stock every morning, updating a performance app each day, or preparing a channel summary every Monday. Each run creates a session that you can open, review, and continue when the agent needs input. *** ## What a routine can run When you create a routine, choose what it should schedule: | Type | How it works | Best for | | - | - | - | | **Agent** | Runs one of your agents. It uses that agent's model, skills, integrations, and tool permissions. Add an optional instruction to give it a specific task on every run. | Recurring work that needs a configured agent and its resources. | | **App** | Updates an app using its update setup. Add an optional instruction to refine what each update should do. | Keeping an app's data and outputs current. | | **Custom instruction** | Runs a standalone prompt without creating a separate agent. Give the routine a name, instruction, and model. | A focused scheduled task that does not need its own conversational agent. | Only apps that support background updates can be selected. If an agent is still a draft, add instructions to the agent before creating its routine. *** ## Create a routine Go to **Agents → Routines** and select **Add**. **1. Choose what to schedule** Select an agent or app, or select **Write a custom instruction**. **2. Write the instruction** Describe what should happen on every run. The instruction is optional for an agent or app because the routine can use its existing setup. Type `/` to reference a skill or app, or `@` to reference an integration. The mention resolves to the current resource on every run. **3. Set the schedule** Choose **Daily** or **Weekly**, then select the day and time. Times follow your organization's timezone. **4. Review connections** Dema checks which integrations the task may need. Connect any missing accounts shown under **Approvals**. **5. Create the routine** Leave the status **Active** to start automatic runs, or set it to **Paused** to finish the setup without scheduling a run. You can also create a routine from an agent's **Configuration** tab or an app's **Updates** tab. The agent or app is selected automatically when you start there. > [!NOTE] > > The target cannot be changed after a routine is created. Create a new routine if you want to run a different agent or update a different app. *** ## Review actions and approvals After you create a standalone or app routine, Dema runs a setup check to identify the actions it may take. It checks again when you change what the routine should do. The check does not carry out write actions. While it runs, the routine has the **Configuring** status. ### Custom instruction routines Open **Approvals** to control each action used by a custom instruction routine: | Setting | What happens during a run | | - | - | | **Run automatically** | The action can run without waiting for you. | | **Ask before running** | The session pauses and waits for someone to approve or reject the action. | | **Blocked from running** | The routine cannot use the action. | ### App routines For an app routine, **Approvals** lists the actions that Dema identified during its setup check. Actions needed for the app's update are automatically allowed. If an action or connection is unavailable, follow the link in the routine to review the app or tool setup. ### Agent routines For a routine that runs an agent, tool permissions are managed in the agent's configuration instead. Select **Managed by *agent name*** under **Approvals** to open them. > [!WARNING] > > Scheduled runs use the routine owner's connected accounts. Only the owner can connect a missing account for a routine. *** ## Monitor runs The **Routines** page shows each routine's status, schedule, and latest activity. Use search, ownership, and status filters to find a routine, then select it to open its details. | Status | Meaning | | - | - | | **Active** | The routine is ready for its next scheduled run. | | **Configuring** | Dema is checking the routine's integrations and actions. | | **Running** | A run is in progress. | | **Paused** | Automatic runs are turned off. | | **Failing** | Recent runs have failed. Open the latest session to investigate. | | **Needs attention** | The routine needs a setup change or was paused automatically, for example because a connection needs to be restored. | A dot next to a routine means its latest run needs input. Open the session to answer a question or review an approval. Agent routines appear in the agent's **Sessions** tab. For app and custom routines, open the routine to see its recent runs. You can also select **Run now** to start a saved routine immediately. > [!NOTE] > > If three consecutive runs fail or remain waiting for input, Dema pauses the routine automatically. Review the recent runs, fix the issue, then set the routine back to **Active**. > > If a routine's owner is no longer a member of your organization, Dema pauses the routine at its next scheduled run instead of retrying. The routine cannot run again until another member recreates it, for example by duplicating it, so that it runs under their own connected accounts. *** ## Manage a routine Open a routine to change its status, instruction, schedule, or model when available. Changes to its approvals save automatically; other changes take effect when you select **Save**. The actions menu also lets you: * Duplicate the routine. * Change its visibility. * Review or restore an earlier version. * Copy a direct link. * Delete the routine. Changing a routine's visibility does not change the visibility of its linked agent or app. See [Access and sharing](/guides/organization/access-and-sharing) for the general visibility rules. # Skills Source: https://docs.dema.ai/guides/agent/skills Create reusable instructions and reference files for tasks your agents perform regularly. A **skill** contains instructions for a particular task, such as a weekly channel review, stock health check, or executive summary. It can also include reference files or scripts. The agent loads the skill when your request matches its description. Write a skill once, then enable it wherever you want agents to use that workflow. If you catch yourself explaining the same process twice, it probably belongs in a skill. *** ## Skills vs. instructions Both shape how agents behave. The difference is when they apply: | | Instructions | Skills | | - | - | - | | **When they apply** | Always, in every conversation | When the task calls for it | | **Best for** | Tone, language, formatting, company-wide rules | Workflows, analysis templates, task-specific knowledge | | **Made of** | A short text | Instructions plus optional files | Rule of thumb: if it should apply to **every** message, it's an instruction. If it applies to a **type of task**, it's a skill. *** ## What's in a skill | Part | Purpose | | - | - | | Name and description | Tells the agent what the skill does and when to use it. The description determines when the skill is loaded. | | Instructions | Defines the steps, data, and output for the task. | | Files (optional) | Provides reference documents, data, scripts, or images used by the instructions. | Every skill also gets a **slug**, like `/weekly-channel-review`. Type it in the message box to run the skill directly. *** ## Where skills live Go to **Agents → Settings → Skills**. Skills are grouped by owner: | Group | What it contains | | - | - | | **My skills** | Skills you created | | **Shared with me** | Skills created and shared by teammates | | **Dema skills** | Built-in skills that you can use but not edit | Use the toggle to enable a skill for the built-in assistant. An enabled skill loads automatically when its description matches your request. Agents you create have their own skill settings; see [Skills and your agents](#skills-and-your-agents). *** ## Creating a skill Select **New skill**, then choose how to create it: > [tab] Create with agent > > The agent asks about the task, then drafts the skill for you to review. Describe the result you want: > > Create a skill for weekly channel performance reviews: analyze the last 8 weeks by channel, compare week over week, and recommend which channels to scale or investigate. > > Create a skill for weekly channel performance reviews: analyze the last 8 weeks by channel, compare week over week, and recommend which channels to scale or investigate. > [tab] Write skill instructions > > Enter the name, description, and instructions yourself. In the instructions, type `/` to reference another skill or an app, or `@` to reference an integration. > [tab] Upload a skill > > Import an exported `.skill` file. See [Moving skills around](#moving-skills-around). If the slug already exists, Dema asks how to handle it. New skills are **private**. Use the visibility control to share a skill with a team or your organization. See [Sharing a skill](#sharing-a-skill). ### Adding files to a skill Open a skill you own and select **+** in the files sidebar. Dema stores documents in `references/`, scripts in `scripts/`, and images or media in `assets/`. Select a file to preview it. A skill with files looks like this: **SKILL.md** **references** **price-list-2026.csv** **margin-definitions.md** **scripts** **weekly\_report.py** **assets** **report-template.png** `SKILL.md` contains the skill's name, description, and instructions. Other files provide material the agent needs for the task, such as a current price list or an analysis script. Open the skill's actions menu and select **Version history** to browse past versions and restore one. Each version snapshots the skill's files, so restoring an earlier version brings back the files that were attached at that time. *** ## Using a skill A skill can load automatically or on request: | Method | How it works | | - | - | | Automatic | The agent loads an enabled skill when its description matches your request. | | Manual | Type `/` in the message box and select the skill, or select **Try in chat** from the skill page. | *** ## Skills and your agents The built-in assistant uses the skills you enable in Settings. This choice applies only to you. [Agents you create](/guides/agent/your-agents) have a **Skills** section in their configuration. Add a skill from your library or write one for that agent. Everyone who uses the agent can use its skills through the agent. When you add a private skill to a shared agent, everyone who can use the agent may also be able to use that skill through it. Dema shows who gains access before you confirm. See [Sharing agents and sessions](/guides/agent/access-and-sharing). *** ## Sharing a skill A skill can be visible to just you (**private**), to specific **teams**, or to **everyone** in your organization. Only the owner can change this from the skill's visibility control. People who can use an agent can also edit the skills linked to it, even if they don't own them. They can update the instructions and files or revert to an earlier version, but only the owner can change visibility or delete the skill. See [Access and sharing](/guides/agent/access-and-sharing#what-people-can-use-through-a-shared-agent). Narrowing a shared skill back down warns you if people would lose access through agents that use it. See [Access and sharing](/guides/organization/access-and-sharing) for the general model. *** ## Moving skills around Export a skill to move it to another organization or keep a backup. The `.skill` file includes its instructions and attached files. To import one, select **New skill → Upload a skill**. If the slug already exists, Dema asks how to handle it. *** ## Writing a good skill Write only the task-specific guidance the agent needs: * **Describe when to use it.** "Analyze campaign profitability across channels. Use when asked to evaluate campaigns or reallocate marketing spend" is clearer than "A skill about campaigns." * **Define the task.** Include the steps, required definitions, and expected output. * **Keep one job per skill.** Split unrelated tasks into separate skills. * **Remove general advice.** Keep information that is specific to your organization or workflow. If you need help drafting the skill, use **Create with agent** and edit the result before saving it. # Your agents Source: https://docs.dema.ai/guides/agent/your-agents Create agents with their own instructions, skills, files, integrations, and routines. You can create agents for recurring tasks in addition to using the built-in assistant. Each agent has its own instructions, skills, files, integrations, and routines. A few examples: * A **Stock Health Advisor** that reviews inventory every morning and flags stockout and overstock risks. * A **Weekly Channel Reviewer** that writes a channel performance summary every Monday. * A **Support Digest** agent that reads yesterday's tickets and summarizes the themes. *** ## Create an agent In the **Agents** section, click **Create agent**. Two ways to start: > [card] Create with agent > > Describe the task in a conversation. The agent asks for the information it > needs, drafts its configuration, and lets you review it. > [card] Configure manually > > Skip the interview and fill in the configuration yourself. Both options create the agent immediately. Select its name to rename it or change its icon. *** ## Sessions and configuration An agent's page has two tabs. **Sessions** contains every conversation and scheduled run for the agent. Open a session to read it. You can also: * Select **Ask agent** to start a conversation. * Select **Run now** to run the agent from its instructions without entering a message. Use **Configuration** to manage how the agent works. *** ## Configuration ### General Manage the agent's name, icon, default model, visibility, and owner. * **Default model:** The model the agent uses unless someone chooses another model in a conversation. * **Visibility:** Who can access the agent: only you, specific teams, or everyone in your organization. See [Sharing agents and sessions](/guides/agent/access-and-sharing) before sharing an agent that uses private resources or connected accounts. * **Owner:** The person who can change the agent's configuration and share it. To hand the agent to another member of your organization, select the **Owner** row and pick the new owner. Dema previews what moves with the agent, which connections the new owner needs to reconnect, and whether you lose access. See [Transfer ownership](/guides/agent/access-and-sharing#transfer-ownership). Use **Version history** in the agent's actions menu to browse past versions and restore one. Each version snapshots the agent's files, so restoring an earlier version brings back the files that were attached at that time. ### Instructions Instructions describe the agent's role, process, and expected output. **Create with agent** drafts them for you, and you can edit them after saving. A useful structure is **Role** for its purpose, **Playbook** for the steps it follows, and **Output format** for the result it should produce. Type `/` to reference a skill or app, or `@` to reference an integration. This is the same as in the message box, so the agent recognizes the resource when it runs. > [!NOTE] > > These instructions apply only to this agent. Put shared rules for language and formatting under **Agents → Settings → Instructions**. See the [Overview](/guides/agent/overview#instructions). ### Files The agent's shared files and memory. See [Files and memory](/guides/agent/files-and-memory). ### Skills Add reusable workflows from your library or write a skill for this agent. See [Skills](/guides/agent/skills). ### Apps View apps the agent created and apps linked from your library. See [Apps](/guides/agent/apps). ### Integrations Connect services such as Slack, Shopify, or Gmail. Reuse an existing connection or authorize a new one, then set the allowed actions for each tool. Two ways to take an integration away: * **Unlink** removes it from this agent only. * **Disconnect** deletes the connection everywhere it's used. ### Tool permissions When an agent asks to use a tool, you can approve it once, always approve it, or block it. Saved choices appear under **Always approved**, **Manual approval**, and **Blocked** at the bottom of the configuration page. You can reset any choice to its default. *** ## Routines A [routine](/guides/agent/routines) runs an agent automatically on a daily or weekly schedule. In the agent's **Configuration** tab, find **Routines** and select **Add routine**. An agent can have more than one routine. Each routine can use a different schedule and optional instruction, and each run appears as a new session in the agent's **Sessions** tab. > [!TIP] > > Create the routine from an [app's](/guides/agent/apps) **Updates** tab when every run should update that app. # Authentication Source: https://docs.dema.ai/guides/api-access/authentication Learn how to obtain API keys and authenticate your requests to the Dema's GraphQL API. ## Getting an API Key > [!NOTE] > > API access is not enabled by default. To get started, reach out to your > Customer Success team to have API access enabled for your account. To access the GraphQL API, users must obtain an API key from their Dema account settings. Follow these steps: 1. Navigate to **Settings** in the Dema Application. 2. Locate the **API Keys** section. 3. Generate an API key and configure its expiration and scopes/access level. 4. Copy the generated API key for use in your requests. (**Note:** The API key is only visible once when it is generated. If you lose it, you will need to generate a new one.) ## Using Your API Key Authentication is required for all requests and must be passed via the `Authorization` header: ``` Authorization: Bearer API_KEY ``` ### Example Request Here's how to include the key in a cURL request: ```bash theme={null} curl -X POST https://api.dema.ai/graphql \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{ "query": "query OrganizationInfoQuery { account { id name } }" }' ``` > [!WARNING] > > Keep your API keys secure and never expose them in client-side code or public > repositories. Treat API keys like passwords—rotate them regularly and revoke > any keys that may have been compromised. ## Best Practices * **Setting expiration**: When the API usage is limited to a specific time frame, it's a good idea to set an expiration date, to avoid forever lasting API keys. * **Scopes**: Set appropriate access levels/scopes for each key, and avoid granting more access than necessary. * **Revocation**: Immediately revoke any tokens that may have been exposed or compromised, this can be done in the API key settings by either deactivating the key or deleting it. ## API key policies * Any updates to API key configuration like status changes (active/inactive), last usage, expiration, or scope changes are reflected in real usage after a few minutes. * API keys are automatically removed if they are inactive and there hasn't been any activity on them in the last 60 days. * API keys are removed 7 days after they expire. # Endpoints Source: https://docs.dema.ai/guides/api-access/endpoints Learn about the Dema API endpoint URL and how to make requests. ## API Endpoint The GraphQL API is accessible via: **Endpoint URL:** `https://api.dema.ai/graphql` ## Request Format All requests should be sent as **POST** requests to this endpoint with your GraphQL queries in the request body. ### Request Headers Include the following headers in your requests: * `Content-Type: application/json` * `Authorization: Bearer YOUR_API_TOKEN` (see [Authentication](/guides/api-access/authentication) for details) ### Request Body The request body should contain a JSON object with your GraphQL query: ```json theme={null} { "query": "query YourQuery { ... }", "variables": { // optional variables } } ``` > [!NOTE] > > All GraphQL queries are sent to the same endpoint. The query itself determines > what data is returned. # Examples & Usage Source: https://docs.dema.ai/guides/api-access/examples Practical examples for querying the Dema API, including organization information, definitions, and statistics data. ## Fetching Organization Information To retrieve your organization information and available frontends: ```graphql theme={null} query OrganizationInfoQuery { account { id name sites { frontendId name } __typename } } ``` The `sites` array contains your frontend information (frontendIds), which you'll need when querying statistics data. ## Fetching Definitions To retrieve the available [metrics](/guides/fundamentals/metrics), [dimensions](/guides/fundamentals/dimensions), and [attributionModels](/guides/fundamentals/attribution) for your organization: ```graphql theme={null} query DefinitionsQuery { account { metrics { id label description groupId groupLabel format dependencies metricVariants { id type dependencies } } dimensions { id label description processors groupId groupLabel format } attributionModels { id label description } __typename } } ``` These definitions can be used to construct your statistics queries by selecting the metrics and dimensions to use in your query. ## Fetching Statistics Data The insights query allows you to retrieve aggregated statistics based on selected dimensions and metrics: ```graphql theme={null} query InsightsQuery($insightsParams: InsightsInput!) { account { id name insights(params: $insightsParams) { data { dimensions metrics } pageInfo { pageSize offset hasNextPage } __typename } __typename } } ``` **Example Variables** ```json theme={null} { "insightsParams": { "frontendIds": ["DV-frontendId1", "DV-frontendId2"], "startDate": "2025-11-02T23:00:00.000Z", "endDate": "2025-12-02T22:59:59.999Z", "dimensions": ["channelGroup", "channel", "product"], "metrics": ["session:count", "session:duration", "product:inventoryValue"], "filter": {}, "compareStartDate": "2025-01-05T23:00:00.000Z", "compareEndDate": "2025-02-02T22:59:59.999Z", "aggregateDimensions": ["day"] } } ``` The `insightsParams` object accepts the following parameters: * **`frontendIds`** (array of strings): List of frontend IDs to query data for * **`startDate`** (ISO 8601 string): Start date for the data range * **`endDate`** (ISO 8601 string): End date for the data range * **`dimensions`** (array of strings): Dimensions to group data by (e.g., `channelGroup`, `channel`, `product`) * **`metrics`** (array of strings): Metrics to retrieve (e.g., `session:count`, `session:duration`, `product:inventoryValue`) * **`filter`** (object): Optional filters to apply to the data * **`compareStartDate`** (ISO 8601 string, optional): Start date for comparison period * **`compareEndDate`** (ISO 8601 string, optional): End date for comparison period * **`aggregateDimensions`** (array of strings, optional): Additional dimensions for aggregation (e.g., `day`, `week`, `month`) ## Pagination The insights endpoint supports pagination through the `pageInfo` object in the response: * **`pageSize`**: Number of records per page * **`offset`**: Current offset for pagination * **`hasNextPage`**: Boolean indicating if more data is available > [!TIP] > > For large datasets, we recommend using paginated queries to efficiently > retrieve all data. Implement pagination logic in your client to fetch all > pages when `hasNextPage` is `true`. ## Complete cURL Example Here's a complete example of how to make a request using cURL: ```bash theme={null} curl -X POST https://api.dema.ai/graphql \ -H "Content-Type: application/json" \ -H "Authorization: Bearer YOUR_API_KEY" \ -d '{ "query": "query InsightsQuery($insightsParams: InsightsInput!) { account { id name insights(params: $insightsParams) { data { dimensions metrics } pageInfo { pageSize offset hasNextPage } } } }", "variables": { "insightsParams": { "frontendIds": ["DV-frontendId1", "DV-frontendId2"], "startDate": "2025-11-02T23:00:00.000Z", "endDate": "2025-12-02T22:59:59.999Z", "dimensions": ["channelGroup"], "metrics": ["session:count"] } } }' ``` ## Integration Tips * **Error Handling**: Implement proper error handling for authentication failures, rate limits, and query errors * **Caching**: Consider caching frequently accessed data to reduce API calls and improve performance * **Date Formats**: Always use ISO 8601 format for dates (e.g., `2025-11-02T23:00:00.000Z`) * **Frontend IDs**: Use the `OrganizationInfoQuery` to programmatically retrieve your frontend information (frontendIds) # Overview Source: https://docs.dema.ai/guides/api-access/overview Introduction to Dema's API for accessing your business and statistical data programmatically. We provide a GraphQL-based API interface to access business and statistical data programmatically. You can retrieve statistics (the analytical data), dimensions, metrics, markets, and attribution models to gain insights into your performance. For more information about what these mean, please refer to our [fundamentals documentation](/guides/fundamentals). > [!NOTE] > > The GraphQL API gives you programmatic access to all the data available across > your reports and dashboards—just as you see it in the Dema Application. You > can use the API to fetch your data and integrate it seamlessly into your > workflows, custom dashboards, reporting tools, etc. ## Getting Started To start using the Dema API, you'll need to: 1. [Understand the endpoint](/guides/api-access/endpoints) and how to make requests 2. [Set up authentication](/guides/api-access/authentication) to get and use API tokens 3. [Review rate limits](/guides/api-access/rate-limits) for usage constraints 4. [Understand versioning and deprecation](/guides/api-access/versioning) policies 5. [Explore examples](/guides/api-access/examples) for practical usage # Rate Limits Source: https://docs.dema.ai/guides/api-access/rate-limits Understand rate limits for the Dema API and how to handle them. ## Overview To ensure fair usage and system stability, the API enforces rate limits. We implement a leaky bucket algorithm to limit the number of requests per second. The current rate limits are configured as follows: * **Rate**: 30 requests per second (You can make up to **30 requests per second** on average) * **Burst**: 60 requests (You have a **burst capacity of 60 requests** that can be used when needed) * **Period**: 1 second (The rate limit window resets every **1 second**) This allows for short bursts above the average rate (up to 60 requests) while maintaining a steady average rate of 30 requests per second over time. If you exceed the burst capacity, requests will be rate limited until capacity becomes available again. > [!WARNING] > > The rate limits are applied per API key. > You can see the rate limit status in the API response by checking the `extensions.rateLimit` field. ## Handling Rate Limits If you encounter rate limit errors, implement exponential backoff in your client applications. This means: 1. When you receive a rate limit error, wait before retrying 2. Gradually increase the wait time between retries 3. Continue until the request succeeds or a maximum retry limit is reached ### Example Rate Limit Response When rate limited, the API will return an error response indicating the limit has been exceeded. The response includes detailed information about the rate limit status in the `extensions` field: ```json theme={null} { "errors": [ { "message": "Rate limit exceeded....", "extensions": { "code": "RATE_LIMIT_EXCEEDED" } } ], "data": { "account": null }, "extensions": { "rateLimit": { "requestRate": 20, "remaining": 40, "retryAfterMs": 377, "resetAfterMs": 19377 } } } ``` The `extensions.rateLimit` object provides: * **requestRate**: The current request rate (requests per time window) * **remaining**: Number of requests remaining in the current window * **retryAfterMs**: Milliseconds to wait before retrying the request * **resetAfterMs**: Milliseconds until the rate limit window resets ## Best Practices * **Cache requests**: Cache frequently accessed requests to minimize the number of API requests * **Monitor usage**: Track your API usage using the `extensions.rateLimit` field in API responses to stay within limits # Versioning Source: https://docs.dema.ai/guides/api-access/versioning Dema GraphQL API versioning strategy and deprecation practices. ## Overview The Dema GraphQL API follows a **continuous evolution** approach rather than traditional API versioning. We evolve the schema incrementally using additive changes and deprecation, avoiding breaking changes whenever possible. > [!NOTE] > > The Dema API does not use versioned endpoints. All changes are made to the same endpoint while maintaining backward compatibility through deprecation practices. ## Our Versioning Approach The Dema API evolves continuously without version bumps. We make changes by: * **Adding new fields or types** without modifying existing ones * **Adding new enum values** to existing enums * **Deprecating fields** instead of removing them immediately * **Maintaining backward compatibility** so your existing queries continue to work Most API changes are deployed without requiring version updates from your side. ## Changes That Don't Require Versioning The following changes are **non-breaking** and will be deployed without version updates: * Adding new fields or types * Adding new enum values * Making a non-null field nullable (widening the type) * Any additive changes that don't alter existing field signatures **Example: Adding a new field** ```graphql theme={null} type Account { id: ID! name: String! email: String # New field added - your existing queries continue to work } ``` ## Changes That Require Deprecation When we need to make breaking changes, we use deprecation with a migration period. Breaking changes include: * **Changing field names or types** - We deprecate the old field and add the new one * **Removing fields** - Fields are always deprecated before removal * **Changing nullability** - Making a nullable field non-null requires deprecation * **Changing argument types** - Breaking argument changes go through deprecation **Example: Field rename with deprecation** ```graphql theme={null} type Account { id: ID! legacyName: String! @deprecated(reason: "Deprecated: use `name` instead. Scheduled for removal on 2026-06-30.") name: String! } ``` ## Deprecation Policy When we need to remove or replace a field, we follow this deprecation process: ### Deprecation Timeline We maintain deprecated fields for **90 days** before removal. This gives you time to migrate to the new field or structure. ### Deprecation Reason Format All deprecated fields in the Dema API use this standardized format: ``` "Deprecated: use `` instead. Scheduled for removal on ." ``` Every deprecation includes: * The replacement field or approach to use * The exact removal date in YYYY-MM-DD format * Clear guidance on how to migrate ### Example: Deprecation in Practice When we deprecate a field, both the old and new fields are available during the 90-day period: ```graphql theme={null} type Account { id: ID! name: String! legacyName: String @deprecated(reason: "Deprecated: use `name` instead. Scheduled for removal on 2026-06-30.") } ``` During the deprecation period, you can query either field: ```graphql theme={null} query AccountQuery { account { id name # Use this going forward legacyName # Works during deprecation period } } ``` > [!WARNING] > > After the scheduled removal date, deprecated fields are permanently removed from the API. You must migrate to the new fields before the removal date. ## Checking for Deprecations You can check for deprecated fields in the Dema API schema using GraphQL introspection: ```graphql theme={null} query CheckDeprecations { __type(name: "Account") { fields { name isDeprecated deprecationReason } } } ``` This query returns all fields for a type, including which ones are deprecated and their removal dates. You can also use a GraphQL client to check for deprecated fields. > [!TIP] > > All API changes and deprecations will be communicated through relevant mediums. We recommend migrating to new fields as soon as they become available to avoid disruption when deprecated fields are removed. ## Best Practices for API Consumers * **Monitor deprecations**: Use introspection to check for deprecated fields in your queries * **Migrate early**: Start using new fields as soon as they're available * **Test thoroughly**: Verify your application works with new fields before the removal date # Configuring calibration settings Source: https://docs.dema.ai/guides/causal-factor-attribution/configuring-calibrations Step-by-step guide to setting up causal factor attribution calibrations: from reading the benchmark distribution to saving your configuration. ## Accessing calibration settings Navigate to **Settings > Causal factor attribution** in the Dema app to open the calibration configuration panel. ![The attribution settings page showing calibration rules](https://mintcdn.com/demaai/wQXpdu4LOxscg9ZU/images/causal-factor-attribution-settings-overview.png?fit=max\&auto=format\&n=wQXpdu4LOxscg9ZU\&q=85\&s=6bf444eefc6ac546778c8e9a86336fa9) Here you'll see your current calibration rules, source channel groups, and the ability to add, edit, or remove calibrations. *** ## Understanding the benchmark distribution Before setting any multiplier, review the **incremental factor distribution** shown for each channel. This bell curve represents the expected incremental ROAS based on: 1. **Platform-wide experiments** - Dema's benchmark from all finalized incrementality experiments matching the channel 2. **Your own experiments** - If you've run incrementality experiments, they refine the distribution and narrow the curve ![Bell curve distribution with merchant experiments highlighted](https://mintcdn.com/demaai/wQXpdu4LOxscg9ZU/images/causal-factor-attribution-distribution-detail.png?fit=max\&auto=format\&n=wQXpdu4LOxscg9ZU\&q=85\&s=64843877f8bd9d4c3b0bcf91bbe6d0b8) > [!NOTE] > > Even if you haven't run any incrementality experiments yet, Dema provides a benchmarked distribution based on experiments across the platform. This gives you a data-driven starting point rather than guessing. **Reading the bell curve:** * The **peak** represents the most likely incremental ROAS for this channel * A **wide curve** means more uncertainty (fewer or more varied experiments) * A **narrow curve** means high confidence (many consistent experiments) * The **mean** is the recommended calibration starting point You can also switch between reference metrics to view the distribution in terms of: | Reference metric | What it measures | | - | - | | **ROAS** | Incremental return on ad spend (revenue per spend) | | **Gross sales** | Absolute incremental gross sales value | *** ## Adding a calibration rule Click **New calibration** to create a new rule. Each rule targets a specific scope of your marketing data. ![Adding a new calibration rule with scope selectors](https://mintcdn.com/demaai/wQXpdu4LOxscg9ZU/images/causal-factor-attribution-add-rule.png?fit=max\&auto=format\&n=wQXpdu4LOxscg9ZU\&q=85\&s=3ca156e5bf11436e5f88bac9c7563b6b) ### Defining the scope Each calibration rule can be scoped at multiple levels of granularity: * **Channel group** - Marketing category (e.g. Paid Social, Paid Search, Display) * **Channel** - Specific ad platform (e.g. Meta, Google, TikTok) * **Funnel campaign** - Campaign funnel stage (e.g. Lower funnel, Upper funnel) * **Market** - Geographic market (e.g. SE, DE, US) * **Country** - Specific country (e.g. Sweden, Germany) * **Storefront** - Specific storefront (your store identifier) > [!TIP] > > Leave any field set to **All** to apply the rule broadly. For example, setting channel group to "Paid Social" and leaving everything else as All applies the calibration to all paid social channels across all markets. ### Specificity matching When multiple rules could match a data row, the **most specific rule wins**. Specificity is determined by how many fields are set to specific values (not set to All). **Example:** * Rule A: Paid Social / All / All / All with multiplier 0.8 * Rule B: Paid Social / Meta / All / SE with multiplier 0.6 For Meta traffic in Sweden, Rule B applies (more specific). For other paid social traffic in Germany, Rule A applies (only match). *** ## Choosing the calibration type For each rule, select how the calibration is applied: > [card] MTA > > Multiplies the MTA-attributed value by the multiplier. > > **Best for:** Channels where MTA captures the journey well but over- or under-attributes the conversion. > [card] Ad platform > > Uses the ad platform's reported value as the base, then applies the multiplier. > > **Best for:** Channels where ad platform reporting is more reliable than MTA tracking (e.g., limited cookie visibility). ![Selecting calibration type - MTA vs Ad platform toggle](https://mintcdn.com/demaai/wQXpdu4LOxscg9ZU/images/causal-factor-attribution-type-toggle.png?fit=max\&auto=format\&n=wQXpdu4LOxscg9ZU\&q=85\&s=a2696ebba7a66520223f11228b541bd1) *** ## Setting the multiplier Use the **slider** to set the calibration multiplier. The bell curve distribution is shown alongside to help you choose an appropriate value. ![Multiplier slider with the bell curve distribution](https://mintcdn.com/demaai/wQXpdu4LOxscg9ZU/images/causal-factor-attribution-multiplier-slider.png?fit=max\&auto=format\&n=wQXpdu4LOxscg9ZU\&q=85\&s=e6fc89da0afbeb97e3da40af92101969) **Guidelines for setting the multiplier:** | Multiplier | Meaning | When to use | | - | - | - | | **1.0** | No adjustment | MTA values are already accurate | | **\< 1.0** | Reduce contribution | Channel gets more credit than it causally drives (common for retargeting) | | **> 1.0** | Increase contribution | Channel drives more than MTA captures (common for upper-funnel / awareness) | > [!NOTE] > > The benchmark distribution's **mean** is a good default starting point. If you've run your own incrementality experiments and they align with the benchmark, you can be more confident in using the mean. If your results diverge, favor your own experimental data. *** ## Source channel groups Source channel groups are channels that **absorb the redistribution delta** when other channels are calibrated. By default, these are typically: * **Direct** - Direct / type-in traffic * **Other unattributed** - Sessions with no attributed marketing touchpoint When you increase a paid channel's contribution, the same amount is subtracted proportionally from source channels. This ensures daily totals are always conserved. > [!WARNING] > > If the total calibration delta exceeds what source channels can absorb, the system automatically caps adjustments. This prevents any channel from going negative. *** ## Version history Every time you save a calibration configuration, a new **version** is created. You can: * **View previous versions** to see how your calibrations have changed over time * **Restore a previous version** to revert to an earlier configuration * **See who saved each version** for audit purposes ![Version history showing previous calibration configurations](https://mintcdn.com/demaai/wQXpdu4LOxscg9ZU/images/causal-factor-attribution-version-history.png?fit=max\&auto=format\&n=wQXpdu4LOxscg9ZU\&q=85\&s=2ac83ea49954c3d3b48116440ba04b2e) *** ## Saving your configuration After configuring your calibration rules, click **Save** to persist your changes. The new configuration: 1. Is stored as a new version (the previous configuration is preserved in history) 2. Takes effect on the next pipeline run (once a day every morning) 3. Applies to all future attribution calculations until changed again **1. Review your rules** Verify that each calibration rule targets the correct scope and has an appropriate multiplier based on the benchmark distribution or your experiment results. **2. Check source channels** Ensure your source channel groups are configured correctly. In most cases, direct and other unattributed traffic are the right choices. **3. Save** Click **Save** to create a new configuration version. Your changes will take effect on the next scheduled pipeline run. # How Causal factor attribution works Source: https://docs.dema.ai/guides/causal-factor-attribution/how-it-works Learn how Dema uses causal evidence from incrementality experiments and platform-wide benchmarks to correct attribution values and reveal the true impact of your marketing. > [!NOTE] > > Causal factor attribution bridges the gap between **correlation-based attribution** (MTA) and **true incremental impact**. It adjusts your attribution values using real experimental evidence, or Dema's benchmarked incremental factors when no experiments are available yet. ## Why standard attribution isn't enough Multi-touch attribution (MTA) models assign credit based on observed user journeys. While useful, they have two fundamental limitations: 1. **Correlation, not causation** - MTA measures which channels appear in a conversion path, but can't tell you whether those conversions would have happened without the marketing spend. A channel may look highly effective simply because it captures users who were already going to convert. 2. **Click-based tracking** - MTA relies on clickstream data, which means it systematically undervalues impression-based and awareness channels (e.g., display, video, influencer). Channels that build consideration without generating a direct click receive little or no credit, even when they play a significant role in driving conversions. > [!TIP] > > **Key question:** *Is this channel actually driving new sales, or is it just getting credit for sales that would have happened anyway? And are impression-based channels being undervalued?* > > Causal factor attribution answers both questions by adjusting attribution values, whether from MTA or ad platform reporting, with evidence from controlled incrementality experiments. *** ## How it works Causal factor attribution applies **calibration multipliers** to each marketing channel's attributed contribution, using either the MTA value or the ad platform's own reported value as the base. These multipliers are informed by real experimental data and reflect how much of the attributed value is truly incremental. **1. Start with benchmarked incremental factors** Dema maintains a **platform-wide benchmark** of incremental ROAS by channel, built from all finalized incrementality experiments across the platform. Even if your business has never run an experiment, you get a data-driven starting point for each channel based on what Dema has observed across similar channels and markets. This benchmark is displayed as a **bell curve distribution** showing the expected range of incremental impact for a given channel. **2. Refine with your own experiments** As you run incrementality experiments, the distribution **narrows and shifts** to reflect your specific business. Dema uses a Bayesian statistical model that combines the platform-wide benchmark (prior) with your merchant-specific results (likelihood). More experiments with stronger statistical significance contribute more weight. The result: your calibration recommendations become increasingly tailored to your business over time. **3. Set calibration multipliers** Based on the distribution, you set a calibration multiplier for each channel and choose whether to apply it to the MTA value or the ad platform's reported value. For example, if incrementality experiments suggest that Meta social campaigns deliver only 70% of what MTA claims, you'd set a multiplier of 0.7 with MTA-based calibration. For channels where the ad platform's reporting is more reliable than click-based MTA, you can calibrate from the ad platform value instead. **4. Attribution values are adjusted** The system applies your multipliers to the chosen base values (MTA or ad platform). Channels with multipliers below 1.0 have their contributions reduced; channels above 1.0 are increased. **Daily totals are always conserved**: when one channel's contribution changes, the difference is redistributed. ![Overview of the causal factor attribution calibration flow](https://mintcdn.com/demaai/wQXpdu4LOxscg9ZU/images/causal-factor-attribution-overview.png?fit=max\&auto=format\&n=wQXpdu4LOxscg9ZU\&q=85\&s=f5108b599ef42696fd1eaa6c601fe9ea) *** ## Benchmarked incremental factors One of the most powerful aspects of Causal factor attribution is that **you don't need to run experiments to get started**. Dema aggregates results from incrementality experiments across the platform to build a benchmark distribution for each channel. This gives you: * **An expected incremental ROAS range** for channels like Meta, Google, TikTok, and others * **A confidence level** that reflects how much experimental data backs the benchmark * **A starting point for calibration** that's grounded in real causal measurement > [!NOTE] > > The benchmark distribution uses a Bayesian model that weights experiments by their statistical significance (p-value). Experiments with stronger results contribute more to the benchmark. Outliers are filtered using standard statistical methods to keep the distribution robust. As you accumulate your own experiments, the distribution transitions from a broad platform-wide benchmark to a narrow, merchant-specific estimate: | Scenario | Distribution shape | What it means | | - | - | - | | No experiments | Wide bell curve | Based entirely on platform-wide benchmark | | A few experiments | Narrowing curve | Combining benchmark with your early results | | Many experiments | Narrow, precise curve | Driven primarily by your own data | ![Bell curve showing the benchmarked ROAS distribution for a channel](https://mintcdn.com/demaai/wQXpdu4LOxscg9ZU/images/causal-factor-attribution-bell-curve.png?fit=max\&auto=format\&n=wQXpdu4LOxscg9ZU\&q=85\&s=9476ce00034ad4509049171391eed818) *** ## Calibration types Causal factor attribution supports two ways to calibrate a channel: > [card] MTA-based calibration > > Multiplies the existing MTA-attributed contribution by your chosen factor. > > **Use when:** You trust the relative distribution of MTA values across campaigns and just want to scale the channel's total contribution up or down. > > **Example:** MTA says Meta drove €10,000 in gross sales. With a 0.7 multiplier, the calibrated contribution becomes €7,000. > [card] Ad platform-based calibration > > Replaces the MTA value with the ad platform's own reported value, then applies the multiplier. > > **Use when:** The ad platform's reported metrics are a better starting point than MTA (e.g., for channels where Dema's tracking has limited visibility). > > **Example:** Meta reports €12,000 in attributed sales. With a 0.6 multiplier, the calibrated contribution becomes €7,200. *** ## Total conservation When calibration changes a channel's contribution, the system ensures that **daily totals remain constant**. The difference (delta) is redistributed to designated **source channels**, typically direct and other unattributed traffic. > [!WARNING] > > This conservation principle means calibration doesn't change your total reported revenue or profit. It only changes **how that total is distributed across channels**. If Meta's share goes up, direct's share goes down by the same amount. **Why source channels absorb the delta:** * Direct and unattributed channels capture organic traffic * Their contribution is inherently less certain than paid channel attribution * Redistributing to these channels is the most conservative approach If the delta exceeds what source channels can absorb, the system automatically caps the adjustment to prevent any channel from going negative. *** ## How it connects to other Dema features Causal factor attribution works alongside Dema's other measurement tools: | Feature | Role | Relationship | | - | - | - | | [Attribution models](/guides/fundamentals/attribution) | Provide the base MTA values that get calibrated | Input to causal factor attribution | | [Incrementality testing](/guides/incrementality-testing/how-it-works) | Generate the experimental evidence that informs calibration multipliers | Source of causal evidence | | [Marketing mix modeling (MMM)](/guides/mmm/how-mmm-works) | Models long-term channel effectiveness at a strategic level | Complementary strategic view | | **Campaign-level attribution** | Distributes calibrated channel-level values down to campaign/ad level | Downstream consumer of calibrated values | > [!TIP] > > **Best practice:** Run incrementality experiments on your highest-spend channels first. This gives you the most accurate calibration where it matters most, while relying on benchmarked factors for smaller channels. # Interpreting calibrated attribution Source: https://docs.dema.ai/guides/causal-factor-attribution/interpreting-results Understand how calibrated attribution changes your channel mix, read before-and-after comparisons, and know when to update your calibrations. ## Accessing calibrated attribution Once calibration is configured, a new attribution model called **Dema CFA** (Dema causal factor attribution) becomes available as a selectable option in your reports. You can switch between attribution models to compare calibrated and uncalibrated views of your data. ![Before and after calibration comparison showing channel share shifts](https://mintcdn.com/demaai/wQXpdu4LOxscg9ZU/images/causal-factor-attribution-before-after.png?fit=max\&auto=format\&n=wQXpdu4LOxscg9ZU\&q=85\&s=e800bd68486f1b50e92825cba45713cb) *** ## Before vs after calibration Once calibration is applied, your attribution data reflects **causally adjusted contributions** rather than raw MTA or ad platform-reported values. The key changes to look for: * **Channel contribution shares** shift to reflect true incremental impact * **Source channels** (direct and other unattributed traffic) absorb the redistribution delta * **Daily totals remain unchanged** - only the distribution across channels changes *** ## Example walkthrough Consider a merchant with the following daily attribution (using MTA as the base in this example): | Channel | MTA Gross Sale | Share | | - | - | - | | Meta | €10,000 | 40% | | Google | €8,000 | 32% | | Direct | €5,000 | 20% | | Other | €2,000 | 8% | | **Total** | **€25,000** | **100%** | After running an incrementality experiment, the merchant discovers that Meta's true incremental ROAS is about 70% of what MTA attributes. They set a calibration multiplier of **0.7** for Meta (MTA-based). **After calibration:** | Channel | Calibrated Gross Sale | Share | Change | | - | - | - | - | | Meta | €7,000 | 28% | -12pp | | Google | €8,000 | 32% | - | | Direct | €7,143 | 28.6% | +8.6pp | | Other | €2,857 | 11.4% | +3.4pp | | **Total** | **€25,000** | **100%** | - | > [!NOTE] > > The €3,000 reduction from Meta is redistributed proportionally to Direct and Other (the source channels), based on their original gross sale shares. The daily total of €25,000 is preserved exactly. **What this tells you:** * Meta was previously over-credited by about 30% according to the incrementality experiment * Direct and organic traffic were contributing more than MTA suggested * Budget optimization decisions based on calibrated values will be more accurate *** ## Downstream effects Calibrated channel-level contributions flow into **campaign-level attribution**. This means: 1. **Channel-level calibration** adjusts the total contribution for each channel (e.g., Meta Paid Social) 2. **Campaign/ad-level distribution** uses MTA patterns within that channel to allocate the calibrated total across individual campaigns, ad sets, and ads This gives you granular, campaign-level attribution that reflects causal incremental impact, not just MTA correlation patterns. ![Flow from channel-level calibration to campaign-level attribution](https://mintcdn.com/demaai/wQXpdu4LOxscg9ZU/images/causal-factor-attribution-downstream-flow.png?fit=max\&auto=format\&n=wQXpdu4LOxscg9ZU\&q=85\&s=bd4316cdfe3e1553200cde379bc59e70) *** ## Comparing ROAS metrics With Causal factor attribution enabled, you can compare multiple views of channel performance: | Metric | What it reflects | Source | | - | - | - | | **MTA ROAS** | Correlation-based return on ad spend | Multi-touch attribution model | | **Ad platform ROAS** | Platform's self-reported return | Meta, Google, TikTok dashboards | | **Calibrated ROAS** | Causally adjusted return on ad spend | Causal factor attribution | | **Incremental ROAS** | Experimentally measured return from a single experiment | Incrementality experiments | > [!TIP] > > **Incremental ROAS** is a snapshot from a specific experiment run over a fixed time period. It gives you high-confidence causal evidence, but only for that moment in time. **Calibrated ROAS** extends that knowledge into your ongoing attribution, so you can make day-to-day budget decisions grounded in causal evidence without needing to run a new experiment every day. *** ## When to recalibrate Your calibration settings should be reviewed and updated when: > [card] New experiment results > > After completing an incrementality experiment, check whether the results change the benchmark distribution. If the distribution shifts meaningfully, update your multiplier. > [card] Market changes > > Significant changes in your market (new competitors, seasonal shifts, or major campaign strategy changes) can affect how incrementally effective your channels are. > [card] Quarterly reviews > > Even without new experiments, reviewing calibrations quarterly ensures they still align with your business reality and haven't drifted. > [card] New channels > > When you add a new marketing channel, check the benchmarked distribution and set an initial calibration. Plan an incrementality experiment to validate. *** ## Improving accuracy over time The more incrementality experiments you run, the more accurate your calibrations become: **1. Start with benchmarks** Use Dema's platform-wide benchmarked incremental factors as your initial calibration. This is already better than uncalibrated MTA. **2. Run experiments on high-spend channels** Prioritize incrementality experiments on your largest channels. This is where miscalibration has the biggest budget impact. **3. Update calibrations with results** After each experiment, review the updated distribution and adjust your multiplier. The bell curve will narrow, reflecting increased confidence. **4. Expand to more channels** Gradually run experiments across your channel portfolio. Each experiment improves the overall accuracy of your calibrated attribution. > [!NOTE] > > **The virtuous cycle:** Better calibration leads to better budget allocation, which leads to better business outcomes. Running even a few well-designed incrementality experiments can significantly improve the accuracy of your entire attribution system. # Custom metrics/dimensions Source: https://docs.dema.ai/guides/custom-metrics-dimensions How to do create custom metrics/dimensions To create custom metrics/dimensions in our platform, we currently do not support direct configuration through the user interface. Please contact your customer success representative to discuss your specific needs and explore custom solutions. Our team is dedicated to assisting you in tailoring our analytics to fit your unique requirements. > [!TIP] > > If you're on Shopify and want to turn product tags into custom dimensions, see [Using tag prefixes to create custom dimensions](/integrations/ecommerce/shopify-faq#using-tag-prefixes-to-create-custom-dimensions) for the recommended tag format. # Create dashboards Source: https://docs.dema.ai/guides/dashboards/create-dashboard Learn how to create dashboards in Dema to visualize your data and insights. ## Create new dashboard To create a new dashboard, go to the **Dashboards** page and click **New dashboard**. Give your dashboard a name and optionally add a custom icon to personalize it. [Dashboards Demo](https://demo.arcade.software/i5dShsBSRmeBpRCaOtKW?embed\&embed_mobile=tab\&embed_desktop=inline\&show_copy_link=true) ## Adding widgets to a dashboard Widgets are the building blocks of a dashboard. They allow you to visualize your data in different formats. To add a widget, click **Add widget** or the **+** button in the dashboard. Select the widget type, then click on it to configure its settings and give it a title. ### Chart widget Use a chart widget to display data in a visual format like a bar, line, or pie chart. 1. Select the desired dimensions and metrics from the **Widget data** tab in the right sidebar. 2. Choose the chart type and configure axes from the **Chart settings** tab. ### Table widget Table widgets show your data in a tabular format. After adding a table widget, select the dimensions and metrics you'd like to display from the right sidebar. > [!WARNING] > > Table widgets display up to 20 rows of data. To explore more, click the `...` menu on the widget and select **Explore in report**. ### KPI widget KPI (Key Performance Indicator) widgets highlight important metrics at a glance. After adding a KPI widget: * Select one or more metrics in the right sidebar. * If you add multiple metrics, they will be displayed side by side, in the order you added them. ### Text widget Use a text widget to add explanatory notes, section headers, or descriptions directly in your dashboard. To format the text, you can highlight the text and apply any of the available text formatting options: * Large and small headings (H1, H2, H3) * Bold * Italic * Bullets and numbered lists ## Editing dashboards To edit an existing dashboard, open it and make your changes. Click **Save** to apply your updates. Anyone with access to the dashboard can edit it. ### Drag & drop You can reposition any widget by dragging and dropping it. * Hover over the widget, click and hold, then drag it to a new location. * Blue guidelines will show where the widget will be placed when released. ### Resize widgets You can also resize the widget by clicking on the resize handle and dragging it to the desired size. * To **adjust the width**, drag the left or right border of the widget. If there are other widgets in the same row, their size will adjust automatically to make space for the resized widget. * To **adjust the height**, drag the top or bottom border of the widget. If there are other widgets in the same column, their height will also be adjusted. ## Deleting dashboards To delete a dashboard, click `...` next to the dashboard you want to delete and select **Delete**. Only the owner of the dashboard can delete it. # How filters work in dashboards Source: https://docs.dema.ai/guides/dashboards/filters Learn how to apply filters to your dashboards in Dema to refine your data and focus on what matters most. ## Introduction to filters Filters let you narrow down the data displayed in your dashboard, helping you focus on what's most important. In Dema dashboards, filters can be applied in two ways: * **Global filters**: Affect all widgets in the dashboard. * **Widget filters**: Apply only to a specific widget. To learn more about filter behavior for metrics and dimensions, see [Filtering metrics](/guides/reports/filters#filtering-metrics) and [Filtering dimensions](/guides/reports/filters#filtering-dimensions). ## Global filters Global filters apply across the entire dashboard. To set a global filter: 1. Click the **Filters** button in the top-left corner of the dashboard. 2. Choose the dimension or metric you want to filter by. 3. Select the filter values and apply them. Once added, the global filter will update all widgets in the dashboard. ## Widget filters Widget filters apply only to an individual widget and are **combined** with any global filters applied to the dashboard. To add a widget-specific filter: 1. Select the widget you want to filter. 2. In the right sidebar, open the **Filters** menu. 3. Choose the dimension or metric and set the desired filter values. Both global and widget filters will be applied together. This allows you to further refine the data shown in a specific widget without affecting others. # Inventory forecasting Source: https://docs.dema.ai/guides/forecasts/inventory-forecasting Understand how historical data is transformed into actionable business insights. > [!NOTE] > > Dema's inventory forecasting engine transforms your historical sales data and > product characteristics into precise, forward-looking demand forecasts for the > remainder of your selling season. These intelligent insights empower you to > optimize inventory levels, implement strategic pricing, and allocate marketing > resources with confidence—preventing costly stockouts and reducing excess > inventory before they impact your bottom line. ## How to access The forecasts are available in the *Reports* section of the platform as selectable metrics. [LTV forecasting](https://demo.arcade.software/Y2fmXvZsZnfFHYGzBrhb?embed\&embed_mobile=inline\&embed_desktop=inline\&show_copy_link=true) ## How our forecasting engine works > [card] Core algorithm > > The system is built on *gradient boosted decision trees*, an advanced > algorithm architected for large-scale retail datasets, delivering speed and > accuracy for complex inventory forecasts. > [card] Continous model learning > > Incorporate new sales patterns, seasonal shifts, and market changes to > maintain forecasting precision throughout your selling cycle once a day and > update your forecasts accordingly. ### Core algorithm The engine employs an ensemble of decision trees that systematically analyze your data through intelligent questioning patterns. For example: *"Did this SKU experience strong performance in the European market during last spring's campaign?"* or *"How did similar products in this category perform during comparable promotional periods?"* By aggregating insights from thousands of these decision trees, the model generates comprehensive **end-of-season sales forecasts** rather than traditional day-by-day forecasts. This approach provides more stable and actionable forecasts for strategic inventory planning. > [!TIP] > > Consumer preferences and market conditions evolve rapidly. Configure automatic > model retraining to trigger after significant changes in your product > assortment, pricing strategy, or distribution channels to maintain optimal > forecasting accuracy. ### Hierarchical architecture The system employs a bottom-up approach to ensure that both granular inventory decisions and high-level strategic planning benefit from consistent, accurate data. The resulting output is a collection of individual end-of-season sales forecasts, each on the smallest granular level, enabling you to make the most informed decisions. **Distribution Center** → **Product Category** → **Individual SKU/Variant** This approach enables accuracy from the ground up, ensuring that detailed insights aggregate correctly to provide reliable top-line forecasts. ### Features The system uses a combination of historical performance indicators, product attribute analysis, and market context variables to create a comprehensive feature set. * Trend velocity and seasonal patterns * Geographic variations * Product consistency and demand metrics * Price point positioning across product hierarchy * Brand equity and collection performance history * Marketing spend activity across available product hierarchies > [!NOTE] > > Feature importance can differ greatly across categories, brands, warehouses, > and regions. Our machine learning model dynamically adapts to these > differences by identifying and prioritizing the most predictive features based > on your specific business context and customer behavior. *** ## Forecasted metrics The system generates a comprehensive set of forecasted metrics that can be used to make informed inventory decisions which can be accessed in the *Reports* section of the platform. | Metric | Description | | - | - | | **Forecast incoming returns** | Estimates the number of products expected to be returned on already sold orders for the rest of the season, helping anticipate inventory adjustments and returns impact. Based on historical trends and inputted return rates. | | **Forecast gross products sold** | Forecasts the total quantity of products expected to sell during the rest of the season, aiding in demand planning and promotional strategies. | | **Forecast return percent** | Estimates the percentage of sold products that are likely to be returned during the rest of the season, based on historical trends and inputted return rates. | | **Forecast net products sold** | Estimates the number of products expected to sell during the rest of the season, adjusted for historical return rates. This metric helps in planning inventory and marketing strategies by forecasting future sales performance based on past trends. | | **Forecast plus actual net products sold** | Combines forecasted net product sales with actual sales to date, providing a comprehensive view of seasonal sales performance. | | **Forecast sell-through** | Calculates the ratio of forecasted net products sold to total available stock (current, incoming, and forecasted returns), providing insights into inventory efficiency. | # LTV forecasting Source: https://docs.dema.ai/guides/forecasts/ltv-forecasting Understand how customer data is transformed into actionable profit-based lifetime value insights. > [!NOTE] > > Dema's profit-based lifetime value (LTV) forecasting engine transforms your > historical customer behavior and transaction data into precise, > forward-looking customer lifetime value predictions. These intelligent > insights empower you to optimize customer acquisition costs, implement > strategic retention campaigns, and allocate marketing resources with > confidence—identifying high-value customers and preventing churn before they > impact your bottom line. Trained on customer specific data, the system will forecast future lifetime value (LTV) values of each customer based on the [Gross Profit 2](/guides/fundamentals/metrics) metric. ## How to access You can access the LTV forecast directly from the platform’s *Reports* section. It is available as a selectable metric and can be explored at multiple levels of granularity—including down to the individual customer level. When applying the LTV metric to broader dimensions such as *Country* or *Store*, the platform displays the average forecasted LTV of customers who made a purchase within the selected time period. This allows you to assess expected profitability across different regions or store locations. Because LTV forecasts are updated daily, the values shown are always the most recent predictions available, even when viewing historical timeframes. Consequently, past dates reflect the latest forecasted LTVs rather than the original values calculated at that time. This forward-looking approach ensures the data reflects your customers’ most current expected behavior. [LTV forecasting](https://demo.arcade.software/186SBD5V7j49SfGiHy85?embed\&embed_mobile=inline\&embed_desktop=inline\&show_copy_link=true) ## How our forecasting engine works > [card] Core algorithm > > The system is built on gradient boosted decision trees, an advanced > algorithm architected for large-scale customer datasets, delivering speed > and accuracy for lifetime value forecasts. > [card] Continuous model learning > > The system incorporates new customer patterns, seasonal behaviors, and > market changes to maintain forecasting precision throughout your business > cycle with monthly training and daily prediction updates. ### Core algorithm The engine employs an ensemble of gradient boosted decision trees that systematically analyze your customer data through intelligent questioning patterns. For example: *"Did this customer demonstrate strong engagement during recent periods?"* or *"How did similar customers in this demographic perform during comparable periods?"* By aggregating insights from thousands of these decision trees, the model generates comprehensive **customer lifetime value forecasts**. This approach provides more stable and actionable forecasts for strategic customer relationship planning. > [!TIP] > > Customer preferences and market conditions evolve rapidly. The system > automatically retrains models monthly and updates predictions daily to > maintain optimal forecasting accuracy as new customer behavior data becomes > available. ### Features The system uses a combination of historical customer behavior indicators, transaction analysis, and temporal context variables to create a comprehensive feature set to forecast future profit-based LTV. The target variable employed is the **Gross Profit 2** metric. * Customer engagement velocity and seasonal patterns * Geographic and demographic variations * Purchase frequency and monetary metrics * Product category preferences across customer segments * Channel performance and acquisition source history * Marketing response activity across available customer hierarchies > [!WARNING] > > Customer feature importance varies significantly across different storefronts, > channels and market segments. Our machine learning algorithm automatically > identifies and weighs the most predictive factors specific to your unique > business model and customer base. ### Training time scales The temporal relationship between features, labels, and forecasts is essential for constructing a robust model. The diagram below illustrates the time-based strategy used to define training and forecasting windows. ![](https://mintcdn.com/demaai/cykEkTnqR7ehJEuO/images/ltv-time-scales.png?fit=max\&auto=format\&n=cykEkTnqR7ehJEuO\&q=85\&s=c53f5347a8a6e8beb6f214b1017129fc) #### Training data construction To train the machine learning model, the historical data is segmented into two windows: **Feature window (−2y to −1y):** During this period, data is collected from customer behavior signals and profile attributes such as historical purchases, engagement frequency, product preferences, demographics, and other relevant metrics. These form the feature set used for training. **Label window (−1y to Present):** Past the feature period, the actual LTV over the subsequent year is measured. These values serve as the ground truth labels for the model training. This historical snapshot ensures that the model learns from the same temporal relationships it will encounter in real-world inference. #### Live system prediction In a live setting, the model observes the most recent data for each customer using the same feature engineering process used during training. **Prediction window (Present to +1y):** The model forecasts the LTV for the upcoming year based on the most recent data. These predictions are logged for evaluation once the actual values become available. This setup ensures no data leakage and maintains realistic deployment constraints, where only past and present data are available at prediction time. *** ## Technical requirements **Data requirements** The LTV forecasting model requires at least 2 years of historical customer transaction data to generate reliable forecasts. This is to ensure that the model has enough data to learn the temporal patterns and relationships between features and labels. # Order forecasting Source: https://docs.dema.ai/guides/forecasts/order-forecasting Transform historical order patterns into accurate time series predictions using advanced seasonal decomposition models. > [!NOTE] > > Dema's order forecasting service transforms your historical order data into > precise, forward-looking predictions using seasonal decomposition models. By > analyzing recurring patterns, trends, and seasonal behaviors, the system > delivers intelligent insights that empower you to optimize operations, plan > capacity, and make data-driven business decisions. ## How to access the forecasts The forecasts are available in the *Reports* section of the platform as a selectable forecast metrics. [LTV forecasting](https://demo.arcade.software/rIxCG3wNV35ERwdHlcM5?embed\&embed_mobile=inline\&embed_desktop=inline\&show_copy_link=true) ## Understanding time series forecasting Time series forecasting predicts future values based solely on historical patterns within your data over time. Unlike regression models that rely on external variables, our approach focuses exclusively on understanding inherent patterns within your order history. Additionally, the models are trained top-down, starting with the highest level and allocating the forecasted values down to the smallest level of granularity based on a smart reconciliation algorithm. The granularity hierarchy used for the service is `Storefront × Country × Channel Group x Channel x Campaign`. **Core training metrics:** * **Order count**: The number of orders placed over time * **Average order value**: The mean value of orders for each time period While models train only on these two metrics, the system generates comprehensive business metrics using rolling averages of stable relationships down to the smallest level of granularity. ``` Forecasted Value = Raw Predicted Metric(s) × Stable Relationship(s) × Distribution Share ``` An example of a derived metric is `Gross Sales`, which is calculated as below, for each granularity level. ``` Gross Sales = Forecasted Orders × Forecasted AOV × Gross Sales Share ``` **Multi-dimensional forecasting:** * **Daily & hourly predictions**: Daily forecasts distributed hourly using historical patterns * **Business dimensions**: Allocated across geography, channels, and categories using stable rolling shares ## Available forecasting models > [card] Seasonal decomposition model > > Sophisticated model for complex seasonality using nonlinear regression `y(t) = g(t) + s(t) + h(t) + ε(t)` to decompose the time series into trend, > seasonal, and residual components. > [card] Naive model > > Efficient model that takes last year's performance and scales with recent > trends. Fast and transparent for stable seasonal patterns. **Seasonal decomposition model** works best with: * Strong seasonality and multiple seasons of historical data * Automatic changepoint detection and multiple seasonality handling * Holiday and special event incorporation * Requires at least 2 years of historical data **Naive model** works well when: * Seasonal patterns are stable or slowly changing * Quick, interpretable forecasts are needed * Requires less historical data > [!WARNING] > > The seasonal-decomposition model needs a more historical data and takes longer to configure. If onboarding speed is critical, launch first with > the **naive model** as baseline and move to **seasonal decomposition model** once you have enough data. ## System assumptions and limitations **Key assumptions:** * **Pattern continuity**: Seasonal and hourly distribution patterns evolve gradually * **Historical relevance**: Past patterns continue in similar forms **When forecasts may be less accurate:** * Major promotional campaigns altering conversion rates * Business strategy changes (new channels, geographic expansion) * Market disruptions breaking historical patterns * Limited historical data for new businesses > [!TIP] > > During significant business changes, treat forecasts as directional guidance > until patterns stabilize. # Attribution Source: https://docs.dema.ai/guides/fundamentals/attribution Understand how Dema attributes conversions to specific channels or campaigns. Learn about our supported models (last-click, linear, ML-based multi-touch, ad platform-reported, and causal factor attribution) and how to interpret the results. ## Overview Dema's **attribution** engine ensures that each conversion (order) is assigned to the right marketing source. By mapping UTM parameters, user sessions, and integrated cost data, Dema helps you see **which channels** and **which campaigns** drive profitable conversions. > [!NOTE] > > Attribution is crucial for identifying where to allocate your marketing budget, comparing performance across channels, and measuring return on ad spend (ROAS) at a more granular level. *** ## Models we support Dema offers **five** primary attribution models. You can select one that aligns with your business logic or compare models side by side for a complete view of channel impact. ### 1. Last-click * **How it works** The **last marketing channel** a user interacted with before placing an order receives 100% credit. * **Pros & cons** * **Pros**: straightforward and aligns with many standard analytics platforms. * **Cons**: may undervalue earlier touchpoints (awareness campaigns). ### 2. Linear * **How it works** All channels in the user's path to purchase share conversion credit **equally**. * **Pros & cons** * **Pros**: recognizes every touchpoint's contribution. * **Cons**: can over-credit minor interactions that barely influenced the final purchase. ### 3. ML-based multi-touch (MTA) * **How it works** Our algorithmic model evaluates each user's **full journey** and learns how much each touchpoint contributes to the conversion. Rather than assigning fixed percentages (e.g., 30% first-click), it adapts dynamically using historical data. * **Pros & cons** * **Pros**: captures complex journeys with more precision, often uncovering undervalued channels. * **Cons**: requires more data and can be less intuitive at a glance. ### 4. Ad platform-reported * **How it works** Uses each ad platform's **native** settings (Meta, Google Ads, TikTok, etc.). Their conversion windows (e.g., 7-day click, 1-day view) define attribution. * **Pros & cons** * **Pros**: matches what you see in ad platform dashboards. * **Cons**: can differ across platforms, making cross-channel comparisons less consistent. ### 5. Dema causal factor attribution (CFA) * **How it works** Adjusts MTA or ad platform-reported values using **causal multipliers** derived from [incrementality experiments](/guides/incrementality-testing/how-it-works) and platform-wide benchmarks. Rather than relying solely on observed correlations, CFA calibrates attribution to reflect the true incremental impact of each channel. See the full [Causal factor attribution](/guides/causal-factor-attribution/how-it-works) guide for details. * **Pros & cons** * **Pros**: reflects true incremental impact grounded in experimental evidence; works even without your own experiments thanks to platform-wide benchmarks. * **Cons**: accuracy improves with more experiments; requires configuration of calibration rules and multipliers. *** ## How Dema's ML-based multi-touch attribution works Dema's **ML-based Multi-Touch Attribution (MTA)** goes beyond simple models like last-click or linear. It uses machine learning to evaluate the entire customer journey and assigns conversion credit based on the actual contribution of each touchpoint. This approach gives you a more accurate understanding of which channels and campaigns drive results. #### Key features of ML-based MTA 1. **Analyzes the full customer journey** The model considers every interaction a customer has with your brand—clicks, views, and other engagements—and evaluates their impact on the conversion. 2. **Learns what drives conversions** Instead of assigning fixed percentages to specific touchpoints, Dema's algorithm uses historical data to learn how much influence each interaction had. It adapts as customer behavior changes over time. 3. **Context matters** The model accounts for important factors like: * The order of interactions (e.g., first vs. last touch). * The time between interactions. * The type of channel (e.g., paid ads, organic search, email). 4. **Dynamic credit allocation** Conversion credit is assigned based on the importance of each touchpoint. For example: * A paid social ad might generate interest and receive 30% credit. * A remarketing email might nurture the customer further and get 20%. * The final paid search click that led to the purchase might earn 50%. *** ## Choosing the right model Each model offers a different perspective on **which channel** or campaign deserves conversion credit. Depending on your funnel length and goals, you may prefer a single model or use **several** at once. **1. Evaluate funnel complexity** If customers buy soon after clicking an ad, **last-click** may suffice. For longer journeys, **ML-based MTA** often reveals hidden touchpoint value. **2. Compare models** Running multiple models shows how credit shifts. Channels that seem weak under last-click may appear stronger in **linear** or **ML-based MTA**. **3. Align with stakeholders** Some teams or agencies rely on **ad platform-reported** conversions. Decide which model is your single source of truth for ROI. *** ## How it works in Dema 1. **UTM & session tracking** * Dema uses `utm_source`, `utm_medium`, `utm_campaign`, etc., at session start. * These persist until the user either checks out or the session expires. 2. **Order association** * When a user converts, Dema identifies the relevant session(s) and divides credit based on your chosen model. 3. **Real-time updates** * Dema processes data in near real-time, so you can see updates within minutes. * Overnight jobs reconcile missed events or offline data to ensure accuracy. 4. **Adjusting models** * You can switch models in the reporting interface. * Historical data is recalculated, letting you compare how each model allocates credit over time. > [!WARNING] > > **Conversion window**\ > By default, Dema uses a 30-day click window for multi-touch attribution. *** ## Going beyond attribution with causal calibration Attribution models tell you **which channels are involved** in conversions. But they can't tell you whether those conversions would have happened without the marketing spend. Dema's [Causal factor attribution](/guides/causal-factor-attribution/how-it-works) takes your MTA values and adjusts them using evidence from incrementality experiments, or platform-wide benchmarked incremental factors, to reflect the **true causal impact** of each channel. > [!TIP] > > Learn more about how to calibrate your attribution with causal evidence in the [Causal factor attribution](/guides/causal-factor-attribution/how-it-works) section. *** ## Key takeaways 1. **No single model** works for everyone - match your choice to funnel complexity. 2. **ML-based MTA** can reveal hidden value in mid or early funnel, but it's more complex. 3. **Ad platform data** may differ from Dema's logic; use both for a broader picture. 4. **Causal factor attribution** can adjust any attribution model's values using real experimental evidence to better reflect true incremental impact. # Our core data model Source: https://docs.dema.ai/guides/fundamentals/data-model Discover how Dema collects, processes, and enriches your e-commerce data—from real-time events and orders to marketing costs, shipping rules, and returns. See how each data point comes together to power near real-time profitability insights, including Gross Profit 2 (GP2) costs like toll, pick & pack, and transaction fees. ## Ingestion & sources > [!NOTE] > > Dema uses a flexible approach to ingest data from multiple sources: a client-side tracking script for user events, plus third-party integrations for orders, returns, inventory, and marketing costs. ### Tracking Script Behavior * **Default events:**\ Dema tracks **page views**, **product views**, and **orders** on the client side to capture essential user activity. * **User identification:** * A `DV_TRACK` cookie is set at the user's first visit and stays across sessions. Its value is the user ID, which is how Dema recognizes a returning visitor. * With server-side tracking you send your own user ID as `uid`. The cookie name doesn't matter, but the value must be a UUIDv4 in its standard text form (`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`). See [How Dema identifies users](/guides/fundamentals/tracking#how-dema-identifies-users). * **Session construction:** * We build sessions similarly to Google Analytics Universal. Each session gets its own ID. * Dema groups a user's events into sessions. A session closes and a new one opens after a 30-minute gap, at midnight in your store's time zone, when the user arrives through a different channel (campaign, ad set or ad; direct traffic doesn't count), and after a purchase. * A new session from direct traffic takes the user's last non-direct channel from the past 90 days. See [How sessions work](/guides/fundamentals/tracking#how-sessions-work-in-dema). ### Third-party integrations * **E-commerce platforms:**\ Dema connects with **Shopify**, **Centra**, **Commercetools**, **sFTP uploads**, and **Snowflake** to fetch orders, incoming deliveries, returns, and inventory. We grab orders through webhooks (real-time) and nightly batch fetches to keep data fresh. * **Marketing costs:**\ We integrate with **Meta**, **Google Ads**, **TikTok**, and **Google Sheets** to gather your spend, clicks, impressions, and conversions—broken down by campaign, ad set, and country. * One-click setups manage API authentication for a seamless connection. * We store these details in two tables: * **Marketing costs** – For campaign-level spend (e.g., daily totals) * **Product marketing costs** – For feed-based ads (e.g., shopping), capturing spend per product. ### Data orchestration > [!TIP] > > **Scheduling Best Practice**\ > Most batch processes (order updates, returns, marketing costs, inventory snapshots) run between **4–6 AM CET**. Webhooks and the tracking script feed data continuously in near real-time. * **Real-time vs. scheduled:** * Events and session data appear almost instantly, typically within \~3 minutes. * Batch jobs refine shipping info, order statuses, or inventory levels on a daily schedule. ```mermaid theme={null} flowchart LR subgraph External Integrations A[Tracking Script] --> B[DEMA Pipeline] X[E-commerce Platforms] --> B Y[Marketing APIs] --> B Z[Data Warehouses] --> B end B --> C[Orders Table] B --> D[Events Table] B --> G[Inventory Table] B --> E[Marketing Cost Table] B --> F[Product Marketing Cost Table] ``` ## Event & session construction ### User identification * **Tracking cookie:**\ `DV_TRACK` holds the user ID. It persists across sessions and is the only way Dema recognizes that a user is revisiting your site. With server-side tracking, the `uid` you send plays the same role and must be a UUIDv4 in its standard text form (`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`); the cookie name doesn't matter. * **Anonymous vs. authenticated:**\ Users who opt out or aren’t recognized get “backfilled” later with final order data, labeled under the “Backfilled” channel if no session details are available. ### Sessionization logic Dema groups a user's events into sessions, similar to Google Analytics Universal. A session closes and a new one opens based on: * A 30-minute gap since the last event * Midnight in your store’s time zone * A change of channel (including campaign, ad set or ad; direct traffic doesn't count) * A purchase ### Attribution data * **UTM parameters:** * We record `utm_source`, `utm_medium`, `utm_campaign`, etc., as soon as the user lands. * Within Dema, map these parameters to relevant channels (for example, `utm_source=meta` => “Meta – Paid Social”). * **Marketing source storage:** * UTM data is stored alongside sessions or users, linking each order to the right marketing channel. * If no tracking data is present, orders default to “Backfilled.” > [accordion] Why 'Backfilled' Orders? > > In cases where a user doesn't allow or triggers the tracking script (ad blockers, cookie opt-outs, etc.), we fetch the order data later via webhooks or batch processes.\ > Since there's no session-level data, the channel is "Backfilled" by default. No need to worry; these orders still appear in Dema and contribute to your overall analytics. *** ## Data processing & real-time calculations > **3-minute window:** Dema’s pipeline processes events, orders, and related data in near real-time—so you see what’s happening in minutes, not hours. * **Real-time session updates:** * Page views, product views, and orders flow instantly into Dema. * If shipping details or additional costs (like toll or pick & pack) arrive later, we update the existing record accordingly. * **Order updates:** * We merge data from your tracking script, webhooks, and nightly batch fetches. * The final, most recent data is always the source of truth—ensuring no detail is missed if new info arrives after initial order creation. ## Data model: Tables & entities This section covers each core table in Dema. They might differ slightly in your actual implementation, but the fundamental logic remains consistent. ### Events table * **Purpose:**\ Captures site events like page views, product views, and purchase actions. * **Key fields (camel case):** * `sessionId` — Ties the event to a session * `userId` — Drawn from `DV_TRACK` * `eventType` — For instance, `pageview` or `order` * `timestamp` — Logs when the event happened * `utm_source`, `utm_medium`, `utm_campaign` — Stored at session start * **Notes:**\ Useful for reconstructing user journeys and attributing orders to specific channels. ### Order table * **Purpose:**\ Main repository for every order, including partial updates from batch or webhook flows. **Returns/refunds** data is also stored here, so there’s no separate returns table. * **Key fields:** * `orderId` — Unique order identifier * `sessionId` — If the order ties to a known session * `userId` — If recognized via `DV_TRACK` * `items` — e.g., `productId`, `variantNo`, `quantity`, `price`, `cogs`, `shippingCost`, `toll`, `pickPackCost`, `transactionFee` * `shippingProvider`, `shippingCountry` * `returnStatus`, `returnQuantity`, `returnReason` * `createdAt` > [!NOTE] > > Note that this table evolves over time. If returns or shipping details arrive later, we update the existing record. ### Marketing cost table * **Purpose:**\ Tracks campaign-level spend from Meta, Google, TikTok, or manual entries. * **Key fields:** * `platform`, `campaignId`, `adsetId`, `country` * `dailySpend`, `clicks`, `impressions`, `conversions` * `timestamp` (e.g., daily or per reporting window) * **Notes:**\ Dema attributes these costs to orders or sessions using your UTM mapping rules. ### Product marketing cost table * **Purpose:**\ Captures feed-based ads (like Google Shopping) where spend is recorded per product. * **Key fields:** * `productId`, `variantNo` (if applicable) * `spend`, `clicks`, `impressions`, `conversions` * `campaignId`, `adsetId`, `adId`, `country` * `timestamp` * **Notes:**\ Great for granular analysis on product-level advertising effectiveness. ### Inventory table * **Purpose:**\ Logs each SKU (variant), warehouse, stock level, and COGS data. * **Key fields (camel case):** * `productId`, `variantNo`, `warehouse` * `stockQuantity`, `incomingDeliveries` * `cogs` (fixed or pulled from external data) * **Notes:**\ Snapshot runs daily (4–6 AM CET) to track historical levels and forecast demand. *** ## Profitability enrichment ### Rules-based fees & cost structure Merchants can define **rules** to automatically apply shipping, toll, transaction, and pick & pack fees to each order, for example: ```plaintext theme={null} "If `shippingProvider` = UPS and `shippingCountry` = US, apply X cost." ``` Costs can be a flat rate, a percentage of order value, or per-item.\ If no rule is found, a fallback logic applies. These same rules apply to shipping, toll, transaction fees, and more. You can also import real shipping costs via CSV from providers like UPS or DHL. ### Cost of Goods Sold (COGS) * **Source:**\ Typically pulled from your **inventory** data. If missing, Dema references manually entered COGS. ### Shipping & logistics costs * **Rules-based or actual:** * Provider and country details help match each order to the right cost profile. * Merchants can define actual shipping charges or import real costs via CSV. ### Toll, pick & pack, and transaction fees (GP2 costs) * **Logistics & operational fees:** * **Toll**: import duties/customs * **Pick & Pack**: handling fees * **Transaction Fees**: payment processing * **Rule setup:** * Similar to shipping, these fees can be configured with your unique rules or CSV imports. ### Calculating gross profit metrics 1. **Gross Profit 1 (GP1)**\ `GP1 = Sales - COGS` 2. **Gross Profit 2 (GP2)**\ `GP2 = GP1 - (Shipping + Toll + Pick & Pack + Transaction Fees)` 3. **Gross Profit 3 (GP3)**\ `GP3 = GP2 - Marketing Spend` **Net Gross Profit variants:**\ We also calculate **Net GP1**, **Net GP2**, and **Net GP3**, which factor in returns/refunds. Initially, we may use estimated returns until a set threshold (e.g., 30 days) passes, then switch to actual return data. > [!TIP] > > All these profitability metrics update automatically whenever new cost or return data arrives. No manual recalculations needed! *** ## Data availability & latency > [!NOTE] > > **Within 3 minutes:**\ > Your Dema dashboard shows new sessions and orders as soon as they’re processed by our real-time pipeline—no lengthy delays. * **Nightly refinements:**\ Between **4–6 AM CET**, we finalize details like order statuses, returns, marketing spend, and updated inventory snapshots. * **Merging & finalizing:**\ The most recent data always wins. If fresh shipping or returns info arrives later, Dema updates your orders automatically, preserving correct session data and attribution. # Dimensions Source: https://docs.dema.ai/guides/fundamentals/dimensions Learn about the dimensions in Dema that let you slice, segment, and analyze your data across different categories (channel, country, product, etc.). These dimensions are automatically populated from your tracking script, e-commerce platform, or marketing integrations, giving you granular insights into user behavior and performance. ## Overview Dema's dimensions provide **multiple ways** for analyzing user behavior, marketing performance, and profitability. Whether you’re focusing on channels, products, or customer segments, these dimensions help you surface **actionable insights** and optimize strategies across your e-commerce. | Dimension | Description | | - | - | | Account ID | The unique identifier for the advertising account within a channel. | | Account name | The name of the advertising account within a channel. | | Ad | Tracks specific advertisements driving traffic, derived from utm\_content parameters. | | Ad delivery | The delivery status of the ad. | | Ad group | Specifies ad groups driving traffic, primarily for Google Ads campaigns, derived from utm\_content parameters. | | Ad set | Identifies specific ad sets within campaigns, primarily for Facebook traffic, derived from utm\_term parameters. | | Ad set daily budget | The daily budget of the ad set. | | AOV bucket | Groups orders into predefined ranges of Average Order Value (e.g., USD 0 - USD 200, USD 200 - USD 400). | | Asset group | The name of the asset group, for Google Performance Max campaigns. | | Asset group ID | The ID of the asset group, for Google Performance Max campaigns. | | Attribution setting | The attribution setting of the ad set. | | Brand | Identifies the brand name of the product, fetched from the inventory in the e-commerce platform. | | Buying type | The buying type of the marketing campaign. | | Campaign | Tracks the specific marketing campaign driving traffic, derived from UTM parameters such as utm\_campaign. | | Campaign daily budget | The daily budget of the marketing campaign. | | Campaign delivery | The delivery type of the marketing campaign. | | Campaign objective | The objective of the marketing campaign. | | Category | Identifies the product category, fetched from the inventory in the e-commerce platform. | | Causal factor attribution enabled | Indicates whether causal factor attribution is enabled for the ad set. | | Channel | Identifies specific traffic sources like TikTok or Google, using UTM parameters or referrer information. | | Channel group | Categorizes traffic sources into groups like Social Paid, Social Organic, Direct, etc., based on UTM parameters or referrer data. | | City | The city where the order was placed. | | Collection | Identifies the product collection (e.g., "Summer 2022"), fetched from the inventory in the e-commerce platform. | | Colour | The product’s colour, fetched from the inventory in the e-commerce platform. | | Country | Identifies the country of traffic or orders, determined from visitor IPs or shipping addresses. | | Creative body | The body text of the creative used in the ad. | | Creative CTA | The call-to-action text of the creative used in the ad. | | Creative format | The format of the creative used in the ad. | | Creative headline | The headline text of the creative used in the ad. | | Creative ID | The identifier of the creative used in the ad. | | Creative image | The image of the marketing creative. | | Creative media type | The media type of the creative used in the ad. | | Custom attribute 1-5 | Represents additional custom attributes for a product or variant, fetched from the e-commerce platform for granular tracking and analysis. | | Customer cohort | The cohort of the customer, based on the month of their first order. | | Customer Id | The identifier of the customer, based on their email. | | Customer quarterly cohort | The cohort of the customer, based on the quarter of their first order. | | Day | Groups data by calendar day. | | Days since first order | The number of calendar days between the customer's first order date and the current order. | | Device | Categorizes devices used by visitors, such as Mobile, Desktop, or Tablet, based on user agent data. | | Engaged sessions vs bounced | Categorizes sessions as Bounced (single-page views) or Engaged (multi-page or interaction). | | Event name | The tracked event type (for example view\_item\_list or add\_to\_cart). Lets you filter and group by any event, including your own custom events. | | Event page | The URL path where the event occurred. Different from landing page, which is the page the visit started on. | | Event page group | The page where the event occurred, with country and language prefixes removed. | | Full months since first order | The number of fully completed months between the customer's first order date and the current order. | | Funnel (Campaign) | Funnel stage derived from the campaign name. | | Gender | Identifies the gender attribute associated with the product (e.g., Men, Women, Unisex), fetched from the e-commerce platform. | | Historical segmentation product label | The historical label of the segmentation product set configured in your segmentation settings. | | Historical segmentation product set | The historical segmentation product set configured in your segmentation settings. | | Hour | Groups data by hour of the day. | | Keyword | Captures search keywords driving traffic, primarily for Google Ads, based on utm\_term parameters. | | Landing page | Identifies the first page visitors land on during a session. | | Landing page group | The first page a visitor lands on during a visit, with country and language prefixes removed. | | Logistic cost type | Identifies whether the logistic cost applied to Gross profit 2 is actual or estimated. | | Logistic cost type returns | Identifies whether the logistic cost applied to returns is actual or estimated. | | Market | The geographical market the traffic comes from, according to the visitor's IP address. A market can be a single country or a group of countries. | | Material | Identifies the product’s material, fetched from the inventory in the e-commerce platform. | | Month | Groups data by calendar month. | | Months since first order | The number of months since the customer's first order. | | New vs returning customer | Categorizes customers as New (first purchase) or Returning (repeat purchases), based on order history. | | New vs returning customer (30 days) | Categorizes customers as New (within 30 days of their first-ever order) or Returning (subsequent purchases after 30 days). | | Order currency | The currency the order was placed in. | | Order discount type | The discount status of the order, showing whether the purchase was made at full price or with a discount applied. | | Order discount type level | The discount level of the order, showing whether the purchase was made with or without a voucher. | | Order ID | Tracks the unique identification number for each order. | | Order sequence | Shows which order this is for the customer (1st order, 2nd order, 3rd order, and so on), counted across the customer's order history. | | Order type | The type of the order, as delivered by the e-commerce platform. | | Orders placed | The total number of orders in the customer's order history. | | Orders placed (within selected period) | Shows which order this is for the customer (1st order, 2nd order, and so on) within the selected time period. | | Payment provider | Identifies the payment provider for an order, based on tracking data or the e-commerce platform. | | Performance goal | The performance goal of the marketing campaign. | | PLP position | The position of a product in a list view. Indexing depends on your tracking implementation. | | Product ID | Represents the unique identifier for a product, covering all its variants (e.g., sizes, colors). | | Product images | The product image URLs. | | Product name | Identifies the product name, typically fetched from the inventory in the e-commerce platform. | | Quarter | Groups data by calendar quarter. | | Region | The region where the order was placed. | | Repeat vs new visitor | Categorizes visitors as new or repeat based on cookies and previous sessions. | | Return date | The date the product was returned. | | Return month | The month the product was returned. | | Returned warehouse | The warehouse the returned items were sent to. | | Segmentation customer label | The label of the segmentation customer set configured in your segmentation settings. | | Segmentation customer set | The segmentation customer set configured in your segmentation settings. | | Segmentation product label | The label of the segmentation product set configured in your segmentation settings. | | Segmentation product set | The segmentation product set configured in your segmentation settings. | | Shipping provider | Identifies the shipping provider for an order, derived from tracking data or the e-commerce platform. | | Size | Identifies the product’s size, fetched from the inventory in the e-commerce platform. | | Storefront | Identifies which e-commerce storefront generated traffic or sales, based on the frontendId parameter in traffic data. | | Subcategory | Identifies the product subcategory, fetched from the inventory in the e-commerce platform. | | Variant ID | Tracks a specific product variant, such as a particular size or color. | | Variant No | The unique identification number of a product variant, as sent from your tracking data layer. | | Voucher | Tracks voucher or promo codes used during transactions, derived from tracking data or the e-commerce platform. | | Warehouse | Tracks the warehouse or fulfillment center from which products are shipped, based on inventory data. | | Week | Groups data by week number. | | Year | Groups data by calendar year. | | Zip Code | The zip code where the order was placed. | # Discounts Source: https://docs.dema.ai/guides/fundamentals/discounts ## Overview This document explains how to send order data with pricing and discount information to our system. You'll need to provide the original price, the paid price, and promotion details for each product. We calculate the discount amount from the prices you provide. **Important:** We track two types of discounts separately: * **Product-level discounts** (sales, promotions) - you provide `promotionAmount` (line level) * **Order-level discounts** (voucher codes, cart promotions) - you provide `voucherDiscount` (order level) ## Quick start ### What you provide For each product in an order, provide: * **`originalPrice`** - Original price per unit (before any discounts). Including tax, but excluding order level discounts. * **`paidPrice`** - Price per unit paid by the customer before any order-level discounts. Including tax. * **`promotionAmount`** - The product-level discount/promotion amount (optional) * **`promotionId`** - Identifier for the promotion (optional) * **`promotionType`** - Type of promotion (optional) For the order level: * **`voucherDiscount`** - The order-level discount amount (optional) * **`voucher`** - The voucher code used (optional) * **`voucherType`** - Type of voucher (optional) ### What we calculate We automatically calculate: * **`discount`** = `originalPrice` - `paidPrice` * Order totals based on the formula: `sum(originalPrice - promotionAmount) - voucherDiscount + shipping = total` **Note:** You don't need to calculate or provide the `discount` field - we derive it from the prices you provide. Both `originalPrice` and `paidPrice` include tax. ## Discount types ### Product-level discounts Promotional discounts applied directly to a product's price (e.g., sale items, markdowns). **Example:** Jacket originally \$219.00, on sale for \$175.20 * `originalPrice`: \$219.00 * `paidPrice`: \$175.20 (includes tax) * `promotionAmount`: \$43.80 ### Order-level discounts Discounts applied to the entire order through voucher codes or cart-wide promotional rules. **Example:** Additional 10% off with code "SAVE10" **Important:** These are tracked in the `voucherDiscount` field at the order level, NOT in the product line `promotionAmount` field. ### Combined discounts Both types can stack on the same item, but they're tracked separately: **Example:** * `originalPrice`: €59.90 (list price) * `paidPrice`: €47.92 (after 20% product-level sale, including tax) * `promotionAmount`: €11.98 (product-level discount only) * `voucher`: "SAVE10" (order-level discount code) * `voucherDiscount`: €4.79 (order-level discount, tracked at order level) ### Free items Items given at no charge should be recorded with 100% product-level promotion. **Example:** * `originalPrice`: €29.90 * `paidPrice`: €0.00 * `promotionAmount`: €29.90 (100% off) ## How to provide pricing and promotion information When preparing your order data, provide the following information: ### For product-level promotions (line level): For each product line item, provide: 1. **`originalPrice`** - Original price per unit (before any discounts). Including tax, but excluding order level discounts. 2. **`paidPrice`** - Price after product-level discounts (sales, markdowns), including tax 3. **`promotionAmount`** - The amount of the product-level discount (if applicable) 4. **`promotionId`** - Identifier for the promotion (optional) 5. **`promotionType`** - Type of promotion, e.g., "percentage", "fixed" (optional) **Example:** * `originalPrice`: \$100 * Sale discount: 20% off * `paidPrice`: \$80 (after discount, including tax) * `promotionAmount`: \$20 **Important:** The `promotionAmount` field should ONLY contain product-level discounts (promotional sales, markdowns, etc.). Do NOT include order-level discounts here. **Note:** We'll automatically calculate `discount = originalPrice - paidPrice` on our end. ### For order-level discounts (order level): Order-level discounts from voucher codes or cart promotions should be provided at the order level: * `voucher` - The discount code used (e.g., "SAVE10") * `voucherDiscount` - The total discount amount from the voucher code * `voucherType` - Type of discount (e.g., "percentage", "fixed") ## Required data format For each product in an order, you must provide: ```json theme={null} { "id": "SKU123", "name": "Product Name", "quantity": 1, "originalPrice": 219000000, "paidPrice": 175200000, "promotionAmount": 43800000, "promotionId": "summer-sale-2024", "promotionType": "percentage", "currency": "USD", "tax": 0 } ``` **Required Fields:** * `id` - Product SKU or unique identifier * `name` - Product name * `quantity` - Number of units purchased * `originalPrice` - Original price per unit (before any discounts). Including tax, but excluding order level discounts. * `paidPrice` - Price per unit paid by the customer before any order-level discounts. Including tax. * `currency` - Transaction currency (e.g., "USD", "EUR") * `tax` - Tax amount charged (already included in both originalPrice and paidPrice) **Optional Fields:** * `promotionAmount` - Product-level discount amount (if applicable) * `promotionId` - Identifier for the promotion (if applicable) * `promotionType` - Type of promotion, e.g., "percentage", "fixed" (if applicable) **Pricing Validation:** Ensure that `originalPrice - promotionAmount = paidPrice` **Critical Notes:** * Both `originalPrice` and `paidPrice` include tax * `promotionAmount` contains ONLY product-level discounts (sales, markdowns) * Order-level discounts (voucher codes) are tracked separately in `voucherDiscount` at the order level and should NOT be included in the `promotionAmount` field * You do NOT need to provide a `discount` field - we calculate it as `discount = originalPrice - paidPrice` ## Discount codes (order-level discounts) If voucher codes or cart-wide discount codes were used, provide them at the order level: ```json theme={null} { "orderId": "ORD-12345", "voucher": "SAVE10", "voucherDiscount": 100.00, "voucherType": "percentage", "items": [...] } ``` **Order-Level Fields:** * `voucher` - The discount code used (e.g., "SAVE10", "WELCOME20") * `voucherDiscount` - Total discount amount from the voucher code (for the entire order) * `voucherType` - Type of discount ("percentage", "fixed", etc.) **Critical:** Order-level discount amounts should be provided in the `voucherDiscount` field at the order level, NOT in individual product `promotionAmount` fields. The `promotionAmount` field is reserved for product-level discounts only. ## How to handle tax **All prices should include tax.** The `paidPrice` field should always include tax, and you should specify the tax portion separately in the `tax` field. ### Tax included in customer-facing price When tax is included in the displayed price (e.g., in Europe): * The customer sees one price throughout checkout * Provide the `paidPrice` including tax * Specify the tax portion in the `tax` field **Example:** * Customer sees: €47.92 * `paidPrice`: €47.92 (includes tax) * `tax`: €8.00 (tax portion already included) * Net price: €39.92 ### Tax added at checkout When tax is displayed separately at checkout (e.g., in the US): * The customer sees tax added as a separate line * Still provide the `paidPrice` as the total including tax * Specify the tax amount in the `tax` field **Example:** * Product price shown: \$159.20 * Tax added at checkout: \$12.74 * `paidPrice`: \$171.94 (includes the tax) * `tax`: \$12.74 (tax portion) ## Multi-item orders When submitting orders with multiple items, provide pricing data for each item independently. Remember that product-level and order-level discounts are tracked separately. **Example Order Structure:** * **Item 1:** Regular price, no discounts * `originalPrice` = `paidPrice`, no `promotionAmount` field (or set to 0) * **Item 2:** On sale (product-level discount only) * `promotionAmount` field contains the sale discount * **Item 3:** On sale + voucher code used on order * `promotionAmount` field contains only the product sale discount * Order-level voucher discount tracked in `voucherDiscount` at order level * **Item 4:** Free gift (100% product-level discount) * `paidPrice` = 0, `promotionAmount` = `originalPrice` **Note:** If a voucher code applies to the entire order, provide the voucher information once at the order level, not repeated for each product. ## Edge cases and examples ### No discount applied When an item has no product-level discount, you can omit the `promotionAmount` field (or set it to 0). The `paidPrice` will equal `originalPrice` (plus tax if applicable): ```json theme={null} { "originalPrice": 359990000, "paidPrice": 359990000, "tax": 0 } ``` **Note:** If an order-level voucher code is applied, it's tracked separately in `voucherDiscount` at the order level, not in the product's `promotionAmount` field. ### Multiple quantities When a customer purchases multiple units of the same item, provide the per-unit pricing: **Example:** * Customer buys 3 items at \$50 each (original price) * 20% product-level sale applied * Per unit values: * `originalPrice` = \$50 * `paidPrice` = \$40 (after sale, including tax) * `promotionAmount` = \$10 (product discount per unit) * `quantity` = 3 * Total product-level savings: \$30 ### Complete order example Here's a complete order with multiple discount types (showing what you provide): ```json theme={null} { "orderId": "ORD-12345", "voucher": "SAVE10", "voucherDiscount": 17.52, "voucherType": "percentage", "items": [ { "id": "SKU001", "name": "Jacket", "productId": "PROD-001", "variantNo": "VAR-001", "quantity": 1, "originalPrice": 219.00, "paidPrice": 175.20, "promotionAmount": 43.80, "promotionId": "summer-sale-2024", "promotionType": "percentage", "tax": 0, "currency": "USD" } ] } ``` **What You Provide:** * `originalPrice`: \$219.00 * `paidPrice`: \$175.20 * `promotionAmount`: \$43.80 (product-level promotion) * `voucherDiscount`: \$17.52 (order-level discount) **What We Calculate:** * `discount` = `originalPrice` - `paidPrice` = \$219.00 - \$175.20 = \$43.80 **Customer's Journey:** 1. Original price: \$219.00 2. After product promotion: \$175.20 (saved \$43.80) 3. After order voucher: \$157.68 (additional \$17.52 off) 4. Total savings: \$61.32 # Metrics Source: https://docs.dema.ai/guides/fundamentals/metrics Discover the key performance metrics that Dema tracks and calculates to empower data-driven decisions. This section explains what each metric represents, how it’s calculated, and why it matters. You can use these metrics to uncover growth opportunities, optimize spend, and monitor profitability in near real-time. ## Overview Dema's metrics cover all stages of the e-commerce funnel—from traffic acquisition to final profit. Whether you’re analyzing marketing performance, product sell-through, or profitability, our metrics provide **actionable insights** for your day-to-day operations and strategic planning. ### Orders | Metric | Formula | Description | How to use | | :- | :- | :- | :- | | % Actual returned quantity | Actual returned quantity / Products sold | Tracks the number of returned products as a percentage of total products sold, helping assess return management efficiency. | | | % Actual returned sales | Actual returns / Gross sales | Measures the value of actual returns as a percentage of total sales, helping evaluate the financial impact of returned products. | | | Cost of goods sold (COGS) | Sum of all COGS | Represents the total cost of the products sold during the selected period. | | | Driven Gross sales | Gross sales from all products sold in visits where the product was the landing page | Shows how much gross sales a product drives when it is the entry product: revenue from all products sold in visits that started on that product. Use with product or product attribute dimensions. | | | Driven Net gross profit 2 | Net gross profit 2 from all products sold in visits where the product was the landing page | Shows how much profit a product drives when it is the entry product, after returns and fulfilment costs. Use with product or product attribute dimensions. | | | Driven Products sold | Products sold in visits where the product was the landing page | Shows how many products are sold in total when a product is the entry product of the visit. Use with product or product attribute dimensions. | | | % Estimated returned quantity | Estimated returned quantity / Products sold | Measures the estimated number of returns as a percentage of total products sold, providing insights into potential inventory adjustments. | | | % Estimated returned sales | Estimated returns / Gross sales | Estimates the value of returns as a percentage of total sales, helping assess the impact of returns on overall revenue. | | | Gross sales per distinct product | Gross sales / Distinct products sold | Measures the average gross sales per distinct product, regardless of how many units of each product are sold, enabling comparison across product segments with different numbers of products. | | | Net gross profit 2 per distinct product | Net gross profit 2 / Distinct products sold | Calculates the average profit per distinct product, regardless of how many units of each product are sold, after deducting fulfilment costs and adjusting for returns. | | | % of Gross sales | Gross sales / Total gross sales | Measures the proportion of a row's value relative to total gross sales for the selected period, helping to assess contribution. | | | % of Net sales | Net sales / Total net sales | Measures the proportion of a row's value relative to total net sales for the selected period, offering a clearer view of value generation after returns. | | | % Returned quantity | Returns quantity / Products sold | Calculates the percentage of sold products returned by customers, helping to monitor and improve return rates. | | | % Returned sales | Returns / Gross sales | Measures the proportion of sold items returned by customers, based on historical averages and manual inputs, offering insights into return trends. | | | Actual returned quantity | Sum of all actual returned quantities | Tracks the total number of products physically returned by customers, providing clarity on return trends. | | | Actual returns | Sum of all actual returns | Captures the monetary value of products that have been physically returned, reflecting true return costs. | | | Average order value (AOV) | Gross sales / Order count | Measures the average revenue per order, providing insights into customer spending habits. Adjustments for expected returns offer a realistic view of order value. | **Use Free Shipping Thresholds:** Set minimum order values for free shipping to motivate customers to increase their cart size. This strategy can drive higher AOV while maintaining profitability. **Analyze with AOV bucket:** To increase your AOV, consider adjusting your free shipping threshold. Analyze the AOV buckets dimension to identify the optimal shipping levels and free shipping thresholds in different regions. | | Discount % | Sum of all discounts | Represents the percentage of total order value that was discounted, providing insights into promotional impact and discounting strategies. | | | Estimated returned quantity | Sum of all estimated returned quantities | Predicts the number of products likely to be returned, offering insights into future return rates. | | | Estimated returns | Sum of all estimated returns | Projects the monetary value of products expected to be returned based on historical trends and manual inputs. | | | Gross margin 1 | Gross profit 1 / Gross sales | Shows the profit margin as a percentage of total sales after deducting COGS. Does not account for returns; use Net metrics for return-adjusted insights. | | | Gross margin 2 | Gross profit 2 / Gross sales | Reflects the profit margin as a percentage of total sales after deducting both COGS and fulfillment costs. Does not account for returns; use Net metrics for return-adjusted insights. | | | Gross margin 3 | Gross profit 3 / Gross sales | Shows the profit margin as a percentage of total sales after deducting COGS, fulfillment costs, and marketing expenses. Does not account for returns; use Net metrics for return-adjusted insights. | | | Gross profit 1 | Gross sales - COGS | Measures basic profitability by subtracting COGS from total sales revenue. Does not account for returns; use Net metrics for return-adjusted insights. | | | Gross profit 1 per order | Gross profit 1 / Order count | Measures the average profit per order after deducting COGS. Does not account for returns; use Net metrics for return-adjusted insights. | | | Gross profit 2 | Gross profit 1 - Fulfillment costs | Highlights profitability after accounting for both COGS and fulfillment costs. Does not include returns; use Net metrics for return-adjusted insights. | | | Gross profit 2 per order | Gross profit 2 / Order count | Measures the average profit per order after deducting both COGS and fulfillment costs. Does not account for returns; use Net metrics for return-adjusted insights. | | | Gross profit 3 | Gross profit 2 - Marketing spend | Reflects total profitability after deducting all variable costs, including marketing, from Gross Profit 2. Does not include returns; use Net metrics for return-adjusted insights. | | | Gross profit 3 per order | Gross profit 3 / Order count | Calculates the average profit per order after deducting COGS, fulfillment costs, and marketing spend. Does not account for returns; use Net metrics for return-adjusted insights. | | | Gross sales | Sum of all target gross profits 2 | Measures the total revenue generated from all orders, including product and shipping fees, excluding VAT and returns. | | | Mixed item orders | Count of orders with more than one product | Tracks orders consisting of multiple distinct products, offering insights into bundling and cross-selling opportunities. | | | Multi item orders | Count of orders with products having multiple variants | Tracks orders containing at least one product with multiple variants, helping assess demand for product variety within a single purchase. | | | Net Average Order Value (AOV) | Net sales / Order count | Calculates the average revenue per order by dividing net sales by the number of orders. Adjusts for expected returns to provide an accurate transaction value. | | | Net gross margin 1 | Net gross profit 1 / Net sales | Shows the profit margin as a percentage of net sales after accounting for COGS, providing insights into efficiency above product costs. | **Evaluate Operational Efficiency:** When assessing operational efficiency, consider using Net Gross Margin 2 instead. It provides a more comprehensive view by also factoring in fulfillment costs, giving a clearer picture of profitability across the same dimensions. | | Net gross margin 2 | Net gross profit 2 / Net sales | Highlights the profit margin as a percentage of net sales after deducting both COGS and fulfillment costs, helping assess operational efficiency. | **Limit Discounts and Marketing Spend:** To remain profitable, ensure that the percentage of discounts or marketing spend does not exceed your Net Gross Margin 2. For example, if your Net Gross Margin 2 is 25%, avoid offering discounts or spending more than 25% on marketing per order. | | Net gross margin 3 | Net gross profit 3 / Net sales | Reflects the profit margin as a percentage of net sales after deducting COGS, fulfillment costs, and marketing expenses. | | | Net gross profit 1 | Net sales - COGS | Highlights profitability before operational expenses, subtracting COGS from net sales and accounting for expected returns. | | | Net gross profit 1 per order | Net gross profit 1 / Order count | Measures the average profit per order after deducting COGS and adjusting for returns. | **Pricing and Profitability Strategies:** If you are evaluating pricing or profitability strategies, consider using Net gross profit 2 per order instead. It works on the same dimensions but also takes fulfillment costs into account, providing a more comprehensive view of order profitability. | | Net gross profit 2 | Net gross profit 1 - Fulfillment costs | Reflects profitability after adjusting for returns and fulfillment costs, offering a comprehensive view of operational efficiency. | | | Net gross profit 2 per order | Net gross profit 2 / Order count | Calculates the average profit per order after deducting fulfillment costs and adjusting for returns. | **Assess With Marketing Costs:** Use this metric to understand how much you can pay in marketing cost per order while maintaining profitability. For example, if Net gross profit 2 per Order is \$20, you shouldn't spend more than that on marketing per order to remain profitable short term. This is useful for assessing marketing budgets across different regions and product categories. **Limit Discounts to Maintain Profitability:** If Net Gross Profit 2 per Order is \$20 for a product, avoid offering discounts that exceed this amount to ensure you remain profitable. Use this as a guideline for setting promotion limits. | | Net gross profit 3 | Net gross profit 2 - Marketing spend | Provides a comprehensive view of profitability after deducting all variable costs, including marketing, fulfillment, and returns. | | | Net gross profit 3 per order | Net gross profit 3 / Order count | Measures the average profit per order after deducting all variable costs, including fulfillment and marketing, offering a true view of profitability per transaction. | | | Net products sold | Products sold - Expected returns | Shows the total number of products sold after adjusting for expected returns, providing a clearer view of actual sales volume. | | | Net sales | Gross sales - Expected returns | Represents the total revenue from sales, including shipping revenue, after subtracting the value of expected returns. | | | New customer net gross profit 2 | Net gross profit 2 from new customers | Calculates the profitability of new customers after deducting returns, purchasing costs, fulfillment costs, and return costs. | | | New customer net gross profit 2 per order | New customer net gross profit 2 / New customers | Measures the average profit per order from new customers after accounting for returns, purchasing costs, and fulfillment costs. | **Measure Against CAC:** Compare this metric with Customer Acquisition Cost (CAC) to assess the efficiency of your customer acquisition efforts. If New Customer Net Gross Profit 2 per Order is lower than your CAC, it may indicate that your marketing spend is not generating profitable new customer orders, suggesting the need to optimize your acquisition strategy. **Evaluate Marketing Market Performance:** Use the Market dimension to see which markets are driving the most profitable new customer orders. Focus on scaling markets with a higher New Customer Net Gross Profit 2 per Order relative to CAC. | | Order count | Sum of all forecasted orders | Tracks the total number of orders placed on the website during the selected period. | | | Pick and pack cost | Sum of all pick and pack costs | Calculates the total spent on pick and pack services for orders, including returns, reflecting operational costs associated with order fulfillment. | | | Products sold | Sum of all target products sold | Counts the total number of products purchased during the selected period, excluding adjustments for returns. | | | Returned quantity | Sum of all returned quantities | Tracks the number of products physically returned by customers, combining actual and estimated data based on manual inputs. | | | Returns | Gross sales - Net sales | Tracks the total value of products returned by customers as a percentage of gross sales, helping identify categories or products with high return rates. | | | Sales FX Rate | Average exchange rate | Shows the average exchange rate applied to convert sales into local currency, providing transparency for multi-currency transactions. | | | Shipping cost | Sum of all shipping costs | Captures the total amount spent on shipping, including costs for returned items. Can be based on manual inputs or actual shipping data. | | | Shipping fees | Sum of all shipping fees charged to customers | Captures the total shipping fees charged to customers, excluding VAT, representing revenue collected from delivery services. | | | Single item orders | Count of orders with one product | Tracks orders consisting of exactly one product, helping identify customer purchase behavior. | | | Customs cost | Sum of all toll costs | Represents the total spent on toll fees for orders, including returned items, helping assess logistics expenses. | | | Transaction cost | Sum of all transaction costs | Tracks the total transaction fees incurred for all orders, including returns, offering clarity on payment processing expenses. | | | Unique products sold | Returned quantity / Products sold | Tracks the quantity of unique products sold during the selected period, excluding duplicate products within the same order. | | | Unprofitable products sold | Order count where Net gross profit 2 \< 0 | Tracks orders that resulted in a loss after accounting for costs such as COGS and fulfillment. Helps identify areas contributing to negative profitability. | **Identify Loss Drivers:** Use the Product ID, Category, and Channel dimensions to pinpoint specific products or channels leading to unprofitable orders. **Reevaluate Pricing:** Adjust pricing or consider discontinuing products that frequently lead to unprofitable orders. **Optimize Marketing Spend:** Reduce or reallocate marketing spend from channels or campaigns driving high volumes of unprofitable orders. | ### Product | Metric | Formula | Description | How to use | | :- | :- | :- | :- | | Average COGS | Average cost of goods sold (COGS) | Calculates the average cost of goods sold (COGS) for all products, including material and labor costs. | | | Average COGS in inventory | Average COGS per variant, warehouse and date | Tracks the average cost of goods sold per unit across inventory over the selected period, providing insights into inventory cost trends. | | | Average sales price | Gross sales / Products sold | Measures the average price per product sold, offering insights into pricing trends and strategy effectiveness. | | | Current and incoming inventory | Current inventory + Incoming inventory + Forecasted incoming returns | Combines current inventory levels with incoming stock and forecasted returns to provide a complete view of available inventory. | | | Current inventory level | Sum of current inventory quantity across all products | Measures the total quantity of all product variants currently available in warehouses, providing an overview of stock levels. | **Inventory Insights at Different Dimensions:** This metric is especially helpful if you want to see inventory data on dimensions where inventory typically doesn't exist, such as at the channel level. This can provide valuable insights into how inventory levels correlate with marketing performance across various channels. | | Current inventory value | Current inventory level \* Average cost of goods sold (COGS) | Calculates the total value of current inventory by multiplying stock levels by COGS, helping assess the financial value of stock on hand. | | | Days in stock | (Current inventory + Incoming inventory) / Forecasted daily sales | The forecasted number of days the product will remain in stock, based on current and incoming inventory. | | | Forecast gross products sold (Next 120 days) | Sum of forecasted gross products sold for the next 120 days | Predicts the total quantity of products expected to sell during the next 120 days, aiding in demand planning and promotional strategies. | | | Forecast incoming returns (Next 120 days) | Sum of forecasted incoming returns for the next 120 days | Estimates the number of products expected to be returned on already sold orders for the next 120 days, helping anticipate inventory adjustments and returns impact. Based on historical trends and inputted return rates. | | | Forecast inventory (End of 120 days) | Current and incoming inventory - Forecasted net products sold (next 120 days) | Projects end-of-period stock levels by subtracting forecasted net products sold from current and incoming inventory, helping plan for surplus or shortages. | **Plan for Surplus Inventory:** If forecasted inventory is high, consider strategies like early markdowns, clearance sales, or additional promotional activities to reduce excess stock and free up warehouse space. **Prevent Stockouts:** If forecasted inventory is low or negative, reduce promotional visibility and adjust marketing efforts to prevent stockouts and maintain product availability throughout the season. **Optimize Reordering:** Use this metric to inform your reordering strategy, ensuring that you maintain optimal stock levels to meet forecasted demand without overstocking. | | Forecast inventory value (End of 120 days) | Forecasted end-of-period inventory \* Average historical COGS | Projects the financial value of inventory remaining at the end of the 120-day period, helping plan for stock management and potential markdowns. | | | Forecast net products sold (Next 120 days) | Forecasted gross products sold - Forecasted returns (Next 120 days) | Estimates the number of products expected to sell during the next 120 days, adjusted for historical return rates. This metric helps in planning inventory and marketing strategies by predicting future sales performance based on past trends. | | | Forecast plus actual net products sold (Next 120 days) | Forecasted net products sold + Actual net products sold | Combines forecasted net product sales with actual sales to date, providing a comprehensive view of sales performance for the period. | | | Forecast products sold (30 days) | Sum of forecasted products sold over the next 30 days | Predicts the total number of products expected to sell over the next 30 days, helping optimize inventory planning and demand forecasting. | | | Forecast products sold (30 days) compared to current inventory | Forecasted products sold (30 days) / Current and incoming inventory | Predicts the number of products expected to be sold over the next 30 days, aiding in demand and inventory planning. | | | Forecast return percent (Next 120 days) | Forecasted returns / Forecasted gross products sold | Estimates the percentage of sold products that are likely to be returned during the next 120 days, based on historical trends and inputted return rates. | | | Forecast sell-through (Next 120 days) | Forecasted net products sold (next 120 days) / Current and incoming inventory | Calculates the ratio of forecasted net products sold to total available stock (current, incoming, and forecasted returns), providing insights into inventory efficiency. | **Adjust Pricing or Visibility on Site:** If forecasted sell-through is low, consider reducing prices or increasing product visibility on the site, such as featuring them on the homepage or in product recommendations, to boost sales and reduce excess inventory. If sell-through is high, increase prices slightly or reduce visibility to maximize revenue and avoid stockouts. **Remove Overperforming Products from Feed-Based Advertising:** For products with very high forecasted sell-through rates, reduce visibility in feed-based advertising to prevent stockouts and maintain a balanced inventory. **Optimize Marketing Spend:** Allocate marketing resources towards products with low forecasted sell-through rates to boost their sales. This can help improve overall inventory turnover and avoid end-of-season markdowns. | | Historical inventory level | Sum of historical inventory quantity across all products | Represents the total quantity of all product variants available in warehouses on a specific historical date, offering insights into past stock levels. | | | Historical inventory value | Historical inventory quantity \* Average cost of goods sold (COGS) | Calculates the total value of products in inventory on a specific date, using COGS, providing insights into past stock levels. | | | Incoming inventory | Sum of all incoming inventory quantities | Represents the number of products currently en route to warehouses from suppliers, helping plan for incoming stock and inventory availability. | | | Net products sold per order | Net products sold / Order count | Calculates the average number of products sold per order after adjusting for expected returns, helping understand order composition. | | | Product conversion rate | Unique products sold / Product views | Tracks the percentage of product views that result in purchases, highlighting opportunities for optimizing product marketing and inventory management. | **Optimize High-View, Low-Conversion Products:** If products have high views but low conversion rates, consider adjusting pricing, enhancing product descriptions, or adding promotional strategies to boost sales. Use Forecast Inventory (End of Season) to determine if you are over or under stocked for these high-conversion products before adjusting pricing. **Manage Inventory for High-Conversion Products:** For products with high conversion rates but low inventory, ensure stock levels are sufficient to meet demand. You can also reduce promotional visibility or remove these products from feed-based advertising to prevent stockouts and balance demand with available supply. Use Forecast Inventory (End of Season) to determine if you are over or under stocked for these high-conversion products. **Optimize Low-View, High-Conversion Products:** For products with high conversion rates but low visibility, consider increasing their prominence on the site, such as featuring them on the homepage or in product recommendations, to drive more traffic and capitalize on their strong performance. | | Product views | Sum of all product views | Represents the total number of times products were viewed on the website during the selected period, providing insights into product popularity and customer interest. | | | Products sold compared to inventory | Products sold / Current inventory level | Compares the number of products sold to the total inventory, providing insights into sales efficiency and inventory turnover. | | | Products sold per order | Products sold / Order count | Calculates the average number of products included in each transaction, highlighting purchasing patterns and cross-selling opportunities. | | | Sizes in stock | Percentage of product sizes in stock | Tracks the percentage of product sizes available in stock compared to the total unique products, helping identify gaps in size availability. | | | Unique product views | Count of unique product views | Tracks the number of sessions in which a product was viewed at least once, excluding repeated views in the same session. | | | Unique products | Count of distinct products in stock | Measures the percentage of unique products available in stock at each warehouse compared to the total unique products tracked. | | | Unique variants in stock | Count of distinct product variants in stock | Calculates the percentage of product variants available in stock at each warehouse, offering insights into inventory completeness. | | ### Marketing performance | Metric | Formula | Description | How to use | | :- | :- | :- | :- | | Cost of sales | Marketing spend / Gross sales | Measures the percentage of revenue spent on marketing, showing how marketing affects profitability. | | | Cost per click (CPC) | Marketing spend / Clicks | Tracks the cost of each ad click, providing insight into how efficiently your budget drives engagement. | **Optimize Keyword and Audience Targeting:** If CPC is high, review your keyword bids and audience targeting criteria. Narrowing down to more specific, high-intent keywords or audiences can reduce costs and improve click quality. **Compare with CPM (Ads):** Use CPC in conjunction with CPM (Ads) to determine if your high visibility is translating into effective engagement. High CPM with low CPC can indicate good visibility but ineffective targeting. **Evaluate Ad Copy and Creative:** High CPC may be a sign that your ad copy or creative is not resonating with your audience. Test different variations to improve relevance and lower costs per click. | | Cost per mille (CPM) | Marketing spend / (Impressions / 1000) | Calculates the cost to show your ads 1,000 times, helping assess ad visibility expenses. | **Monitor Campaign Efficiency:** Use CPM (Ads) to compare the cost efficiency of different campaigns, especially in brand awareness and reach-focused strategies. A lower CPM indicates more cost-effective visibility. **Combine with Engagement Metrics:** Evaluate CPM (Ads) alongside engagement metrics like CTR (Ads) to ensure that the impressions you are paying for are resulting in meaningful interactions, not just visibility. **Adjust Bidding Strategies:** If CPM is consistently high, consider adjusting your bidding strategies or targeting options to improve cost efficiency and maximize reach within your budget. | | Cost per order | Marketing spend / Orders | Calculates the average marketing cost to generate a single order, helping you track efficiency. | **Monitor Profitability:** Ensure that your Cost per Order remains below your Net Gross Profit 2 per Order to maintain profitability. If costs are rising, revisit your marketing mix and channel allocation. | | Cost per visit | Marketing spend / Visits | Tracks the average cost of bringing a visitor to your website, using site tracking data. | | | Customer acquisition cost (CAC) | Marketing spend / New customers | Measures the cost of acquiring a new customer, calculated by dividing marketing spend by new customer count. | | | epROAS | Net gross profit 2 / Marketing spend | Compares profit after costs to ad spend, factoring in operational and fulfillment expenses for a full view of returns. | **Compare Markets for Optimization:** epROAS is excellent for comparing market performance. For example, if one market has a higher epROAS than another, investigate the reasons behind the differing profitability, such as varying fulfillment costs, return rates, or customer behavior, to optimize your strategies across regions. **Evaluate Campaign Performance:** Use epROAS to compare different campaigns within the same channel or funnel. This helps identify which campaigns deliver the best profitability, allowing you to strategically increase or decrease marketing spend based on performance. | | eROAS | Net sales / Marketing spend | Shows how much revenue is generated for every dollar spent on ads, adjusted for product returns. | **Consider epROAS for a Full Picture:** For a more complete view that includes fulfillment costs and returns, consider using epROAS. It provides a better understanding of the true profitability of your ad spend. | | Marketing spend | Sum of all marketing costs | Represents the total amount spent on marketing, including online, offline, and manually added costs. | | | New customer epROAS | New customer net gross profit 2 / Marketing spend | Evaluates the profitability of acquiring new customers by linking their profit to the marketing costs spent on acquisition. | **Focus on New Customer Acquisition:** This is a great metric if acquiring new customers is a key objective for your marketing efforts. It helps you understand the effectiveness of your spend specifically on new customer acquisition. **Compare Markets Like-for-Like:** Use this metric to compare markets fairly, especially when one market might be your "home market" where you're primarily buying back old customers, which is usually cheaper. New Customer epROAS enables you to evaluate the performance of new customer acquisition across different regions without skewing the results with existing customer purchases. | | pROAS | Gross profit 2 / Marketing spend | Measures profit generated from advertising spend, considering costs like COGS and fulfillment. | **Consider epROAS for a Full Picture:** For a more complete view that includes fulfillment costs and returns, consider using epROAS. It provides a better understanding of the true profitability of your ad spend. | | ROAS | Gross sales / Marketing spend | Shows how much revenue your ads generate for every dollar spent, based on tracked and attributed sales. | **Use ROAS (Ads) for Platform Reported Data:** If you want to see the ROAS based on the ad platforms' reported data, use the ROAS (Ads) metric, which reflects the performance directly as reported by platforms like Google and Meta. **Consider epROAS for a Full Picture:** For a more complete view that includes fulfillment costs and returns, consider using epROAS. It provides a better understanding of the true profitability of your ad spend. | ### Customers | Metric | Formula | Description | How to use | | :- | :- | :- | :- | | Average days between orders | Days between first and last order / Number of order intervals | Shows the average number of days between orders for customers who made a purchase during the selected period, based on unique order dates. | | | Customer Net Gross Profit 2 first 12 months | Average (Net gross profit 2 in the customer's first 12 months) | Shows the net gross profit 2 over the first 12 months for customers who made a purchase during the selected period. | | | Customer Net Sales first 12 months | Average (Net sales in the customer's first 12 months) | Shows net sales over the first 12 months for customers who made a purchase during the selected period. | | | Customer Orders first 12 months | Average (Order count in the customer's first 12 months) | Shows the average order count over the first 12 months for customers who made a purchase during the selected period. | | | Days since previous order | Days between the current order and the previous order | Shows the number of days between a customer's current order and their immediately previous order, based on unique order dates. | | | Lifetime value (LTV) 12 months | Average (Predicted LTV for next 12 months) | Predicts the average gross profit from customers who made a purchase during the selected period, forecasting their value over the next 12 months. For example, if the value is USD 400, it means that on average, a customer purchasing from that dimension (e.g., category) is predicted to provide additional USD 400 in profit in the upcoming year. Please note that the metric is always based on today's predicted value. | | | New customer count | Sum of all new customers | Represents the total number of new customers who placed their first order during the selected period, identified via customer IDs or emails. | | | New customer count per distinct product | New customer count / Distinct products sold | Measures the average number of new customers per distinct product, regardless of how many units of each product are sold, helping compare customer acquisition across product segments. | | | New customers (%) | New customers / Unique customers | Measures the percentage of total customers who made their first purchase during the selected period, highlighting acquisition effectiveness. | **Combine with Channel Dimension:** Use the Channel dimension to identify which marketing channels are driving the highest percentage of new customers. This can help optimize budget allocation towards the most effective acquisition channels. **Analyze Product and Category Performance:** Combine this metric with product or category dimensions to see what new customers are buying. This can provide insights into which products are most effective at converting first-time buyers. **Focus on Retention Strategies:** If the percentage of new customers is high but Orders Last 12 Months per Customer is low, consider evaluating retention strategies. | | New visitor count | Sum of all new visitors | Counts the total number of first-time visitors or sessions during the selected period, based on unique identifiers from site tracking. | | | Percentage new visitors | New visitors / Total visits | Tracks the share of first-time visitors among all website visits, using site tracking and cookie data. | | | Purchases from new customers (%) | New customer orders / Total orders | Tracks the percentage of total orders placed by new customers, providing insights into the contribution of newly acquired customers. | **Combine with Channel Dimension:** Use the Channel dimension to identify which marketing channels are driving the highest percentage of new customer orders. This can help optimize budget allocation towards the most effective acquisition channels. **Analyze Product and Category Performance:** Combine this metric with product or category dimensions to see what new customers are buying. This can provide insights into which products are most effective at converting first-time buyers. **Focus on Retention Strategies:** If the percentage of new customer orders is high but Orders Last 12 Months per Customer is low, consider evaluating retention strategies. | | Purchases from returning customers (%) | Returning customer orders / Total orders | Tracks the percentage of total orders placed by returning customers, providing insight into the contribution of existing customers. | | | Returning customer count | Unique customers - New customers | Represents the number of returning customers, calculated by subtracting new customers from unique customers. | | | Returning customers (%) | Returning customers / Unique customers | Measures the percentage of customers who made their second or later purchase during the selected period, highlighting retention and loyalty. | | | Unique customers | Sum of unique customers | Counts the unique customers who placed an order during the selected period, offering an overview of your customer base activity. | | ### Feed based marketing | Metric | Formula | Description | How to use | | :- | :- | :- | :- | | Clicks (Product ads) | Sum of all product ad clicks | Tracks the total number of clicks received from feed-based product ads during the selected period, reflecting audience engagement. | | | Cost of sales (Product ads) | Marketing spend (Product ads) / Gross sales | Measures the share of revenue spent on product ads. Should be used on product level. | | | Cost Per Order (Product ads) | Marketing spend / Order count | Calculates the average advertising cost incurred to generate each order from feed-based product ads during the selected period. | | | CTR (Product ads) | Clicks / Impressions | Calculates the ratio of clicks to impressions for feed-based product ads during the selected period, showing ad effectiveness. | | | Customer acquisition cost (CAC) (Product ads) | Marketing spend / New customers | Calculates the average cost of acquiring a new customer through feed-based product ads during the selected period. | | | Driven epROAS (Product Ads) | Driven Net gross profit 2 / Marketing spend (Product ads) | Compares the profit a product drives as entry product with the product ads spend behind it, factoring in fulfilment and return costs. | | | Driven Net gross profit 3 (Product Ads) | Driven Net gross profit 2 - Marketing spend (Product ads) | Profit from all products sold in visits where the product was the entry product, after deducting product ads spend, fulfilment and returns. | | | epROAS (Product ads) | Net gross profit 2 / Marketing spend (Product ads) | Compares profit after costs with product ads spend for the product itself, factoring in fulfilment and return costs. | | | Gross sales (Shopping ads) | Sum of all gross sales from shopping ads | Measures the total revenue generated from shopping ads during the selected period, as reported by ad platforms. | | | Impressions (Product ads) | Sum of all product ad impressions | Counts the number of times feed-based product ads were shown to users during the selected period, offering visibility insights. | | | Marketing spend (Product ads) | Sum of all product ad marketing spend | Represents the total cost of feed-based product advertisements during the selected period, as reported by ad platforms or manual inputs. | | | Marketing spend (Product ads) per product | Marketing spend (Product ads) / Distinct products advertised | Measures the average product ads spend per unique product advertised, helping compare marketing efficiency across product segments. | | | Net gross margin 3 (Product ads) | Net gross profit 3 / Net sales | Shows the profit margin for feed-based product ads after deducting marketing costs, providing insights into overall efficiency. | | | Net gross profit 3 (Product ads) | Net gross profit 2 - Marketing spend | Calculates the profit from feed-based product ads after deducting all associated costs, including marketing, during the selected period. | | | Net gross profit 3 per distinct product (Product ads) | Net gross profit 3 (Product ads) / Distinct products sold | Measures the average profit per distinct product after deducting all variable costs, including fulfilment and product ads spend. Use with product or product attribute dimensions. | | | Net gross profit 3 per order (Product ads) | Net gross profit 3 / Order count | Measures the average profit per order from feed-based product ads after accounting for all associated costs during the selected period. | | | Order count (Shopping ads) | Sum of all orders from shopping ads | Tracks the total number of orders generated from shopping ads during the selected period, as reported by ad platforms. | | | ROAS (Product ads) | Gross sales / Marketing spend (Product ads) | Shows how much revenue your product ads generate for every unit of currency spent. Should be used on product level. | | ### Traffic | Metric | Formula | Description | How to use | | :- | :- | :- | :- | | Add-to-cart events | Count of add-to-cart events | Number of distinct add-to-cart events. One event may contain multiple products. | | | Add-to-cart quantity | Sum of quantities in add-to-cart events | Total units added to cart. Accounts for quantities greater than one per line item. | | | Add-to-cart value | Sum of (price × quantity) in add-to-cart events | Total monetary value of items added to cart. Tracked event prices are not normalized the way order prices are, so they may include or exclude tax depending on your platform. | | | Average PLP position | Average product position in list views | Average position of products in product list views. Indexing depends on your tracking implementation. | | | Average visit length | Total session duration / Number of sessions | Calculates the average time visitors spend on the website per session, providing insights into user engagement and interest in the website content. | | | Bounce rate | Bounced visits / Visits | Tracks the percentage of visits where users view only one page and leave without interacting further, providing insights into landing page performance and engagement. | **Target the Right Audience:** Use the Channel group and Campaign dimensions to identify sources with high bounce rates and refine targeting or messaging. **Analyze Device Performance:** High bounce rates on mobile devices might indicate usability issues. Optimize for mobile to enhance the user experience. **Monitor Landing Page Performance:** Identify pages with high bounce rates and focus on optimizing content or functionality to improve user retention. | | Cart-to-checkout rate | Products in checkout / Products added to cart | Percentage of cart additions that proceeded to checkout. | | | Cart-to-purchase rate | Products purchased / Products added to cart | Percentage of cart additions that resulted in a purchase. | | | Checkout events | Count of checkout events | Number of distinct checkout actions. | | | Checkout quantity | Sum of quantities in checkout events | Total units present in checkout events. Includes repeated checkout events for the same cart. | | | Checkout-to-purchase rate | Products purchased / Products in checkout | Percentage of checkout items that were purchased. | | | Conversion rate | Order count / Visits | Measures the percentage of visits that result in a purchase, offering insights into the effectiveness of the website and marketing efforts in driving conversions. | **Optimize for Profitability, Not Just Volume:** When analyzing Conversion rate, also take Net gross profit 3 into account. If conversion rates are rising but profits are declining due to heavy promotions or discounts, evaluate whether the increase in sales volume justifies the decrease in profitability. **Analyze Downward Trends in Conversion:** If the Conversion rate is dropping, check whether profitability (via Net gross profit 3 per order) or Average order value has increased. It's possible that fewer, more profitable transactions are taking place. Conversely, if Conversion rate is but profits are down, reassess the products or channels driving the sales. **Test Stronger Promotional Offers Strategically:** To boost conversion rates quickly, use limited-time promotions or bundle offers. However, ensure these offers don't erode profitability by tracking the impact on both Conversion rate and Net gross profit 3. | | Event items | Count of all tracked event items | Total number of event items, counted once per product per event. Useful for understanding tracking volume. | | | Gross profit 3 per PLP impression | Gross profit 3 / PLP impressions | Gross profit 3 generated per product list page impression. | | | Net cart quantity | Add-to-cart quantity - Remove-from-cart quantity | Net units left in cart, added minus removed. | | | Net cart value | Add-to-cart value - Remove-from-cart value | Net monetary value left in cart, added minus removed. | | | New users | Count of all new users | Counts the total number of first-time visitors to the website during the selected period, helping evaluate the success of user acquisition strategies. | | | Pageviews per visit | Total pageviews / Visits | Measures the average number of pages viewed during a session, reflecting user engagement and the effectiveness of site navigation and content relevance. | **Optimize Content Strategy:** Use the Landing Page dimensions to identify which pages keep users engaged and replicate successful patterns. **Combine with Bounce Rate:** Analyze this metric alongside Bounce rate to understand if users are finding relevant content after landing on the site. | | PDP view events | Count of product detail page view events | Number of product detail page views. | | | PDP views per PLP impression | PDP view events / PLP impressions | Number of product detail page views per list impression. Can exceed 100% because one list impression may lead to several product views during the visit. | | | PLP impressions | Count of product list view events | Number of product list view events, such as category pages and search results. When grouped by product, shows how many list views included that product. | | | Products added to cart | Count of product line items in add-to-cart events | Number of product line items added to cart. One event with multiple products counts each product separately. | | | Products in checkout | Count of unique products in checkout events per visit | Unique products that appeared in checkout, counted once per visit. Multiple checkouts of the same product in one visit count once. | | | Products purchased (Tracked) | Count of product line items in tracked purchase events | Number of product line items in tracked purchase events. Tracked purchase metrics can differ from order metrics, which are reconciled with your e-commerce platform. | | | Products removed from cart | Count of product line items in remove-from-cart events | Number of product line items removed from cart. | | | Purchase events (Tracked) | Count of tracked purchase events | Number of distinct purchase events from tracking. Tracked purchase metrics can differ from order metrics, which are reconciled with your e-commerce platform. | | | Purchase quantity (Tracked) | Sum of quantities in tracked purchase events | Total units in tracked purchase events. | | | Remove-from-cart quantity | Sum of quantities in remove-from-cart events | Total units removed from cart. | | | Remove-from-cart value | Sum of (price × quantity) in remove-from-cart events | Total monetary value of items removed from cart. | | | Returning users | Users - New users | Number of returning visitors, calculated by subtracting new users from unique users. | | | Revenue per PLP impression | Gross sales / PLP impressions | Revenue generated per product list page impression. | | | Tracked events | Count of all tracked events | Number of distinct tracked events. Use together with the Event name dimension to analyse custom events. | | | Users | Count of unique users | Tracks the number of unique visitors to the website, identified by unique cookies, helping evaluate overall audience size during the selected period. | | | Value per visit | Gross sales / Visits | Calculates the average revenue generated per visit, helping to evaluate the effectiveness of website traffic and the contribution of different traffic sources. | **Improve Conversion Paths:** Enhance user experience on pages with high traffic but low value by optimizing calls to action and simplifying the purchase process. | | View-to-cart rate | Products added to cart / PLP impressions | Percentage of list impressions that resulted in an add-to-cart. | | | Visits | Count of all visits | Represents the total number of unique sessions initiated on the website, identified by unique cookies, offering insights into overall traffic volume. | | | Visits starting with product view | Count of visits whose first interaction is a product view | Number of visits where the very first tracked interaction is a product detail page view, showing initial product interest. | | | Visits with add-to-cart | Count of visits with at least one add-to-cart | Number of visits where at least one item was added to cart. | | | Visits with checkout | Count of visits with at least one checkout | Number of visits where checkout was initiated. | | | Visits with event | Count of visits with at least one tracked event | Number of visits that contain tracked events. Group by the Event name dimension to see visits per event type, including custom events. | | | Visits with PDP view | Count of visits with at least one product detail page view | Number of visits where at least one product detail page was viewed. | | | Visits with PLP view | Count of visits with at least one product list view | Number of visits where at least one product list was viewed. | | | Visits with purchase (Tracked) | Count of visits with at least one tracked purchase | Number of visits where at least one purchase event was tracked. | | ### Reported by ad platforms | Metric | Formula | Description | How to use | | :- | :- | :- | :- | | Click-through rate (CTR) | Clicks / Impressions | Calculates the percentage of ad impressions that result in clicks, showing how well your ads capture attention. Data is fetched daily from ad platforms. | **Test Ad Copy and Creatives:** Low CTR may indicate that your ad copy or creative is not resonating with your audience. Experiment with different headlines, images, and messaging to improve engagement. **Refine Targeting:** If CTR is consistently low, consider refining your audience targeting criteria. Ensure that your ads are reaching the most relevant users to increase the likelihood of clicks. **Combine with CPC (Ads):** A high CTR combined with a low CPC indicates efficient ad spend. Aim for this balance to optimize your campaigns. | | Clicks | Sum of all clicks | Tracks the number of times users click on your ads. Data is fetched daily from ad platforms. | | | Daily reach | Sum of daily reach | The number of unique users who saw your ad at least once, counted per day. Data is fetched daily from ad platforms. | | | Hold rate | Video thruplay watched / Video 3-second views | Measures how well your video retains viewers who watched the first 3 seconds. Higher values indicate more engaging content throughout the video. Meta only. | | | Hook rate | Video 3-second views / Impressions | Measures how effectively your video captures attention in the first 3 seconds, also known as thumb stop rate. Meta only. | | | Impressions | Sum of all impressions | Counts how often your ads are displayed to users. Data is fetched daily from ad platforms. | | | Inline link clicks | Sum of all inline link clicks | The number of clicks on links within your ad that led to destinations on or off the platform. Data is fetched daily from ad platforms. | | | Inline post engagement | Sum of all inline post engagements | The total number of actions people take on your ads, including reactions, comments, shares, views and clicks. Data is fetched daily from ad platforms. | | | Search budget lost impression share | Impressions lost to budget / Total eligible impressions | The percentage of impressions lost because of budget constraints. Google Ads only. | | | Search click share | Clicks / Total eligible clicks | The percentage of clicks received out of total eligible clicks. Google Ads only. | | | Search impression share | Impressions / Total eligible impressions | The percentage of impressions received out of total eligible impressions. Google Ads only. | | | Video 3-second views | Sum of all 3-second video views | The number of times your video was played for at least 3 seconds. Meta only. | | | Video play actions | Sum of all video play actions | The number of times your video ads started playing. Data is fetched daily from ad platforms. | | | Video thruplay watched | Sum of all thruplays | The number of times your video ads were played to completion, or for at least 15 seconds. Data is fetched daily from ad platforms. | | # Tracking Source: https://docs.dema.ai/guides/fundamentals/tracking Learn how Dema’s tracking script collects and processes your e-commerce data in near real-time. Understand which events are captured by default, how sessions are created (similar to GA Universal), and how to install Dema on Shopify, GTM, or via a server-side integration. ## Basic mechanics Dema tracks three **default events** on your site: * **Page views** * **Product views** * **Orders** Dema keeps two things apart: * **Users**: who the visitor is. Identified by the `DV_TRACK` cookie, see [How Dema identifies users](#how-dema-identifies-users). * **Sessions**: how that visitor's events are grouped into visits. See [How sessions work in Dema](#how-sessions-work-in-dema). *** ## Where is the script implemented? Dema offers multiple methods to deploy tracking, depending on your platform: * **Shopify**: Dema’s **web pixel** leverages Shopify’s [Web Pixel API](https://shopify.dev/docs/apps/build/marketing-analytics/pixels#requesting-consent) to automatically capture key events. No manual code injection is needed once you install the Dema app.\ [Learn how to set up tracking on Shopify](/integrations/ecommerce/shopify) * **Google Tag Manager (GTM)**: Insert the Dema tracking script as a custom HTML tag in your GTM container. Use triggers like `pageview` or `DOM ready` for standard events.\ [Learn how to set up tracking using GTM](/integrations/tracking/google-tag-manager) * **Server-side tracking**: Send data directly to Dema’s tracking endpoint from your server for maximum reliability and privacy.\ [Learn how to send data server-side](/integrations/tracking/server-side-tracking) > [!WARNING] > > **SPA support**: For single-page applications, you must manually fire Dema events on navigation or route change. Refer to our [SPA tracking guide](/guides/single-page-application) for detailed instructions. *** ## How Dema identifies users On a visitor's first visit, a user ID is created and stored in the `DV_TRACK` cookie in their browser. All subsequent events and sessions are stamped with the same user ID, which allows Dema to recognize that they originate from the same user. With server-side tracking you manage the user ID yourself and send it as `uid`. The cookie name doesn't matter there, but the value must be a UUIDv4 in its standard text form (`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`) and stay the same for the visitor across events. See [Server-side tracking](/integrations/tracking/server-side-tracking-v2). *** ## How sessions work in Dema In Dema, a **session** represents a group of user interactions that occur within a given time frame. Sessions allow us to connect actions like product views and orders to the same user, providing a comprehensive view of their journey on your site. Sessions are kept per site and per user: each visitor’s user ID has its own sessions on each of your sites. Dema groups a user's events into sessions. A session closes and a new one opens when any of these happens: * **30-minute gap**: 30 minutes or more pass since the session's last event. * **Midnight**: The day changes in your store's time zone. * **Change of channel**: The user arrives through a different channel, campaign, ad set or ad. Direct traffic doesn't count. * **Purchase**: The user places an order. Put the other way around, a new event continues the visitor’s current session only when all of these are true: * Less than 30 minutes have passed since the session’s last event. * The event falls on the same day as the session’s start, in your store’s time zone. * The event arrives through the same channel, campaign, ad set and ad as the session, or it’s direct traffic. * No order has been placed since the session started. ### When a session starts A session begins when: * A user visits your website for the first time. * A user returns to your website after the previous session has ended (e.g., after being inactive for more than 30 minutes, or after placing an order). * A user lands on your website via a **new marketing campaign**. For example: * If a user clicks on a paid ad (e.g., Google Ads or Meta campaign) with different UTM parameters than their previous visit, a new session begins. * If a user navigates organically (e.g., through bookmarks or direct links) without updated campaign parameters, it continues the previous session (if within the 30-minute window). > [!NOTE] > > A new session that starts from direct traffic takes the channel, campaign, ad set and ad of the user’s last non-direct session on the same site, if that session started within the past 90 days. For example, a user who clicks a Meta ad and comes back a week later by typing your URL gets a new session credited to that Meta ad. Direct sessions don’t extend the 90 days, and placing an order doesn’t reset them. With no non-direct session in the past 90 days, the session is direct. ### When a session ends A session ends when: * **Inactivity timeout**: There is no interaction for 30 minutes. For example, if a user browses your site and leaves, their session will close automatically after 30 minutes of inactivity. * **Channel changes**: If a user arrives on your site through a different channel, campaign, ad set or ad (e.g., updated UTM parameters, a different ad in the same campaign, or a referral from another site), a new session begins, even if the 30-minute inactivity window has not been reached. Direct traffic, such as a bookmark or a typed URL, doesn’t end the session. * **Daily reset**: Sessions reset at midnight in your store’s time zone to simplify daily reporting. * **Purchase**: An order ends the session. The user’s next event starts a new session. ### Why sessions matter By grouping interactions into sessions, Dema enables you to: * Attribute actions like orders or product views to specific marketing campaigns. * Calculate metrics like session duration and average order value. * Identify behavioral patterns, such as abandoned carts or repeat visits. > [!NOTE] > > Dema’s session logic mirrors Google Analytics Universal to provide familiar and actionable insights for your business. *** ## Referral and UTM mapping logic Dema categorizes referral traffic using a predefined list of referral sources. These sources are grouped into **channel groups** and **channels**, helping merchants understand where their traffic originates. ### How referrals are categorized When a user lands on your site via a referrer URL, Dema matches the domain against our predefined referral mapping. Each domain is categorized into one of several **traffic channel groups**: * **Search Organic**: Search engines like Google, Bing, and DuckDuckGo. * **Social Organic**: Social platforms like Facebook, Instagram, and Twitter when no ad parameters (e.g., UTM) are present. * **Display**: Ad networks or display ad providers like Google Display Network or Adform. * **Affiliate**: Traffic from affiliate marketing platforms such as Tradedoubler or Webgains. * **Retargeting**: Traffic from retargeting platforms like Criteo. * **Price comparison**: Sources like PriceSpy or Kelkoo. * **CRM**: Traffic originating from email providers such as Gmail or Yahoo Mail. * **Referral**: Generic referrals from forums, niche sites, or other uncategorized domains. > [!NOTE] > > **Default behavior**: If a referral source does not match any predefined channel groups or channels, it defaults to "Referral" unless UTM parameters override it. > [!NOTE] > > The groups above are the ones that referrer domains can be matched to. Dema supports more channel groups than these — for example Search Paid, Social Paid, Influencers, Offline and AI Paid — which are set through [UTM mapping](/guides/setup/utm-mapping) or come with your marketing cost data. The full list of channel groups and their channels is available in the [Google Sheets cost integration guide](/integrations/marketing/google-sheets). ### UTM overrides referral traffic If UTM parameters are present in the landing URL, they take precedence over the referral logic. Merchants can map UTM parameters (e.g., `utm_source=meta`, `utm_medium=cpc`) to specific channel groups or channels within Dema. For example: * `utm_source=facebook` and `utm_medium=cpc` can be mapped to "Meta – Paid Social". * `utm_source=google` and `utm_medium=organic` can be mapped to "Google Organic". This mapping system allows merchants to define custom attribution rules that better align with their business model. > [!WARNING] > > **Session resets**: When UTM parameters override a referral source, Dema starts a new session to ensure accurate campaign attribution. This behavior may result in more sessions being reported compared to systems with different attribution models. ### Predefined referral mappings Dema uses a comprehensive list of referral domains and their associated regex patterns to categorize traffic. Below are some examples: #### Organic traffic * **Google**: `((www|cse|images|encrypted)\.)?google\.[a-z]+` * **Bing**: `([a-z-]+\.)?bing\.com` * **DuckDuckGo**: `([a-z-]+\.)?duckduckgo\.com` #### Social organic traffic * **Facebook**: `([a-z-]+\.)?facebook\.com` * **Instagram**: `((www|l)\.)?instagram\.com` * **TikTok**: `([a-z-]+\.)?tiktok\.com` #### Display traffic * **Google Display Network**: `(dp|googleads|adclick|securepubads)\.g\.doubleclick\.net` * **Adform**: `track\.adform\.net` #### Affiliate traffic * **Tradedoubler**: `((clk[a-z]{2,4})?|pdt|www)\.tradedoubler\.com` * **Adrecord**: `((graphics|click|www)\.)?adrecord\.com` *** ### Why referrals matter By categorizing referral traffic and enabling UTM overrides, Dema provides merchants with: 1. **Clearer attribution**: Distinguish between organic and paid sources, even when they originate from the same domain. 2. **Customizable mapping**: Align traffic sources with your marketing strategy using the UTM mapping system. 3. **Accurate reporting**: Ensure every session is attributed to the right channel, improving ROAS and profitability analysis. > [!NOTE] > > Dema’s referral logic is designed to adapt to your business needs while maintaining accurate attribution across all traffic sources. *** ## Internal traffic and channel consistency In Dema, **internal traffic** refers to interactions originating from your own domains or trusted services, such as payment processors or checkout platforms. Handling internal traffic correctly is crucial to maintain accurate attribution and session continuity. ### How internal traffic is classified Dema uses a global list of predefined regex patterns to detect internal traffic. These patterns are designed to recognize domains commonly associated with payment gateways, banking systems, and other trusted internal services. If a referrer matches one of these patterns, the session is classified as **direct/direct** traffic. This ensures that: * Payment redirections or checkout steps do not split sessions. * Attribution is preserved for the original marketing channel. ### Custom internal traffic rules for merchants Merchants can extend or override the global internal traffic rules by adding custom regex patterns. This is particularly useful for businesses using unique payment providers or internal tools that redirect users. ### Prioritization of internal traffic Internal traffic rules take precedence over other referrer or UTM mappings. For example: * If a referrer matches both an internal pattern and an external channel (e.g., organic), Dema classifies the session as internal. * This prevents redirections from payment processors or similar services from incorrectly attributing the session to another channel. > [!NOTE] > > By ensuring internal traffic is categorized as direct/direct, Dema avoids inflated session counts and preserves accurate attribution for external campaigns. *** ## GA Universal vs. GA4 vs. Dema: Why numbers differ Analytics platforms often report discrepancies in sessions and events due to differences in **definitions**, **tracking methods**, and **technical configurations**. Below are some reasons you may see variations: ### Differences in session logic * **Dema**:\ Sessions are based on a **30-minute inactivity window**. For example, if a user leaves your site and returns after 29 minutes, the activity counts as the same session. If they return after 31 minutes, it counts as a new session. Sessions also reset at **midnight** and when UTM parameters change (e.g., switching campaigns). * **GA4**:\ GA4 uses an **event-driven model**, which focuses less on traditional session boundaries. It does not reset sessions at midnight or when UTM parameters change, resulting in **different amount of sessions reported** compared to GA Universal or Dema. ### Tracking configurations * **Bot filtering**:\ GA4 applies bot filtering, which may affect number of session counts differently to Dema's bot filtering. If bots are not filtered as aggressively in other systems, session counts could appear higher. * **Ad blockers and privacy settings**:\ Both Dema and GA4 can be affected by ad blockers or privacy tools, but GA4’s event-driven tracking may recover more interactions using first-party cookies, resulting in more accurate numbers. * **Triggering logic**:\ Dema uses explicit event triggers for `pageviews`, `product views`, and `orders`. GA4 may include automatically captured events or inferred actions, which can inflate the number of reported events and sessions. ### Technical nuances and implementation * **Cross-domain tracking**:\ Differences in how cookies persist across domains can lead to sessions being split (or not). GA4’s configuration for cross-domain tracking is different to Dema and GA Universal, potentially reducing inflated session counts. * **Timeout settings**:\ In Dema, session timeout mirrors GA Universal’s 30-minute window. GA4 allows configurable timeout windows (up to 7 hours), which can significantly impact session counts depending on user behavior. * **Handling of UTM resets**:\ Dema resets sessions when UTM parameters change to ensure accurate attribution for each campaign. GA4 does not always enforce session resets on campaign switches, leading to fewer but longer sessions. ### Additional reasons for discrepancies * **Event mapping**:\ Dema maps events explicitly (e.g., page views, product views, orders), while GA4’s model focuses on custom events with parameters. This can make GA4’s event totals appear higher or lower depending on the configuration. * **Session deduplication**:\ Dema processes data in real-time and merges updates for the same session (e.g., from webhooks and tracking scripts), minimizing duplication. GA4 may treat similar scenarios differently, potentially leading to discrepancies. * **Backfilled orders**:\ Dema fetches missing orders directly from your e-commerce platform and associates them with the correct session. GA4 may not handle backfilled data in the same way, leading to discrepancies in reported conversions. ### Platform-specific logic * **Referral traffic categorization**:\ Dema’s robust referral logic explicitly maps referrer domains into predefined categories, whereas GA4 relies on its default algorithms, which may categorize referral traffic differently or ignore some referrers. * **Internal traffic handling**:\ Dema has a built-in internal traffic whitelist (e.g., for payment providers and checkout domains) to ensure these interactions are classified as direct/direct traffic. GA4 might misattribute internal traffic as external, resulting in inflated session counts. * **Customizability**:\ Dema provides merchants with full control over mapping UTM parameters and referral logic. GA4 applies predefined logic for most attributions, which may not align with your specific business needs. > [!NOTE] > > **Key takeaway**: Discrepancies don’t mean errors. They reflect differences in methodology, offering distinct perspectives on user behavior. Dema's logic prioritizes real-time updates, session accuracy, and backfilled data to ensure a complete view of your e-commerce performance. *** ## Data privacy & compliance * **GDPR/CCPA compliance**: Dema does not enforce consent automatically. It is the merchant’s responsibility to load the script only after obtaining user consent. * **Cookie usage**: The `DV_TRACK` cookie stores only an anonymous user ID and no personal data. * **Regional considerations**: Subdomains and cross-domain tracking are supported as long as the same cookie policy is applied across domains. *** ## Verifying your tracking integration To confirm that Dema is correctly capturing data: 1. Open the **Network tab** in your browser’s developer tools. 2. Navigate to a tracked page or trigger an event (e.g., a product view or order). 3. Look for requests sent to Dema’s endpoint (`https://tracker.dema.ai`) and ensure they include relevant parameters like `eventType`, `url`, and `timestamp`. 4. Check your Dema dashboard for real-time updates to confirm data is being processed. > [!NOTE] > > If you don’t see data in Dema, ensure the script or tag is firing, and check for network issues (e.g., ad blockers or privacy settings blocking requests). *** ## Troubleshooting common issues ### Missing events or no data in the dashboard * **Verify script loading**: Use browser developer tools to confirm the tracking script is loading. Look for requests sent to Dema’s endpoint. * **Check triggers in GTM**: Ensure triggers are configured correctly and firing under expected conditions. * **Ad blockers**: Confirm that ad blockers or privacy settings aren’t preventing the script from executing. ### Duplicate or inflated session counts * **Multiple scripts**: Ensure the Dema script isn’t implemented in multiple locations (e.g., GTM and directly in the code). * **Duplicate tags in GTM**: Review your GTM container to confirm tags aren’t firing redundantly. ### Discrepancies compared to GA4 or Shopify * **Backfilled orders**: Dema fetches orders directly from your e-commerce platform, which may result in more complete data compared to GA4 or Shopify analytics. * **Different session models**: GA4’s event-based sessions differ from Dema’s session-based logic, which mirrors GA Universal. ### SPA (Single-Page Application) tracking issues * **Navigation changes not tracked**: Single-page applications (SPAs) do not trigger traditional page reloads, which can cause the Dema script to miss critical events. * **Solution**: Ensure that Dema’s tracking script is manually fired on route changes using our [SPA tracking guide](/guides/single-page-application). * **Impact**: Missed pageviews and sessions if events are not triggered correctly. ### Consent issues * **Wrong consent triggering**: The Dema script may be implemented in a way that does not align with user consent settings (e.g., firing before GDPR/CCPA consent is obtained). * **Solution**: Confirm that the script is only loaded after consent has been granted. Most platforms, like GTM or Shopify, allow conditional firing based on consent. * **Impact**: Non-compliance with GDPR/CCPA regulations or inaccurate data due to improperly tracked sessions. ### Tracking configuration mismatches * **Inconsistent UTM parameters**: If UTM parameters are not consistently applied across platforms (e.g., missing on ad links), sessions may not align properly. * **Solution**: Regularly audit your campaign links to ensure UTM parameters are correctly structured and mapped in Dema. * **Improper cross-domain tracking**: Inaccurate cookie persistence across subdomains or separate domains can lead to session splits or misattribution. * **Solution**: Use a consistent domain policy and configure cross-domain tracking in Dema to unify sessions across all domains. ### Other potential issues * **Event deduplication**: If custom event triggers are misconfigured (e.g., firing on both page load and scroll), you may see inflated event counts. * **Solution**: Audit and refine your custom event configurations to prevent redundant triggers. * **Delayed data visibility**: Network issues or high server load may delay event processing. * **Solution**: Check for delays in the Dema dashboard and ensure the tracking endpoint (`https://tracker.dema.ai`) is reachable. > [!WARNING] > > Unresolved issues may lead to gaps in data, compliance risks, or inaccurate reporting. Always test your tracking setup thoroughly after changes. # Analyze a suggested experiment Source: https://docs.dema.ai/guides/incrementality-testing/analyze-suggestion Learn how to interpret the suggested experiment table in Dema and what each metric represents. > [!NOTE] > > When Dema generates a suggested experiment, it provides a detailed table to > help you understand how the test is structured and what to expect. This table > breaks down the test's estimated performance metrics and key characteristics > of the treatment and control groups. ## How Dema selects the markets Before showing you a suggestion, Dema searches for the treatment/control split that will give the most reliable read. For each candidate split it runs a series of **back-tests** on your historical data: * It builds the synthetic control on past data and checks how well control tracks treatment **out of sample** — on periods the model didn't train on. * It injects a known, artificial lift and checks whether the design **detects it** (power) and recovers it **accurately**. * It runs an **A/A check** — looking for lift when none was applied — to confirm the split doesn't flag effects that aren't real (false positives). Each back-test shifts one period further back through history (a "lookback window" — a week by default for market selection), and the candidates are ranked on this combined evidence. The result is the suggested split, together with the statistics and model-quality diagnostics below so you can judge it yourself. ## Understanding the suggested experiment table When Dema generates a suggested experiment, it provides a detailed table to help you understand how the test is structured and what to expect. This table breaks down the test’s estimated performance metrics and key characteristics of the treatment and control groups. Here’s what each column represents: ### Experiment statistics 1. **Estimated spend** * The amount of advertising spend that will be removed (in a decrease spend test) or added (in an increase spend test) in the treatment group. * This helps you understand the magnitude of the change being tested. 2. **Spend previous period** * The amount of advertising spend during the same time period as the planned test, but before the test begins. * This serves as a baseline to compare current spending and measure changes. 3. **Estimated total gross sales** * The total gross sales expected across all regions in the test, including both treatment and control groups. * This provides an overview of total expected revenue during the test period. 4. **Estimated incremental gross sales** * The amount of sales expected to be lost (in a decrease spend test) or gained (in an increase spend test) in the treatment group due to the test. * This is calculated based on the ROAS or epROAS applied to the estimated spend changes. 5. **Treatment group proportion** * The percentage of regions assigned to the treatment group versus the control group. * A lower proportion indicates that fewer regions will experience the test intervention, helping to reduce potential disruptions. 6. **Estimated lift due to marketing** * The percentage change in performance (e.g., sales, profit) expected as a result of the test. * This metric indicates the potential impact of the experiment. 7. **Minimum detectable effect (MDE)** * The smallest measurable change that can be reliably detected by the test. * This reflects the sensitivity of the test design; smaller MDE values indicate higher sensitivity. 8. **Average detected lift** (shown in the app as **Minimum potentially detectable lift**) * The average lift the synthetic-control model **actually recovered** during back-testing at the smallest effect size that reaches the power threshold — a measure of the design's sensitivity (the smallest lift it could potentially detect), not what the test inferred. * This is **not** the same as the MDE: the MDE is the smallest effect the design *can* detect, while average detected lift is what the model *measured* at that effect size when a known lift was injected. 9. **Treatment group correlation** * The correlation between treatment and control groups in terms of historical performance. * Higher correlation values (e.g., above 90%) indicate that the groups are well-matched, which improves the reliability of the test. 10. **Required scaling** (for scaling tests) * A helper metric that shows how large the required scaling should be for the test. * This metric helps you understand the magnitude of spend changes needed in the treatment group to achieve meaningful results. ## Model quality diagnostics A close historical match isn't automatically a *good* match — a model can fit the past so tightly that it fails to predict the future (overfitting). The **Model quality** view reports diagnostics that distinguish a genuinely reliable split from an overfit one. Use them to gauge how much to trust a result before acting on it. | Diagnostic | What it tells you | What good looks like | | - | - | - | | **False positive rate** | How often the model detected a lift when none was applied (an A/A test across historical windows). | At or below the experiment's significance level (alpha). Higher means the split may flag effects that aren't real. | | **Lift estimation error** | How far the model's detected lift was from a known lift injected during back-testing, at the minimum detectable effect. | Close to 0%. Higher means the model estimates lift less accurately. | | **Effective control markets** | The effective number of control markets the synthetic control actually leans on, shown as `~N of M` available controls. | Close to the number of available controls. A low number means the comparison rests on just a few markets and is more fragile. | | **Out-of-sample prediction error** | On periods the model did **not** train on, how far its prediction of the sales was from actual, as a share of average sales. Unlike an in-sample fit, this can't be inflated by overfitting. | Low — a tight, honest match (e.g. under \~10%). Higher means the model predicts the treatment group poorly out of sample. | | **Generalization score** | In-sample error divided by out-of-sample error across historical windows, scored from 0 to 1. | Higher is better: **close to 1** the match generalizes well; **near 0** means the model fit the past too closely and may not hold up during the test (overfitting). | | **Out-of-sample stability** | How consistent the out-of-sample error stays as the back-testing window slides through history (a stability score from 0 to 1). | Higher is better: **above 0.5 is stable, 0.3–0.5 is moderate, under 0.3 is fragile**. Shown as N/A with fewer than 3 lookback windows. | | **Back-testing windows** | How many times the proposed setup was re-tested on earlier slices of history. Each window shifts the test back by one period (a week by default). | Typical: 3. More windows give a more confident read but make the check stricter (fewer setups pass). Raise it (5–10) for stable markets; lower it (1–2) for seasonal or volatile data. | > [!TIP] > > Read these together, not in isolation. A trustworthy split has a **low > out-of-sample prediction error**, a **generalization score near 1**, **stability > above \~0.5**, a **false positive rate at or below alpha**, and an **effective > control count** that isn't far below the number of available control markets. ### Geographical targeting > [card] Treatment > > Lists the regions (e.g., zip codes or commute zones) included in the > treatment group, where the test intervention will occur (e.g., spend > increased or decreased). > [card] Control > > Lists the regions included in the control group, which serves as the > baseline for comparison. > [!TIP] > > **Download CSV**: Provides a downloadable file with the full list of treatment > and control regions for detailed review and implementation. > [!NOTE] > > **Control weights.** Each control region carries a weight — how much it > contributes to the synthetic control. **Every** control region stays listed even > when its weight is `0`, so you always see the full pool that was considered. > Regions with a negligible weight are shown as exactly `0` (they don't > meaningfully back the control), and the [effective control > markets](#model-quality-diagnostics) count reflects only the regions that > actually carry weight. In the displayed map, control regions are colored according to the weights they contribute with. ## How to use this information ### Interpreting estimated metrics * **Understand the impact on spend and sales**: Compare the estimated spend and incremental gross sales to gauge the scale and potential outcomes of the test. * **Plan for changes in overall performance**: Use the estimated total gross sales to anticipate any shifts in overall revenue during the test period. * **Assess test sensitivity**\*: Review the MDE and treatment group correlation to ensure the test design is robust and likely to yield actionable insights.\* ### Preparing for the te*st* > [!WARNING] > > To ensure successful test implementation: > > * **Align with your team**: Share the treatment and control group details with your team to ensure everyone is aligned on the regions affected. > * **Download the targeting details**: Use the CSV file to streamline campaign adjustments in ad platforms. By understanding the suggested experiment table, you can effectively plan and execute tests that drive meaningful insights into the incremental impact of your marketing efforts. # Concurrent tests Source: https://docs.dema.ai/guides/incrementality-testing/concurrent-tests Learn how to run multiple 2-cell experiments concurrently in Dema and understand the risks and best practices. > [!NOTE] > > Concurrent testing means running multiple experiments at the same time. While this approach can speed up insights, it also increases the chance that tests might affect one another, potentially influencing your results. ## Managing concurrent 2-cell experiments When running more than one 2-cell experiment in the same country, it's important to balance faster insights with the risk of test overlap. Here's our view on how risk increases as you add more experiments in a market: > [card] Two 2-cell experiments > > Generally low risk, though it's wise to check for any overlapping areas between test groups. > [card] Three 2-cell experiments > > Higher risk. We recommend reviewing the overlap between each pair of tests to help ensure one experiment does not skew the results of another. > [card] More than three experiments > > Considerable risk. Only proceed if you understand that increased interference may blur the true effects, and you're prepared to accept that risk for business-critical decisions. *Note: These guidelines apply to a single country. For example, you might run two 2-cell tests in the United States and another test in the United Kingdom.* ## Guidelines for markets with few regions > [!NOTE] > > For countries or regions with fewer than 50 unique areas, we strongly recommend running a single 2-cell experiment. This helps prevent overlap and keeps your insights clear. Larger markets like the US, AU, IN, UK, DE, IT, and ES typically offer enough regions to support multiple concurrent tests. ## Risks of too many concurrent tests Running many tests at once can lead to: * **Understated results:** The true impact of your marketing might appear smaller than it is because the tests interfere with one another. * **Confusing outcomes:** Overlapping experiments can produce results that are hard to interpret or may mix effects from different tests. * **Attribution challenges:** It becomes more difficult to determine which experiment is responsible for specific changes in performance. ## Strategies to reduce risk ### Smaller control group size Reducing the size of your control group can help lower the risk of overlap, as long as it remains large enough to provide a solid baseline for comparison. ### Overlap analysis Dema offers tools to review the extent to which your experiments overlap. Work with your Customer Success Manager to use these insights and adjust tests as needed to minimise interference. ### Balanced budget allocation Keeping budgets similar across experiments not only creates a fair comparison but also helps reduce interference between tests. Note that if spend is too low, it may be harder to detect a significant impact. ### Running platform tests alongside geo tests > [!WARNING] > > If you run a conversion lift study on a platform (like Meta or Google) at the same time as a geo-based test, keep in mind that it counts as one of your concurrent tests. Evaluate the overlap between these tests carefully to avoid unintended interactions. By understanding and managing these factors, you can run multiple 2-cell experiments concurrently in Dema while maintaining clear and actionable insights. For more detailed guidance or if you have specific concerns, please reach out to your Dema specialist. # How incrementality testing works in Dema Source: https://docs.dema.ai/guides/incrementality-testing/how-it-works Learn how Dema's incrementality testing isolates the true impact of your marketing campaigns on both sales and profit. > [!NOTE] > > Incrementality testing helps you measure the **true causal impact** of your > marketing campaigns. Instead of relying on correlation-based metrics (like > attribution models), it uses controlled experiments to see what really happens > when you **increase or decrease** marketing spend. > [!TIP] > > **Key idea:** Incrementality testing answers the question: *Would we have seen > the same results without this marketing spend?* ## How Dema approaches incrementality testing Dema's methodology is based on **geo-experiments**, where we compare treatment regions (where we modify marketing spend) to control regions (where spend continues as usual). This helps isolate the actual effect of marketing. > [card] Lift Test > > Treatment regions have ads paused or reduced (holdout treatment) to measure > how much performance drops without marketing. > [card] New Channel Test > > Treatment regions receive new channel ads to see if it drives incremental > sales and profit beyond existing marketing efforts. > [card] Scaling Test > > Treatment regions have ad spend increased or decreased to measure the > incremental impact of adjusting marketing efforts. > [!NOTE] > > Unlike traditional methods that only focus on **sales**, Dema's platform > allows you to measure **profit impact** as well. Since we track **NGP2 and NGP3 > (Net Gross Profit)**, we can calculate **effective ROAS (epROAS)**—a > profit-based ROAS that includes costs like returns and marketing spend. ## Three-phase approach to testing Dema's testing framework consists of three key phases: **1. Design** **Selecting treatment and control regions** * We use historical data to find similar regions based on marketing activity, sales trends, and seasonality. **Using synthetic control groups** * Instead of simple A/B splits, we create a **weighted blend of control regions** that best mimic the treatment region's past performance. * **Example:** If Los Angeles is a treatment region, our model might determine that 50% of Houston, 30% of Phoenix, and 20% of Denver together best match LA's historical trends. This makes the comparison more accurate than a random split. **Grouping zip codes by commute zones** * We recognize that people often shop and commute across city boundaries. * Instead of using rigid geographic lines, we cluster zip codes into **commute zones** where consumers travel frequently. * This ensures our treatment and control regions reflect actual shopping behavior. **2. Implementation** **Region assignment** * Dema provides the list of treatment and control regions * Ensures alignment with **real-world consumer movement patterns** **Campaign adjustments** * Your team adjusts campaign settings in ad platforms * Either increasing spend (new channel treatment) or pausing campaigns (holdout treatment) **Test execution** * The experiment runs for a set duration to collect enough data for analysis **3. Analysis** Once the test is complete, we analyze results using **synthetic control modeling**: **Comparing actual vs. predicted outcomes** * Check how sales and **profitability** in treatment regions compare to control group trends * Evaluate performance against baseline expectations **Measuring incremental lift** * Calculate the increase or decrease directly caused by marketing spend changes * Isolate true causal impact from other factors **Calculating incremental ROAS and epROAS** * Unlike standard ROAS based on clicks/views * **Incremental ROAS** isolates true marketing impact * **epROAS** incorporates profit margins, costs, and return rates > [!WARNING] > > By focusing on **incrementality**, Dema ensures you're making data-driven > decisions based on the **actual business impact** of your marketing, not just > attributed conversions that might have happened anyway. # Methodology: from raw orders to lift Source: https://docs.dema.ai/guides/incrementality-testing/methodology A walkthrough of how Dema turns raw orders into an incrementality result — the level inference runs at, how regional data is aggregated, how each metric is measured, and why some numbers can look different depending on where you read them. > [!NOTE] > > This page explains *how* Dema computes an incrementality result, end to end. It > answers three questions customers ask most often: **at what level is inference > applied**, **how is regional data aggregated**, and **why can numbers differ > depending on the metric or the chart you're looking at**. ## From raw orders to a result Every incrementality result is produced by the same pipeline. Understanding the steps makes the outputs — and any apparent discrepancies — much easier to reason about. **1. Orders are located** Each order is mapped to a geographic location from its delivery or billing postal code. Postal codes are normalized first (for example, UK postcodes are reduced to the outward code) so that every order lands in a consistent geographic unit. There is also an option to map the orders by the location of their placement, which, in some cases, may improve the model quality. **2. Locations are grouped into zones** Postal codes are clustered into **zones** — commute zones, DMAs, or the regional units appropriate for your market. Zones reflect real-world shopping behavior (people shop across city boundaries), so they make better treatment and control units than rigid administrative lines. **3. Data is aggregated by zone and period** Within each zone, orders are summed into periods for the metric being measured — **daily by default**, with a weekly option. The result is a balanced panel: one value per zone per period. Periods with no orders in a zone are filled with zero so the time series is continuous. **4. A synthetic control is built** The treatment zones are combined into a single treated series. Dema then builds a **synthetic control**: a weighted blend of the remaining (control) zones chosen to track the treated series as closely as possible during the pre-test period. See [How incrementality testing works](/guides/incrementality-testing/how-it-works) for the intuition behind synthetic control. **5. Lift is measured** During the test, lift for each time unit is the gap between what the treatment zones actually did and what the synthetic control predicts they *would* have done without the change. Summed over the test, that gap is your **incremental value**; expressed against spend it becomes your incremental ROAS / epROAS / CAC. ## At what level inference runs Inference always runs at the **geographic-zone level**, on data aggregated by period (daily by default, with a weekly option). It does **not** run at the individual-user or individual-campaign level. This is deliberate. A geo experiment compares whole regions, so it captures the *total* effect of a marketing change — including effects that user-level platform studies miss (people who were influenced but never clicked, cross-device journeys, and offline or word-of-mouth spillover). For why this is more trustworthy than platform-reported, user-level lift studies, see [Platform lift studies](/guides/incrementality-testing/platform-lift-studies). ## Each metric is measured independently When you switch the metric dropdown (Gross Sales, Net Sales, Net Gross Profit 2, New / Returning Customer profit, New Customer Count), Dema does **not** re-scale a single shared result. Each metric is measured by its **own, independent synthetic control model**, fitted on that metric's own zone-period panel. > [!NOTE] > > Because each metric is a separate model, the lift, confidence interval, and > p-value for one metric do **not** mechanically follow from another. It is normal > and expected for, say, Gross Sales and Net Gross Profit 2 to show different > magnitudes — and occasionally different signs — for the same test. A profit > metric can move differently from a revenue metric because returns, discounts, > and margins behave differently across regions. This is a feature of measuring > what you actually care about, not an inconsistency in the data. ## How significance is established A measured gap between treatment and control is only meaningful if it is unlikely to have happened by chance. Dema establishes this with a **randomization (permutation) test** rather than a textbook formula that assumes a particular data distribution: * Dema repeatedly reshuffles the timing of the observed differences to simulate what "no real effect" would look like for your specific data. * The **p-value** is the share of those random arrangements that look at least as extreme as your actual result. A low p-value means a gap this large rarely appears by chance. * The **confidence interval** shown on the charts expresses the same uncertainty as a range around the estimate. See [Understand test results](/guides/incrementality-testing/understand-test-results#what-is-a-confidence-interval) for how to read it. The quality of the underlying match is reported separately, so you can judge *before* trusting a result whether the synthetic control was a good fit. Those diagnostics are covered in [Analyze a suggested experiment](/guides/incrementality-testing/analyze-suggestion#model-quality-diagnostics). ## Why numbers can look different It's common to compare two views and notice they don't tie out exactly. In almost every case this traces to one of the following — none of which means a result is wrong. ### The chart is a focused view; the model learns from much more The treatment and control lines on the results charts are a **zoom around the test window** — they show roughly the test period plus a short lead-in, because that's the part you want to inspect. The synthetic control model itself is fitted on a far longer stretch of history (on the order of a year) so it can learn each zone's seasonality and trend. So if you sum the values visible on the chart, you are summing the *display window*, not the full history the model used. The headline incremental value is computed by the model over the test window using that longer-trained baseline — it is not meant to equal a hand-sum of the visible chart points. ### Results settle for a few days after the test Order data is not final the moment an order is placed. Refunds, cancellations, late-arriving conversions, and geographic enrichment all continue to settle for a few days. As a result: * **Pre-test history is stable** — it has long since finalized, so the model's baseline and its fit quality barely move between runs. * **The most recent test/post-test days keep adjusting** as data finalizes, which is why the incremental value and ROAS can shift slightly if you re-open a result immediately after the test versus a few days later. > [!TIP] > > If you need to compare two numbers exactly, compare results computed at the same > time and over the same window. Reading the headline metric a few days after the > test period closes gives the most stable figure. ### Aggregation cadence Inference aggregates orders into periods (daily by default, or weekly). If you compare against a report built on a different cadence, totals can differ slightly even though they describe the same underlying orders. ### Each metric is its own model As covered [above](#each-metric-is-measured-independently), switching the metric re-fits a separate model. Differences between metrics are expected, not a sign of instability. > [!NOTE] > > For any result you're unsure about, the fastest check is the model-quality > diagnostics on the experiment — they tell you directly whether the synthetic > control was a trustworthy match. See [Analyze a suggested > experiment](/guides/incrementality-testing/analyze-suggestion#model-quality-diagnostics). # Platform lift studies vs Dema Source: https://docs.dema.ai/guides/incrementality-testing/platform-lift-studies Understand the differences between platform conversion lift studies and Dema's geo-based incrementality tests, and why Dema provides a more reliable, neutral measurement. ## Understanding the difference between platform conversion lift and Dema's geo-based testing Both **platform conversion lift studies** (like Meta & Google's Conversion Lift) and **Dema's geo-based testing** are designed to measure incrementality, but they do so in different ways: * **Platform conversion lift** studies use a **user-level treatment**, randomly selecting individuals who will not see ads (user-level holdout treatment) while measuring how their behavior differs from users who do (control group). * **Dema's geo-testing** applies a **regional treatment**, where certain geographic areas have modified ad spend (either paused as holdout treatment or increased for new channel tests) while other regions continue as usual (control group). These two approaches are **compatible** because one operates at the **individual level** and the other at the **regional level**. As long as user-level selection aligns with regional selection, the methodologies do not interfere with each other. ## Why should you run Dema's geo-testing instead of platform tests? While platform conversion lift studies can be useful, they come with limitations that make results harder to compare across platforms. Here's why Dema's methodology provides a more neutral and consistent measurement of incrementality: * **Different attribution windows make platform comparisons difficult.** Each platform applies its own attribution rules (e.g., Meta might use a 7-day click window, while Google uses a different lookback period). This makes cross-platform comparisons **inconsistent and unreliable**. * **Platforms measure their own performance.** Since platforms run their own lift studies, they are inherently biased in how they define attribution, conversions, and reporting—potentially inflating their own perceived impact. * **Dema acts as an independent, neutral measurement layer.** Our methodology applies the **same measurement approach across all platforms**, ensuring fair comparisons without platform-specific biases. * **More control over experiment setup.** With Dema, you can structure tests to align with real-world budget allocations and **track both sales and profit impact (epROAS, GP2, GP3)** instead of just platform-defined conversions. > [!NOTE] > > By running Dema's geo-testing, you get a **standardized, unbiased view** of marketing effectiveness that allows you to make truly data-driven decisions across all platforms. ## Should you run both types of tests at the same time? This depends on your priorities. Running them in parallel is possible because both treatment groups are created randomly, meaning one test will not skew the other's results. However, you may want to consider the **opportunity cost of treatment groups**: running multiple tests at once means a larger share of your audience or regions will experience modified ad spend, which could impact your total reach. ## What if the results from both tests don't match? > [!WARNING] > > If user-level and geo-level tests provide conflicting results, it could indicate that **one test has unintentional bias**. Some potential factors include: > > * **Demographic or behavioral weighting differences:** User-level treatment groups may accidentally overweight certain audience segments (e.g., younger users or high-frequency shoppers), leading to skewed outcomes. > * **Regional differences in purchasing behavior:** Even with randomization, some areas may have different baseline conversion rates due to local economic conditions, brand presence, or competitive factors. Dema's synthetic control methodology is designed to create a **balanced and representative comparison**, minimizing regional biases. In practice, most businesses find that platform lift studies and geo-based experiments produce **consistent results**. However, if discrepancies arise, **running an additional test** can help validate findings and refine marketing decisions. By leveraging both approaches thoughtfully, you can gain a **deeper understanding of incrementality**, using geo-testing for **real-world budget allocation insights** and user-level lift studies for **granular audience measurement**. # Post-treatment window Source: https://docs.dema.ai/guides/incrementality-testing/post-treatment-window Discover how Dema uses a post-treatment window to capture delayed marketing effects and provide a complete picture of your campaign's performance. > [!NOTE] > > A post-treatment window (PTW) is the period after an experiment ends where we continue measuring results to capture any delayed impact of ad exposure. In other words, it accounts for lagging customer behavior—cases where people take time to convert after seeing an ad. ## When should you use a post-treatment window? Using a post-treatment window makes sense if: * You’re selling a high AOV product with a long decision-making cycle. * You’re measuring upper-funnel or brand-focused campaigns, such as YouTube ads. * The KPI you’re tracking naturally has a delay (e.g., a free-trial sign-up that takes time to convert into a paid subscription). * You want to see if there are additional conversions occurring after the main experiment period ends. ## How do we handle post-treatment windows? > [!NOTE] > > When setting up an experiment, you can define a post-treatment window, typically up to the length of the original test. Extending it further risks introducing noise that isn't directly caused by the experiment. We provide: * **A standard analysis at the end of the main test period.** * **An additional analysis covering the post-treatment window**, allowing you to see any delayed impact compared to control regions. * **Results presented both with and without the post-treatment window**, ensuring transparency on how long-term effects contribute to overall lift. ## Why does post-treatment window length matter? If the post-treatment window is too long, it can **dilute the cumulative lift measurement**. This happens because: * External factors start influencing conversions, making it harder to isolate the experiment’s true impact. * Background noise and unrelated customer behaviors get included, reducing clarity on how much lift was truly driven by the marketing activity. To ensure accuracy, we recommend choosing a post-treatment window that balances capturing real lagging effects without introducing excessive noise. # Seasonality effects Source: https://docs.dema.ai/guides/incrementality-testing/seasonality Learn how Dema adjusts for seasonality in incrementality testing to ensure accurate measurement of marketing impact. > [!NOTE] > > Seasonality plays a major role in business performance, and without properly accounting for it, marketing experiments can produce misleading results. Seasonal shifts—like Black Friday, holiday shopping, or even weather-driven trends—can impact sales and customer behavior, making it critical to ensure that experiments reflect true marketing impact rather than external fluctuations. ## How Dema accounts for seasonality Dema uses a time-based comparison approach in which both **treatment and control regions experience the same seasonal conditions**. Because both groups are exposed to the same external factors, such as increased demand during peak shopping periods, any observed differences in performance can be attributed to marketing efforts rather than seasonal changes. ### Synthetic control for seasonality adjustment Dema's synthetic control methodology automatically adjusts for seasonal effects by comparing pre-test and post-test performance between treatment and control regions. This means that fluctuations in customer demand, such as holiday-driven sales spikes, are reflected in both groups, ensuring that the test measures **incrementality, not seasonality**. ## How external factors impact seasonality adjustments ### Testing during peak periods (e.g., Black Friday, holiday sales) If you're testing during a major promotional period, the impact of seasonality is already baked into both the treatment and control groups, so the test remains valid. However, it's important to consider whether your **marketing effectiveness might change during promotions**. > [!TIP] > > **Example:** A Meta campaign running during Black Friday might show stronger performance than usual, but that doesn't mean the same results will apply outside of peak shopping events. For the best insights, we recommend testing in both promotional and non-promotional periods to understand how marketing impact varies. ### How regional promotions affect results If a promotion applies **nationwide**, it should not interfere with the experiment since both test and control regions are exposed to the same offer. > [!WARNING] > > If the promotion applies **only to certain regions**, those areas should be excluded from the experiment. Regional price differences or localized discounts can distort results and make it harder to isolate the true impact of marketing. ### Weather and other unpredictable factors Dema's approach naturally adjusts for broad weather-driven effects. If weather affects sales in both test and control regions equally (e.g., an unseasonably warm winter that boosts apparel sales nationwide), the experiment remains valid. However, if extreme weather events affect only some test regions (e.g., hurricanes, snowstorms), additional adjustments may be necessary to prevent skewed results. ## Running experiments during softer business periods Seasonality isn't just about peak sales—it's also important to consider how testing during **low-demand periods** can impact results. * If budgets are significantly reduced during these periods, it can be difficult to achieve statistical power. * Instead of scaling back testing, softer periods can be used for **strategy optimization tests** on larger channels. * Staying active in low-demand periods can help ensure strong algorithmic learning for when demand picks up again. ## Handling unexpected volatility Even with seasonality adjustments, unexpected volatility (e.g., supply chain disruptions, major economic shifts) can introduce anomalies in experiments. Dema incorporates **outlier detection and cleaning strategies** to smooth out localized spikes. If volatility is evenly distributed across test and control regions, it will balance out over time. However, if a major, localized event disrupts only part of the experiment, results may require further evaluation. ## Summary: Best practices for seasonality in experiments * **Always test with control groups exposed to the same seasonal conditions.** * **Consider testing in both peak and non-peak periods** to understand how marketing effectiveness varies. * **Exclude regions with unique external factors,** such as localized promotions or extreme weather events. * **Be mindful of low-demand periods,** ensuring there is enough budget to maintain statistical power. * **Use historical data to estimate expected variability,** ensuring experiments are set up for accuracy. # Structuring tests Source: https://docs.dema.ai/guides/incrementality-testing/structuring-tests Learn how to design and structure incrementality experiments in Dema to measure true business impact. ## Experiment design Dema supports three core types of tests to help you measure and optimize marketing performance: ### 1. Lift test A test where the treatment group has ads paused or reduced (holdout treatment) to measure the true incremental impact of your marketing efforts. > **Example:** A brand runs ads on a platform like Meta and wants to see if those ads drive incremental sales. Dema selects treatment regions where ads will be paused, while control regions continue as usual. ### 2. New channel test A test where the treatment group receives ads in a new channel to measure its incremental contribution to sales or profit. > **Example:** A company experiments with TikTok ads to determine if they deliver incremental value beyond existing marketing efforts. ### 3. Scaling test A test where the treatment group has marketing spend increased or decreased to measure the incremental impact of scaling campaigns up or down. > **Example:** A brand wants to understand the incremental impact of doubling their Google Ads spend in specific regions. Dema selects treatment regions where spend will be scaled up, while control regions maintain their current spend levels. *** ## How to set up a test **1. Click 'New experiment'** Navigate to the experiment dashboard and select "New experiment" to start setting up your test. **2. Fill in the experiment details** * **Type of test**: Choose between "Lift test" or "New channel test" based on your testing goal * **Experiment name**: Provide a descriptive name to identify your experiment * **Storefront**: Select the relevant storefront for the test * **Country**: Choose the geographic location where the test will run. With one treatment country, the test runs on regions within that country by default, but you can choose to run it as a country-level experiment instead. With two or more treatment countries, the test always runs at the country level. * **Channel and funnel**: Select the marketing channel (e.g., Google, Meta) and the relevant funnel. You can select a specific funnel (e.g., Upper Funnel) or "All funnels" if running campaigns like Meta ASC * **Target KPIs**: Choose between "Gross Sales" or "Net Gross Profit 2 (GP2)". If you select GP2, you'll set an **effective ROAS (epROAS)** target * **Test period**: Set the start date and duration (typically 6-8 weeks) **3. Review and create** After filling in the details, review your selections and click "Create experiment." Dema will use this information to suggest statistically optimized experiment designs. ## How test length and ROAS/epROAS affect test structure > [tab] Test Length > > * **Shorter tests (4-6 weeks)**: Requires larger treatment group to achieve statistical significance > > * **Longer tests (8+ weeks)**: Allows smaller treatment group while maintaining statistical power > > > [!TIP] > > > > **Recommendation:** Choose the longest feasible test period to maximize precision while minimizing the required treatment group size. > [tab] ROAS Expectations > > * **High ROAS/epROAS** (>500%): Smaller differences between groups may still be meaningful, allowing smaller treatment group > > * **Low ROAS/epROAS** (100-200%): Requires larger treatment group to identify smaller incremental differences > > > [!NOTE] > > > > **Example:** A company testing GP2 as a KPI with a 300% epROAS target will need a carefully balanced treatment group to ensure enough precision, especially if the expected lift is modest. ### Balancing treatment group size and precision The treatment group size impacts both accuracy and opportunity cost: * **Larger treatment groups (30-50%)**: Provide greater precision but affect more regions during the test * **Smaller treatment groups (10-20%)**: Minimize disruption but may result in wider confidence intervals > [!NOTE] > > Dema dynamically calculates the optimal treatment group size based on your > test length, expected ROAS/epROAS, and the variability in your historical > data. ## Best practices for all tests ### Active campaign management To minimize variables and maintain a business-as-usual strategy during testing, ensure that any adjustments—such as deploying or pausing ads—are applied consistently across both treatment and control groups. This ensures that performance differences are driven solely by the test variable, not by operational discrepancies. An experiment is tied to the campaigns that matched its channel and funnel when you set it up. If campaigns have since been added to or removed from that funnel, for example new or renamed campaigns, Dema shows the changes and asks you to confirm which additions and removals to accept before an experiment edit or run proceeds. Any change you don't accept keeps the original campaign selection, and a campaign can't be both included and excluded. The same confirmation applies when the Dema Agent edits or runs an incrementality test for you. ### Budget consistency Keep budgets evenly distributed to isolate the effect of the variable being tested. While budget variations can occur, Dema's analysis adjusts for these differences to provide meaningful insights into incremental lift and efficiency. ### Delayed response effects Some channels may exhibit delayed responses to marketing actions. Dema supports a post-treatment observation window to capture lagging conversions or sales, ensuring the full impact of your marketing efforts is accurately measured. # Terminology Source: https://docs.dema.ai/guides/incrementality-testing/terminology Key terms and concepts used in Dema's incrementality testing documentation. > [!NOTE] > > This guide explains the key terminology used throughout Dema's incrementality > testing documentation to help ensure clarity and consistency. ## Test Structure Terms ### Treatment and Control Groups **Treatment Group** Regions where marketing spend is modified for the experiment. There are three types of treatment: * **Holdout treatment**: Regions where ads are paused or reduced * **New channel treatment**: Regions where new channel ads are added * **Scaling treatment**: Regions where marketing spend is increased or decreased **Control Group** Regions where marketing spend continues as usual (business as usual). Used as the baseline for comparing treatment effects. ### Geographic Terms **Commute Zones** Clusters of zip codes that represent real-world consumer movement patterns, accounting for how people shop across city boundaries. **Regions** Geographic areas (typically groups of zip codes) used to segment test and control groups. ## Statistical Terms ### Confidence and Precision **Confidence Interval** The range of values within which the true incremental impact is likely to fall, indicating the precision of results. **MDE (Minimum Detectable Effect)** The smallest change in performance that can be reliably detected by the test given its design. ### Experiment Metrics **Treatment Group Proportion** The percentage of regions assigned to the treatment group (e.g., 13%). A lower proportion means fewer regions are affected by the test intervention. **Estimated Lift** The predicted percentage change in performance (e.g., -9.96% indicates an expected decrease in performance when ads are paused in a lift test). **Minimum Detectable Effect (MDE)** The smallest percentage change the test can reliably detect (e.g., -10% means the test can identify true effects of this size or larger). It describes the design's sensitivity — not the lift the model measured. **Average Detected Lift** (shown in the app as **Minimum potentially detectable lift**) The average lift the synthetic-control model actually recovered during back-testing at the smallest effect size that reaches the power threshold — a measure of the design's sensitivity (the smallest lift it could potentially detect), not what the test inferred. Distinct from the MDE: the MDE is the smallest effect the design *can* detect, while average detected lift is what the model *measured* when a known effect of that size was injected. **Power** The probability that the test detects a real effect of a given size when one is present. Higher power means the design is more likely to catch a genuine lift. **Treatment Group Correlation** How well the treatment and control groups match historically (e.g., 94.61%). Higher correlation (>90%) indicates well-matched groups for reliable comparison. **P-value** The probability of observing the measured difference if there were truly no effect (the null hypothesis). A low p-value means a gap this large would rarely occur by chance. ### Model Quality Diagnostics These metrics distinguish a genuinely reliable market split from one that fit the past too closely (overfitting). See [Analyze a suggested experiment](/guides/incrementality-testing/analyze-suggestion#model-quality-diagnostics) for how to read them together. **False Positive Rate** How often the model detected a lift when none was applied, across historical A/A back-tests. Good: at or below the experiment's significance level (alpha). **Lift Estimation Error** How far the model's detected lift was from a known lift injected during back-testing. Good: close to 0%. **Out-of-sample Prediction Error** On periods the model didn't train on, how far its prediction was from actual sales, as a share of average sales. Cannot be inflated by overfitting. Good: low (e.g. under \~10%). **Generalization Score** In-sample error divided by out-of-sample error, scored from 0 to 1 (higher is better). Good: close to 1 (the held-out fit is about as good as the pre-period fit — it generalizes); near 0 signals overfitting. **Out-of-sample Stability** How consistent the out-of-sample error stays as the back-testing window slides through history, scored from 0 to 1. Higher is better: above 0.5 stable, 0.3–0.5 moderate, under 0.3 fragile. **Effective Control Markets** The effective number of control regions the synthetic control actually leans on (`~N of M` available). A low number means the comparison rests on few markets and is more fragile. **Back-testing / Lookback Windows** How many times the proposed match was re-tested on earlier slices of history; each window shifts back by one period. Typical: 3. ### Analysis Methods **Synthetic Control** A weighted blend of control regions created to best match the treatment region's historical performance patterns. **Incremental Factor** The ratio of incremental value to spend, representing either incremental ROAS or epROAS depending on the target variable. ## Test Types ### Platform-Specific Terms **User-level Treatment** Used in platform studies (like Meta's Conversion Lift), where individual users are randomly selected to not see ads. **Regional Treatment** Used in Dema's geo-testing, where entire geographic regions have their marketing spend modified. ### Time Periods **Pre-treatment Period** The baseline period before the test begins, used to verify group matching. **Post-treatment Window** The observation period after the test ends to capture delayed effects of marketing. > [!NOTE] > > For any terms not covered here or for more detailed explanations, please reach > out to your Dema specialist. # Understand test results Source: https://docs.dema.ai/guides/incrementality-testing/understand-test-results Learn how to interpret key metrics, graphs, and insights from Dema's incrementality test results. > [!NOTE] > > Dema's test results provide a clear breakdown of performance between your > **treatment group** (regions where marketing spend is modified) and **control > group** (regions where spend continues as usual). This page helps you evaluate > whether your marketing efforts drove true incremental lift in key metrics such > as sales and profit. ## Test types and group definitions > [card] Lift Test > > The **treatment group** consists of regions where ads are paused or reduced > (holdout treatment), while the control group continues business as usual. > [card] New Channel Test > > The **treatment group** consists of regions receiving ads in the new > channel, while the control group continues with existing channels only. > [card] Scaling Test > > The **treatment group** consists of regions where marketing spend is > increased or decreased, while the control group maintains current spend > levels. ## Navigating the test results interface ### Selecting metrics to analyze In the upper right corner of the test results dashboard, you'll find a dropdown menu that allows you to select which metric to analyze: * **Gross Sales**: Analyzes total revenue (ROAS) * **Net Sales**: Analyzes revenue after returns and discounts (eROAS) * **Net Gross Profit 2**: Analyzes profit contribution (epROAS) * **New Customer Net Gross Profit 2**: Profit contribution from new customers only * **Returning Customer Net Gross Profit 2**: Profit contribution from returning customers only * **New Customer Count**: Analyzes customer acquisition (CAC) The metric you select will determine which performance indicators are displayed throughout the dashboard. > [!NOTE] > > **Each metric is measured independently.** Switching the metric doesn't re-scale > one shared result — Dema fits a **separate synthetic control model** for each > metric. So the lift, confidence interval, and p-value for one metric don't > mechanically follow from another, and it's normal for revenue and profit metrics > to differ in magnitude (or occasionally sign) for the same test. See > [Methodology](/guides/incrementality-testing/methodology#each-metric-is-measured-independently) > for why. ## Key metrics explained ### Core metrics 1. **Spend** * The total advertising spend during the test period, shown separately for treatment and control groups * This helps quantify the investment used to drive the observed lift * Spend is also plotted over time in the **Total spend** chart, which follows the [Cumulative / Daily](#cumulative-vs-daily-views) toggle like the other time-series charts 2. **Net sales** * The total sales observed in the treatment group compared to the control group * The difference between these values is a core indicator of incrementality 3. **Incremental value** * The additional sales generated by the treatment group beyond what the control group achieved * This measures the true incremental impact of your ads 4. **Incremental factor (incremental ROAS)** * The ratio of incremental value to spend. Depending on the target variable, this represents: * **ROAS**: If the target variable is Gross Sales * **eROAS**: If the target variable is Net Sales * **epROAS**: If the target variable is Net Gross Profit 2 (net profit) * **CAC**: If the target variable is New Customer Count ## Understanding scaling tests Scaling tests measure the incremental impact when you increase or decrease marketing spend in specific regions. To accurately calculate results, Dema needs to understand how spend was distributed between your treatment and control groups. Most ad platforms don't provide detailed spend breakdowns by geographic region, so Dema offers three ways to handle this: 1. **Separate campaign budgets**: Duplicate your campaigns so that treatment and control zones run on fully separated budgets. 2. **Automatic estimation**: Use session data as a proxy to estimate how spend was likely distributed. 3. **Manual spend entry**: Manually specify the spend change using a well-informed estimate based on your knowledge of the scaling applied to the treatment group. ### Cost estimation By default, scaling tests infer the cost distribution using session data. This estimate allows the platform to attribute measured incrementality to the underlying spend shift, even when exact regional spend data isn't available from your ad platform. ## Interpreting the graphs ### Comparison graph This bar chart compares three different measurement approaches: * **Incremental ROAS or CAC**: The true incremental return measured through the test (treatment vs. control) * **Ad Platform ROAS or CAC**: The return as reported by the advertising platforms themselves * **Dema MTA ROAS or CAC**: The return as calculated by Dema's Multi-Touch Attribution model > [!NOTE] > > Comparing these three measurements provides valuable context about how > platform-reported performance may differ from true incremental performance. > The metric displayed (ROAS, eROAS, epROAS, or CAC) will change based on which > metric you've selected for analysis in the dropdown menu. ### Cumulative vs. Daily views A **Cumulative / Daily** toggle sits above the lift analysis charts and controls how the time-series charts are drawn: * **Cumulative** (default): each series is shown as a **running total** building up from the start of the test (the pre-test period is flattened to zero). This is the clearest way to read the *total* impact accumulated by any point in the test. * **Daily**: each series is shown at its **per-period level** (or per-period change), so you can see day-to-day movement and spot when the effect started, spiked, or faded. Both views describe the same result — cumulative is the integral of daily — so use whichever answers your question. ### Lift analysis charts The lift analysis section contains four complementary charts that help you understand the test results: 1. **Lift chart** (top left): * Shows the trends for both treatment and control groups * Helps identify when and how the treatment began affecting performance > [!NOTE] > > * **Parallel trends in pre-test periods**: This confirms that the groups were well-matched before the experiment began > * **Divergence during the test period**: A clear gap between the treatment and control groups indicates incremental lift from marketing activities 2. **Total spend chart** (top right): * Shows total (treatment and control group) advertising spend over the test for the channel under test * For lift and scaling tests it includes spend leading into the test, so the change at the start of the test period is visible in context (new-channel tests have no pre-test spend, so only the test period is shown) 3. **Causal effect chart** (bottom left): * Shows the incremental impact over time * The shaded area represents the confidence interval 4. **Efficiency over time chart** (bottom right): * Shows how your performance metric (ROAS, eROAS, epROAS, or CAC) evolves throughout the test * Helps identify when marketing efficiency peaked or declined > [!NOTE] > > The specific metric shown in these charts (ROAS, eROAS, epROAS, or CAC) will > change based on which metric you've selected for analysis in the dropdown > menu. ## Key terms and FAQs ### What is a confidence interval? > [!NOTE] > > A confidence interval (C.I.) represents the range of values within which the true incremental impact is likely to fall. Narrower intervals indicate more precise results, while wider intervals suggest more variability or uncertainty in the data. > > **Example:** If the C.I. for incremental sales is 100-500 units, the true impact is likely within this range, though the point estimate (e.g., 300 units) is considered the best approximation. ## Drawing actionable insights ### If results show significant lift: * **Validate platform metrics**: Compare test results with platform-reported performance to ensure consistency. * **Optimize for profit**: Focus on campaigns or regions with the highest incremental ROAS to maximize profitability. ### If lift is minimal or negative: * **Evaluate creative or targeting**: Test new ad formats, messaging, or audience segments. * **Test alternative channels**: Explore whether shifting spend to other platforms could improve results. By understanding and interpreting Dema's test results, you can make data-driven decisions that optimize your marketing spend and drive true business impact. # What is incrementality Source: https://docs.dema.ai/guides/incrementality-testing/what-is-incrementality Learn how incrementality testing isolates true marketing impact and enhances MMM. ## What is incrementality compared to attribution? Attribution models and incrementality testing both aim to measure marketing impact, but they do so in fundamentally different ways. ### Attribution: Assigning credit to touchpoints Attribution models (such as last-click, first-click, or data-driven attribution) attempt to allocate credit for conversions to different marketing touchpoints. These models help marketers understand which channels or campaigns are involved in the customer journey. > **Example:** A customer clicks on a Google ad before purchasing a product. Attribution models may assign credit to the ad, but the customer might have purchased the product anyway—even if they had never seen the ad. #### Limitations of attribution models * **They assume correlation equals causation.** Just because a user clicks on an ad doesn't mean the ad caused the purchase. * **They don't account for organic behavior.** Some customers would have converted without any marketing exposure. * **They struggle with cross-device tracking and walled gardens.** As users move between devices and platforms, attribution models often lose visibility. > [!TIP] > > **Key question:** *Would this sale have happened without the ad?* > > Unlike attribution, which assigns credit based on observed behavior, incrementality testing **proves whether marketing is driving additional revenue or profit beyond what would have happened organically**. ### Where does MMM fit in? Marketing mix modeling (MMM) is another approach used to measure marketing impact, particularly at a broader level. It uses statistical models to analyze historical data and estimate how different marketing channels contribute to overall sales. #### Strengths of MMM * **Provides a holistic view** across all channels, including online and offline marketing. * **Doesn't rely on user-level tracking**, making it privacy-friendly. * **Useful for long-term budgeting and strategic decisions.** #### Limitations of MMM * **Requires large amounts of historical data** and works best with longer timeframes. * **Less precise for tactical optimizations,** since results are often aggregated and not at the individual campaign level. * **Difficult to measure rapid changes,** as updates require recalibrating the model. ### How incrementality testing enhances MMM While MMM provides a **big-picture view**, incrementality testing offers a **high-precision measurement** of specific campaigns or channels. Running both in parallel allows marketers to: * Validate and calibrate MMM results with real-world experiments. * Use incrementality testing for tactical decisions (e.g., testing a new channel or campaign change) and MMM for strategic planning. * Ensure that media mix decisions are based on **causal impact** rather than just historical correlations. ### Applying incrementality results to attribution Incrementality experiments produce **causal multipliers**: how much of a channel's attributed value is truly incremental. Dema's [Causal factor attribution](/guides/causal-factor-attribution/how-it-works) uses these results to adjust MTA attribution values, giving you attribution data grounded in causal evidence rather than just observed correlations. Even without running your own experiments, Dema provides benchmarked incremental factors from platform-wide data. ### Summary * **Attribution** models track and assign credit but don't prove causality. * **MMM** estimates overall channel impact but works best at a high level. * **Incrementality testing** directly measures the true lift from marketing spend through controlled experiments. * **Causal factor attribution** bridges the gap by applying incrementality evidence (or benchmarks) to your attribution data. > [!NOTE] > > By combining these approaches, marketers can get both **high-level strategic insights** and **precise causal measurement** of their campaigns. # Planning future budgets Source: https://docs.dema.ai/guides/mmm/create-a-future-scenario Learn how to use Dema's MMM to plan upcoming marketing budgets, optimize for profit targets, and test different allocation strategies. ## Why future planning matters After analyzing your historical performance, the next step is shaping your **upcoming marketing plan**. Dema's MMM enables you to forecast various spend allocations, set constraints and targets, and see projected impacts on profit before committing to changes. *** ## Planning with future date ranges To plan future budgets, select a forward-looking date range from the date picker: ![Date picker for selecting future periods](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-date-picker.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=268ae33b8b15e11d77cb57abc9429511) | Option | Description | | - | - | | **Next week** | Recommendations for the upcoming week | | **Next 4 weeks** | Recommendations for the next month | | **Custom range** | Select specific future dates | When viewing future periods, the model: * Incorporates predicted **seasonality** and trends * Uses the most recent **saturation curve parameters** * Applies your configured **guardrails and constraints** * Shows **forecasted recommendations** rather than historical analysis *** ## Configuring optimization settings Before viewing future recommendations, configure your optimization settings in the **Model settings** panel: ![Model settings panel](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-model-settings.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=77991815c1d8cb08e81d39b382ddc7a5) ### 1. Select your optimization target Choose what metric to optimize for: | Target | Best for | | - | - | | **Gross sales** | Revenue growth, market share | | **Net gross profit 2** | Balanced profitability | | **Net gross profit 3** | Maximum profit focus | | **New customer NGP2 + LTV** | Customer acquisition value | ### 2. Set budget constraints Define your overall budget parameters: * **Marketing spend min/max**: Set acceptable range as percentage of current spend * **Min ROAS**: Ensure minimum return threshold is met * **Min epROAS**: Ensure minimum profit return threshold is met ### 3. Configure guardrails Set limits on how much spend can change: * **Global guardrails**: Default max decrease/increase for all channels (e.g., ±30%) * **Channel-specific guardrails**: Override limits for specific channels that need different treatment > [!TIP] > > See the [Model settings](/guides/mmm/model-settings) guide for detailed information on configuring optimization parameters. *** ## Interpreting future recommendations When viewing a future date range, the interface shows: ### Overview tab * **Metric cards**: Projected optimized vs. baseline performance * **Opportunities**: Markets and channels with highest forecasted potential * **Spend matrix**: Recommended allocation changes across markets and channels ![Overview showing spend matrix for future planning](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-overview-spend-matrix.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=9fed66aa99d380aba26b6cba862b1ab9) ### Details tab * **Spend recommendation table**: Specific recommendations per channel * **Saturation curves**: Projected optimal points based on forecasted parameters * **Contribution forecasts**: Expected contribution from each channel ![Spend recommendation table with future recommendations](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-overview-table.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=f8877685fcfce99cc35784c14ff7df4d) *** ## Working with constraints ### Budget-constrained planning If you need to work within a specific budget: 1. Set **Marketing spend max** to your target (e.g., 100% to maintain current spend) 2. The model will optimize allocation within that constraint 3. View the "missed potential" to understand what additional budget could achieve ### Performance-constrained planning If you need to maintain specific returns: 1. Set **Min ROAS** or **Min epROAS** to your threshold 2. The model will only recommend allocations that meet these targets 3. Some channels may receive zero spend if they can't meet the threshold ### Channel-specific constraints Use channel-specific guardrails for: * **Locked channels**: Set 0% increase/decrease to maintain current spend * **Testing channels**: Allow higher increase limits for channels you want to scale * **Protected channels**: Set lower limits for brand campaigns you want to maintain *** ## Scenario comparison Compare different future scenarios by: 1. **Create multiple configurations**: Set up different MMM configurations with different constraints 2. **View the same date range**: Compare recommendations across configurations 3. **Analyze trade-offs**: Understand how different constraints affect projected outcomes ### Example scenarios | Scenario | Marketing spend max | Global guardrails | Min return | | - | - | - | - | | **Conservative** | 100% | ±15% | 150% | | **Growth focused** | 130% | ±40% | 200% | | **Efficiency focused** | 80% | ±30% | 200% | *** ## From plan to execution ### Step 1: Review recommendations 1. Check the **spend recommendation table** for specific changes 2. Verify **certainty indicators** are acceptable 3. Review **saturation curves** to understand the rationale ### Step 2: Validate with constraints 1. Ensure recommendations respect your business constraints 2. Check that total spend aligns with your budget 3. Verify return projections meet your targets ### Step 3: Implement gradually 1. Don't make all changes at once if they're large 2. Use the guardrails as a guide for maximum weekly changes 3. Monitor early signals in ad platforms (CPC, CTR, conversion rates) ### Step 4: Track and iterate 1. Compare actual results to forecasted performance 2. Adjust constraints if recommendations consistently miss the mark 3. Re-run future analysis weekly to incorporate new data *** ## Best practices ### Start with realistic constraints * Keep ±30% default guardrails if you're new to optimization * Tighten constraints gradually as you gain confidence * Allow wider ranges for testing and scaling opportunities ### Account for seasonality * Future recommendations incorporate predicted seasonality * Compare to same period last year for context * Be cautious about extreme recommendations during peak periods ### Consider adstock timing * Changes in slow-adstock channels take weeks to show full impact * Don't expect immediate results from awareness channel adjustments * Give sufficient time before evaluating performance ### Balance certainty and opportunity * Prioritize high-certainty channels for large changes * Consider running incrementality tests for uncertain channels * Use smaller changes for channels marked "Run test" ### Iterate weekly * Dema's MMM updates with new data every day * Re-run future planning to incorporate latest performance * Adjust course based on actual vs. forecasted results > [!TIP] > > Create a weekly rhythm: Review last week's performance on Monday, plan next week's budget on Tuesday, implement changes Wednesday, and monitor signals throughout the week. # Details view Source: https://docs.dema.ai/guides/mmm/details Learn how to analyze spend recommendations, saturation curves, adstock effects, and channel contributions in Dema's MMM Details view. The **Details** view provides in-depth analysis of your marketing performance and optimization recommendations. It includes detailed spend recommendations, visualizations of saturation curves, adstock effects, and historical contribution breakdowns. Access the Details view by clicking the **Details** tab when viewing an MMM configuration. *** ## Spend recommendation table The spend recommendation table is the primary tool for understanding what changes the model recommends for each channel. ![Spend recommendation table showing channels with certainty indicators](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-overview-table.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=f8877685fcfce99cc35784c14ff7df4d) ### Table columns | Column | Description | | - | - | | **Channel** | Marketing channel name with platform icon | | **Proposed marketing spend** | Recommended spend amount and % change vs. actual | | **Actual marketing spend** | What was actually spent in the selected period | | **ROAS** | Achieved ROAS and % change vs. actual spend scenario | | **epROAS** | Effective profit ROAS and % change vs. actual | | **Certainty** | Model confidence indicator for this channel | ### Understanding the certainty column Each channel displays a certainty indicator based on data quality and calibration: | Indicator | Appearance | Meaning | | - | - | - | | **High** | Green dot | High confidence—reliable data and/or calibrated with experiments | | **Medium** | Orange dot | Moderate confidence—reasonable data but some uncertainty | | **Calibrated** | Blue dot | Channel has been calibrated with incrementality experiment results | | **Run test** | Red dot | Low confidence—recommend running an incrementality test | > [!TIP] > > Prioritize implementing recommendations for channels with "High" or "Calibrated" certainty. For channels showing "Run test", consider running an incrementality experiment before making large budget changes. ### Summary rows The table includes summary rows at the bottom: | Row | Description | | - | - | | **Paid marketing** | Totals for all paid marketing channels | | **Baseline** | Organic/brand contribution (not controllable via spend) | | **Seasonal** | Seasonal effects contribution | | **Control** | Custom control variable contributions | | **Total** | Sum of all contributions | ### Relative vs. Absolute toggle Use the **Relative / Absolute** toggle in the table header to switch between: * **Relative**: Shows percentage changes (e.g., +15%, -8%) * **Absolute**: Shows actual currency amounts (e.g., €3,000) *** ## Channel contribution chart The contribution chart shows how each channel has contributed to your target metric over time. ![Channel contribution stacked area chart](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-channel-contribution.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=070e88d6a962cc7a469c322c2511c20e) ### Reading the chart * **X-axis**: Time (weekly) * **Y-axis**: Contribution to target metric * **Colored areas**: Stacked contribution from each channel ### What it shows * **Channel mix evolution**: How the balance of channel contributions changes over time * **Seasonality patterns**: Peaks and troughs in overall performance * **Baseline contribution**: The dark area at the bottom showing organic/brand performance > [!TIP] > > Use this chart to understand historical trends. If a channel's contribution has been declining despite stable spend, it may be reaching saturation. *** ## Saturation spend chart The saturation chart visualizes the diminishing returns curve for each channel, showing the relationship between spend and profit. ![Saturation curves showing multiple channels](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-saturation-curves.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=13c823d5d5af9d0058555d50344b745e) ### Understanding saturation curves Each curve shows: * **X-axis**: Marketing spend amount * **Y-axis**: Contribution to target metric * **Curve shape**: How returns diminish as spend increases ### Key points on the curve | Point | Meaning | | - | - | | **Current spend** | Where you're currently spending (dot on curve) | | **Optimal spend** | The point where marginal returns equal marginal costs | | **Saturation point** | Where the curve flattens—additional spend yields minimal returns | ### Interpreting the curves 1. **Steep early curve**: Channel has high efficiency at lower spend levels 2. **Flat curve**: Channel is near or past saturation 3. **Dot to the right of optimal**: You're overspending on this channel 4. **Dot to the left of optimal**: You're underspending—room to scale Each channel is represented by a different colored curve, with dots indicating current spend positions. ### Daily vs. Full period toggle Use the toggle to switch between: * **Daily**: Shows curves based on daily parameters (more granular) * **Full period**: Shows aggregated curves for the entire selected period ### Tooltip information Hover over any point on the curve to see: * Channel name * Marketing spend amount * Target metric contribution * Return at that spend level * Marginal return (incremental return on next dollar) ![Saturation curve tooltip showing detailed metrics](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-saturation-curves-hover.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=44d816b201b00a70493abf08ba8eaedc) > [!TIP] > > When marginal return drops below 100%, additional spend is no longer profitable. The optimal point is where marginal return equals approximately 100%. *** ## Cumulative adstock effect chart The adstock chart shows how advertising effects accumulate over time for each channel. ![Cumulative adstock effect chart](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-cumulative-adstock.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=e95f357dd0be302593f96ef29c69198c) ### Understanding adstock Adstock represents the **carryover effect** of advertising: * When you spend on a channel, the impact doesn't happen instantly * Effects build up over days/weeks before reaching full impact * Eventually, effects decay as the advertising impression fades ### Reading the chart * **X-axis**: Time (weeks after spend) * **Y-axis**: Cumulative effect (0% to 100%) * **Curves**: Each channel's accumulation pattern ### Interpreting adstock curves | Curve type | Meaning | Typical channels | | - | - | - | | **Steep (fast rise)** | Quick impact, short memory | Search, Shopping, Retargeting | | **Gradual (slow rise)** | Delayed impact, long memory | Display, Video, Awareness | ### Practical implications 1. **Fast adstock channels**: Changes in spend will show results quickly (1-2 weeks) 2. **Slow adstock channels**: Need patience—full impact takes 4+ weeks to materialize 3. **Testing considerations**: Allow sufficient time for experiments on slow-adstock channels > [!TIP] > > When evaluating channel performance, account for adstock timing. A recent spend increase on a slow-adstock channel won't show full returns immediately. *** ## Missed potential chart The missed potential chart compares actual performance against what could have been achieved with optimal spend allocation, based on your configured **Model settings** (optimization target, budget constraints, and guardrails). ![Missed potential chart showing actual vs potential profit](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-missed-potential.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=d7ff473212ae3223e2cecc0eb6d44ae3) ### Reading the chart The chart shows two bars: * **Actual profit**: What you actually achieved * **Potential profit**: What optimal allocation would have achieved within your configured constraints The gap between them represents **missed potential**—profit left on the table due to suboptimal allocation. This calculation respects your guardrails and budget limits, so tighter constraints will reduce the potential gap. ### Using missed potential data 1. **Quantify opportunity**: Understand the value of optimization in concrete terms 2. **Prioritize action**: Large missed potential indicates high-priority optimization opportunities 3. **Track improvement**: Monitor how missed potential decreases as you implement recommendations *** ## Filtering and aggregating the Details view Use the **View** panel on the right sidebar to customize what's displayed and how data is organized. ### Aggregation (pivot) The aggregation setting allows you to pivot your data by different dimensions. This is one of the most powerful features for analyzing your marketing performance from different angles. ![Aggregation dropdown showing pivot options](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-details-aggregation.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=21249eb76d18f8daaa955c563bcbba65) | Mode | What you see | Best for | | - | - | - | | **Channel** | All channels aggregated across all markets | Comparing channel performance holistically | | **Market** | All markets aggregated across all channels | Identifying regional optimization opportunities | | **None** | Full granularity: channel × market combinations | Detailed analysis of specific combinations | > [!TIP] > > Start with **Channel** aggregation to get an overview of which channels need attention, then switch to **None** to drill down into specific market-channel combinations that drive the opportunity. ### Markets filter Filter which geographic markets are included in the analysis: 1. Expand the **Markets** section in the View panel 2. Check/uncheck markets to include or exclude them 3. Use **Select all** to quickly include all markets When you filter markets, all tables, charts, and metrics update to show only data from the selected markets. ### Channels filter Filter which marketing channels are displayed: 1. Expand the **Channels** section in the View panel 2. Check/uncheck channels to show or hide them 3. Use **Select all** to quickly include all channels This is useful for: * **Platform analysis**: Show only Meta or Google channels * **Funnel analysis**: Show only awareness or performance channels * **Focus view**: Hide channels that aren't relevant to your current analysis ### Metrics filter Control which metrics appear in tables: 1. Expand the **Metrics** section in the View panel 2. Check/uncheck metrics to show or hide them Available metrics include: * Marketing spend * New customer NGP2 + LTV * Net gross profit 3 * Net gross profit 2 * Gross sales * ROAS * epROAS *** ## Date range selection The date range affects what period is analyzed: | Period type | Shows | | - | - | | **Historical** (Last week, etc.) | Actual vs. optimal for past performance | | **Future** (Next week, etc.) | Forecasted recommendations for upcoming periods | > [!NOTE] > > Historical analysis helps validate model accuracy and understand what could have been achieved. Future analysis provides actionable recommendations for upcoming budget decisions. *** ## From analysis to action ### Implementing recommendations 1. **Review the spend table**: Identify channels with significant recommended changes 2. **Check certainty**: Prioritize high-certainty channels 3. **Verify with curves**: Confirm the recommendation makes sense given the saturation curve 4. **Consider adstock**: Account for timing when setting expectations 5. **Apply changes gradually**: Respect guardrails to avoid disrupting ad algorithms ### Weekly workflow 1. **Monday**: Review last week's Details to understand performance 2. **Analyze**: Check which recommendations you implemented and their results 3. **Plan**: Use forward-looking analysis for next week's budget allocation 4. **Implement**: Update budgets in ad platforms based on recommendations 5. **Monitor**: Track early signals (CPC, CTR) to validate changes # How MMM works in Dema Source: https://docs.dema.ai/guides/mmm/how-mmm-works Learn how Dema's Marketing Mix Modeling uses profitability-focused models to optimize your marketing spend and maximize profit. ## How Dema approaches MMM Dema's **Marketing Mix Modeling (MMM)** is designed to help you optimize your marketing investments by focusing on profitability rather than just sales. The model supports multiple optimization targets and empowers you to allocate your budgets more effectively by identifying where further spending yields diminishing (and potentially unprofitable) returns. > **Key Idea:** Traditional MMM tools often optimize for sales or ROAS. Dema's model goes a step further by identifying where additional spend isn't profitable, making it easier to **maximize profit** instead of just revenue. *** ## Optimization targets Dema's MMM supports four different optimization objectives, allowing you to align the model with your business goals: ![Model settings showing optimization target selection](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-model-settings-objective.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=abab578d50de45cd90e2daa954345679) | Target | Description | | - | - | | **Gross sales** | Optimize for total revenue without accounting for costs | | **Net gross profit 2 (NGP2)** | Optimize for gross sales minus returns, COGS, and fulfillment costs | | **Net gross profit 3 (NGP3)** | Optimize for NGP2 minus marketing spend | | **New customer NGP2 + LTV** | Optimize for new customer acquisition value plus their predicted lifetime value | You can switch between these targets in the **Model settings** panel to see how recommendations change based on your strategic priorities. *** ## Funnel-based modeling for accuracy During onboarding, you'll define **funnels** that reflect your marketing strategy. These funnels let you group campaigns by their purpose or goal. For example: * **Lower funnel**: Meta campaigns containing "lower" in their name. * **Upper funnel**: Google Display or awareness-focused campaigns. Using funnels ensures the MMM model accurately reflects how you manage your marketing channels. Dema's modeling draws on these funnel groupings to capture the unique contribution of each channel to profitability. *** ## Profit-first modeling Dema's MMM centers on **saturation curves** (also known as profitability curves): ![Saturation curves showing diminishing returns per channel](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-saturation-curves.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=13c823d5d5af9d0058555d50344b745e) * **Diminishing returns**: Each channel's impact on profit decreases as you spend more, represented by curves where returns eventually plateau or become negative. * **Profitability threshold**: Dema pinpoints the moment where an additional dollar of spend no longer generates positive profit. By focusing on profit rather than sales, you can avoid overspending in pursuit of revenue alone. This approach helps you discover exactly where your marketing budget delivers the best possible **profit impact**—not just top-line sales. *** ## Adstock modeling Marketing effects don't happen instantly—they **accumulate over time**. Dema's MMM includes **adstock modeling** to capture this delayed impact: * **Cumulative effect**: When you spend on advertising, the impact builds up over subsequent days and weeks before reaching its full effect. * **Decay rate**: The effect gradually diminishes over time as brand awareness fades and customers complete their purchase journey. ### Understanding adstock curves The **Cumulative adstock effect** chart shows how quickly each channel reaches its full impact: ![Cumulative adstock effect showing how channels accumulate impact over time](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-cumulative-adstock.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=e95f357dd0be302593f96ef29c69198c) * **Steeper curves**: Indicate faster accumulation—the channel reaches its full impact sooner after the spend. * **Flatter curves**: Suggest the effect unfolds more gradually over a longer period. This is particularly important for awareness channels (like display or video) which often have longer adstock periods compared to performance channels (like search). > [!TIP] > > Channels with longer adstock periods may appear less effective in short-term analysis but can drive significant value over time. Consider this when evaluating upper-funnel investments. *** ## Model calibration Dema's MMM can be calibrated with **incrementality experiments** to improve accuracy and reliability. ![Incrementality experiment calibration](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-geolift-calibration.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=359d079e4add606c8c067b9971191ff8) When you run incrementality tests, the results are fed back into the MMM to calibrate channel effectiveness. This provides ground-truth measurements that improve model accuracy. Country-level experiments can't be used to calibrate the MMM. ### Certainty indicators Based on calibration data, each channel receives a **certainty indicator**: ![Certainty indicators in the spend recommendation table](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-overview-table.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=f8877685fcfce99cc35784c14ff7df4d) | Indicator | Meaning | | - | - | | **High** (green) | High model confidence—consistent historical data and/or successful calibration | | **Medium** (orange) | Moderate confidence—limited data or some uncertainty in estimates | | **Calibrated** (blue) | Channel has been calibrated with incrementality experiment data | | **Run test** (red) | Insufficient confidence—recommend running an incrementality test | > [!TIP] > > Channels marked with "Run test" are good candidates for incrementality testing. Running an experiment will provide calibration data and improve model confidence. *** ## How the modeling works 1. **Data ingestion** * Dema taps into your **historical spend**, traffic, conversions, and profit data (including marketing costs), all of which is already cleaned and enriched within the platform. * **Minimum one year of data** is required to capture seasonality and establish a robust baseline. * Relevant **control variables** (e.g., holidays, discounts, inventory levels) are also integrated. 2. **Time-varying baseline** * Dema accounts for factors like organic traffic and brand strength to build a baseline model for both sales and profit. * **Seasonality** and **brand growth** are automatically included. 3. **Funnel-based modeling** * Your predefined funnels guide the model in grouping campaign activities. * Dema uses advanced statistical approaches (Bayesian methods) to create separate **models per market**, updated daily. 4. **Adstock and saturation transformations** * Marketing spend is transformed using adstock (carryover effects) and saturation (diminishing returns) functions. * These transformations capture real-world marketing dynamics. 5. **Calibration integration** * Incrementality experiment results are incorporated as priors to improve accuracy. * The model continuously learns from new calibration data. 6. **Control variables** * Events like Black Friday, product launches, or discount periods can be included. * For **additional control variables** not automatically tracked (e.g., offline activities), you can provide this data to Dema's MMM specialists for integration. > [!TIP] > > **Control variables:** These are custom events or factors that influence your performance (e.g., holiday periods or special discounts). Dema's MMM specialists can help you set them up for improved accuracy. *** ## Model validation & diagnostic checks Dema uses **hold-out validation** and **goodness-of-fit** measures to ensure each MMM is reliable and accurate: * **Hold-Out Validation**: Part of your historical data is withheld from the training process. The model's performance is then measured against this "unseen" data. * **Goodness-of-Fit Metrics**: Indicators like R-squared or MAPE show how closely the model's predictions align with actual performance. > [!TIP] > > **Spotting Unusual Patterns** > > * **Outliers**: Large spend spikes or anomalies could indicate data errors or untracked events. > * **Holiday Effects**: Seasonal promotions or campaign overlaps may require additional control variables for clarity. *** ## What makes Dema's MMM different? ### 1. Multiple optimization targets Choose from four different objectives (Gross sales, NGP2, NGP3, New customer NGP2 + LTV) to align recommendations with your business strategy. ### 2. Experiment-calibrated Incrementality experiment results are integrated directly into the model, providing ground-truth calibration that improves accuracy. ### 3. Daily insights Dema's MMM is refit **every day**, delivering fresh insights for each market and funnel group. Every model is quality-monitored daily and gets an extended diagnostic each week. This granularity makes it easier to course-correct and respond to shifting market conditions in near-real time. ### 4. Real-world constraints * **Guardrails**: By default, Dema caps **weekly spend adjustments** at ±30% to avoid disrupting ad algorithms (e.g., Meta, Google). * **Channel-specific limits**: You can configure spend limits or minimum budgets at a channel level, ensuring alignment with your strategic goals. * **Budget constraints**: Set minimum return targets to ensure profitability thresholds are met. *** ## Key outputs from MMM ### Optimal spend per channel Based on the model's saturation curves, you'll see recommended spend levels that maximize profit (rather than just revenue). This includes respecting the guardrail limits by default. ![Saturation curve showing optimal spend point](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-saturation-curves-hover.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=44d816b201b00a70493abf08ba8eaedc) ### Channel contribution Dema quantifies each channel's contribution to performance, breaking down: * **Marketing contribution**: Direct impact from paid channels * **Baseline contribution**: Organic and brand-driven performance * **Seasonal contribution**: Time-based patterns (holidays, seasonality) * **Control contribution**: Impact from custom events and variables ![Channel contribution over time](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-channel-contribution.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=070e88d6a962cc7a469c322c2511c20e) ### Profit potential The model calculates potential profit gains—showing you the value of reallocating spend. By highlighting **missed profit**, Dema helps quantify what's at stake if budgets aren't optimized. ![Actual vs potential profit comparison](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-missed-potential.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=d7ff473212ae3223e2cecc0eb6d44ae3) ### Return metrics The model calculates return metrics based on your selected optimization target, showing both the absolute return and the marginal return (incremental value of additional spend). *** ## Implementation tips Adjusting real-world budgets to match Dema's recommended spend can be both an art and a science. Here are some best practices: 1. **Gradual budget changes** * By default, Dema suggests a ±30% maximum weekly adjustment, but if that still feels too aggressive, consider smaller increments (e.g., ±10–15%) and monitor performance metrics closely. * Use the **guardrails settings** to customize limits per channel. 2. **Syncing with ad platforms** * **Google Ads**: Align Dema's recommended ROAS target with your campaign settings (e.g., Target ROAS bidding). For daily budgets, break down the weekly recommendation accordingly. * **Meta**: If optimizing by CPA or conversion goals, adjust bids or budget caps gradually to avoid shocks to the algorithm. 3. **Track early signals** * Keep an eye on early KPIs (e.g., CPC, CTR) after making changes. If you spot unusual spikes or dips, consult Dema's model to verify whether the shift matches your new budget strategy. 4. **Ongoing monitoring** * Dema's daily MMM updates make it easy to course-correct quickly. Regularly review performance and consider adjusting constraints if a channel consistently overshoots or undershoots profit targets. 5. **Run incrementality tests** * For channels with "Run test" certainty indicators, consider running an incrementality experiment to gather calibration data and improve model confidence. *** ## Handling channels with very small spend For channels that receive minimal spend and show little measurable impact: 1. **Funnel consolidation** * Group multiple small channels with similar objectives into a single funnel to increase data volume and improve model accuracy. 2. **Minimum spend constraints** * Force a small but consistent spend (e.g., 5–10% of the budget) so that the model can detect any incremental profit impact over time. 3. **Incremental testing** * Run an incrementality experiment to measure true incrementality before scaling spend. > [!TIP] > > Have questions about funnels, control variables, or constraints? Dema's MMM specialists can help you tailor the model to your unique business needs. # Model settings Source: https://docs.dema.ai/guides/mmm/model-settings Learn how to configure MMM optimization targets, budget constraints, and guardrails to align recommendations with your business strategy. The **Model settings** panel allows you to configure how Dema's MMM optimizes your marketing spend. Access it by clicking the "Model settings" tab in the right sidebar when viewing any MMM configuration. ![Model settings panel](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-model-settings.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=77991815c1d8cb08e81d39b382ddc7a5) *** ## Optimization target The optimization target determines what metric the model optimizes for when calculating recommended spend allocations. ![Optimization target selection](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-model-settings-objective.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=abab578d50de45cd90e2daa954345679) ### Available targets | Target | Description | Best for | | - | - | - | | **Gross sales** | Total revenue without cost deductions | Revenue-focused strategies, market share growth | | **Net gross profit 2** | Gross sales minus returns, COGS, and fulfillment costs | Balanced profitability optimization | | **New customer NGP2 + LTV** | New customer value plus lifetime value | Customer acquisition strategies | | **Net gross profit 3** | NGP2 minus marketing spend | Maximum profitability focus | > [!TIP] > > Start with **Net gross profit 2** or **Net gross profit 3** if you want to optimize for profitability. Use **Gross sales** when you're focused on growth or market share, even at reduced margins. ### How to change the target 1. Open the **Model settings** tab in the right sidebar 2. Under **Optimization target**, select your desired metric 3. The entire view will update to show recommendations optimized for that target *** ## Budget constraints Budget constraints set overall limits on the optimization recommendations. ![Budget constraints settings](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-model-settings-budget-constraints.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=54165d9dfd14bbd3699e7a67c0a2a2ee) ### Marketing spend limits | Setting | Description | | - | - | | **Marketing spend min** | Minimum percentage of actual spend (e.g., 90% means spend won't decrease by more than 10%) | | **Marketing spend max** | Maximum percentage of actual spend (e.g., 120% means spend won't increase by more than 20%) | ### Performance constraints | Setting | Description | | - | - | | **Min ROAS** | Minimum return on ad spend threshold (as percentage) | | **Min epROAS** | Minimum effective profit ROAS threshold (as percentage) | > [!NOTE] > > Setting aggressive return constraints may limit the optimizer's ability to find optimal allocations. Start with moderate thresholds and adjust based on results. *** ## Channel settings (Guardrails) Guardrails control how much the model can recommend changing spend on each channel. This prevents recommendations that are too aggressive and could disrupt ad platform algorithms. ![Channel settings with global and channel-specific guardrails](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-model-settings-channel-settings.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=c572e69695cab4d5ed58d21922b81089) ### Global guardrails Global guardrails apply to all channels by default: | Setting | Description | Default | | - | - | - | | **Max spend decrease** | Maximum percentage the model can recommend decreasing spend | -30% | | **Max spend increase** | Maximum percentage the model can recommend increasing spend | +30% | > [!TIP] > > The ±30% default is designed to prevent shocking ad platform algorithms. Meta and Google recommend gradual budget changes to maintain campaign stability. ### Channel-specific guardrails You can override the global guardrails for specific channels that need different treatment: 1. Click the **+** button next to "Channel specific spend range" 2. Select the channel you want to customize 3. Set custom **Max spend decrease** and **Max spend increase** values #### When to use channel-specific guardrails * **Lock a channel**: Set both decrease and increase to 0% to keep spend unchanged * **Allow more flexibility**: Increase the range for channels where you're comfortable with larger swings * **Protect brand campaigns**: Set conservative limits for brand search to maintain visibility * **Enable scaling**: Allow higher increases for high-performing channels you want to scale ### Example configurations | Scenario | Setting | Value | | - | - | - | | **Conservative** | Global | -15% to +15% | | **Aggressive scaling** | Global | -30% to +30% | | | Facebook Sale | -10% to +40% | | | Google Brand | 0% to 0% | | **Testing new channel** | TikTok Sale | -40% to +40% | *** ## How constraints affect recommendations The optimizer works within your defined constraints to find the best allocation: 1. **Respects all guardrails**: No channel will have recommendations outside its allowed range 2. **Optimizes within bounds**: The model finds the best allocation possible given the constraints 3. **Reports missed potential**: If constraints prevent reaching optimal allocation, you'll see the potential profit gap > [!NOTE] > > Very tight constraints may prevent the model from finding significant optimizations. If you see large "missed potential" values, consider relaxing some guardrails. *** ## Saving your configuration Model settings are saved as part of your **MMM configuration**: ![Save as copy button](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-save-configuration.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=0e5ab499797a6ff43d22176047699298) 1. Make your desired changes to optimization target, constraints, and guardrails 2. Click the **Save** button to update the current configuration, or **Save as copy** to create a new configuration 3. Your settings will be preserved for future sessions You can create multiple MMM configurations with different settings to compare different optimization strategies. *** ## Best practices 1. **Start conservative**: Begin with the default ±30% guardrails and tighten only if needed 2. **Match business constraints**: Set return thresholds that reflect your actual profitability requirements 3. **Review certainty indicators**: Channels with "Medium" or "Run test" certainty may need tighter guardrails until more data is available 4. **Iterate gradually**: Make small adjustments to constraints and observe how recommendations change 5. **Use channel-specific limits strategically**: Lock channels only when you have specific business reasons (e.g., contractual minimums, brand protection) # Overview view Source: https://docs.dema.ai/guides/mmm/overview Learn how to use Dema's MMM Overview to quickly assess optimization opportunities across markets and channels. The **Overview** view provides a high-level summary of your marketing optimization opportunities. It shows key metrics, identifies the biggest opportunities, and displays a spend matrix to help you understand where budget reallocation can improve profitability. Access the Overview by selecting an MMM configuration from the sidebar and ensuring the **Overview** tab is selected. ![MMM Overview showing opportunities and spend matrix](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-overview.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=40a902f2b6e3deb5340e3ed496646c15) *** ## Metric cards At the top of the Overview, you'll see key performance metrics comparing **optimized vs. actual** performance: ![Metric cards showing optimized vs actual performance](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-overview-metrics.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=0ea4013a1b531e0f68fe4137134756db) | Metric | Description | | - | - | | **Marketing spend** | Total actual spend vs. recommended optimal spend | | **ROAS** | Actual return on ad spend vs. what optimal allocation would achieve | | **epROAS** | Effective profit ROAS comparison (based on your selected optimization target) | Each metric shows: * The **optimized value** (what following recommendations would achieve) * A **percentage change** compared to actual performance (green = improvement, red = decline) * The **actual value** for reference > [!TIP] > > A positive change in return metrics indicates potential profit improvement from reallocating spend according to model recommendations. *** ## Opportunities section The Opportunities section identifies where the biggest optimization potential exists, organized by either **Market** or **Channel**. ![Opportunities table showing markets and potential](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-overview-oppurtunities.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=10accc51fd2ff9d8286bfa94a96e0203) ### Market view Shows optimization potential by geographic region: | Column | Description | | - | - | | **Market** | Geographic region name | | **Potential** | High/Medium/Low indicator with confidence ring | | **Potential \[Target]** | Estimated additional profit in your selected target metric | | **Top opportunities** | The single biggest recommendation for that market | | **Open** | Link to drill down into that market's details | ### Channel view Shows optimization potential by marketing channel: | Column | Description | | - | - | | **Channel** | Marketing channel name with platform icon | | **Potential** | High/Medium/Low indicator with confidence ring | | **Potential \[Target]** | Estimated additional profit in your selected target metric | | **Top opportunities** | The single biggest recommendation for that channel | | **Open** | Link to drill down into that channel's details | ### Understanding potential indicators The **Potential** badge shows the confidence level of the optimization opportunity: | Badge | Meaning | | - | - | | **High** (full ring) | Strong signal with high confidence—significant untapped potential | | **Medium** (partial ring) | Moderate signal—opportunity exists but with some uncertainty | | **Low** (minimal ring) | Weak signal—limited optimization potential detected | ### Top opportunities The **Top opportunities** column shows the single most impactful action for each market or channel: * **Increase on \[Channel]**: Model recommends increasing spend on this channel * **Decrease on \[Channel]**: Model recommends decreasing spend on this channel The amount shown represents the recommended spend change to capture the potential profit. > [!TIP] > > Click **Open** next to any market or channel to dive into the Details view for a full breakdown of recommendations. *** ## Spend overview matrix The Spend overview section displays a heatmap showing recommended spend changes across all markets and channels. ![Spend matrix heatmap](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-overview-spend-matrix.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=9fed66aa99d380aba26b6cba862b1ab9) ### Reading the matrix * **Rows**: Markets (geographic regions) * **Columns**: Channels (marketing platforms/funnels) * **Cells**: Recommended spend change ### Color coding | Color | Meaning | | - | - | | **Green** | Increase spend (positive change) | | **Red** | Decrease spend (negative change) | | **White/Gray** | No significant change recommended | The intensity of the color indicates the magnitude of the recommended change—darker colors mean larger changes. ### Absolute vs. Relative toggle Use the toggle in the section header to switch between: | Mode | Display | | - | - | | **Absolute** | Shows actual currency amounts (e.g., +€3,000, -€1,500) | | **Relative** | Shows percentage changes (e.g., +15%, -8%) | ### Interpreting the matrix 1. **Green columns**: Channels that should receive more budget across most markets 2. **Red columns**: Channels that are overspending across most markets 3. **Mixed rows**: Markets where channel mix needs rebalancing 4. **Large values**: Priority areas for attention > [!NOTE] > > The spend matrix respects your configured guardrails. Recommendations won't exceed the maximum spend increase/decrease limits you've set. *** ## Using the Overview effectively ### Quick assessment workflow 1. **Check metric cards**: See if there's significant optimization potential (large positive % changes) 2. **Review opportunities**: Identify which markets or channels have the highest potential 3. **Scan the matrix**: Get a visual sense of where money should flow 4. **Drill down**: Click into specific markets or channels for detailed recommendations ### When to use Overview vs. Details | Use Overview when... | Use Details when... | | - | - | | Starting your weekly review | Implementing specific recommendations | | Comparing optimization potential across regions | Understanding why a channel needs more/less spend | | Getting a quick health check | Analyzing saturation curves and adstock effects | | Reporting to stakeholders | Setting up budget changes in ad platforms | *** ## Filtering the Overview Use the **View** panel on the right to customize what's shown: 1. **Markets**: Select which markets to include in the analysis 2. **Channels**: Select which channels to include 3. **Metrics**: Choose which metrics to display in cards The Opportunities section and Spend matrix will update to reflect your filter selections. > [!TIP] > > Create filtered views for specific regions or channel groups to focus your analysis. For example, filter to only Meta channels to assess your social media optimization opportunities. *** ## Date range selection Use the date picker in the header to change the analysis period: * **Historical periods** (Last week, Last 2/4 weeks): Shows what optimal allocation would have achieved compared to actual spend * **Future periods** (Next week, Next 4 weeks): Shows recommended allocation for upcoming periods based on forecasted conditions > [!NOTE] > > Future period recommendations incorporate predicted seasonality and trends, making them ideal for planning upcoming budget changes. # View settings Source: https://docs.dema.ai/guides/mmm/view-settings Learn how to filter, aggregate, and customize the MMM view to focus on the markets, channels, and metrics that matter most. The **View** panel allows you to customize what data is displayed in the MMM interface. Access it by clicking the "View" tab in the right sidebar. ![View settings panel showing aggregation, markets, channels, and metrics filters](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-view-settings.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=994816114643d4c94089ca1b38df52df) *** ## Aggregation The aggregation setting controls how data is grouped in tables and charts. This is a powerful pivot feature that lets you analyze your data from different perspectives. ![Aggregation dropdown showing Channel, Market, and None options](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-details-aggregation.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=21249eb76d18f8daaa955c563bcbba65) | Mode | Description | Use case | | - | - | - | | **Channel** | Data is aggregated by marketing channel across all markets | Compare channel performance across your entire business | | **Market** | Data is aggregated by geographic market across all channels | Identify which regions have the most optimization potential | | **None** | Data is shown at the channel × market level (most granular) | Deep-dive analysis into specific channel-market combinations | ### How aggregation affects the view When you change the aggregation setting: * **Tables**: Rows will group by your selected dimension (channel or market) * **Charts**: Visualizations will show data aggregated accordingly * **Metrics**: Values are summed or averaged based on the aggregation level > [!TIP] > > Use **Channel** aggregation to compare channel performance across your entire business. Switch to **Market** aggregation to identify which geographic regions have the most optimization potential. Use **None** for the most detailed analysis when you need to see specific channel-market combinations. *** ## Markets filter The markets filter lets you focus on specific geographic regions. ![Markets filter showing available regions](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-view-settings-markets.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=e4877d8185da9d693dd9a92d97e0a335) ### How to use 1. Open the **View** tab in the right sidebar 2. Find the **Markets** section 3. Check or uncheck markets to include/exclude them from the view 4. Click **Select all** to show all markets ### Available markets Markets are defined during your MMM onboarding and typically include: * Geographic regions (e.g., DACH, NORDICS, NA, UK & BENELUX) * Country-level breakdowns (e.g., US, UK, DE, SE) > [!NOTE] > > When you filter markets, all metrics, charts, and recommendations update to show only the selected markets. *** ## Channels filter The channels filter lets you focus on specific marketing channels or funnels. ![Channels filter showing available channels](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-view-settings-channels.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=f32a877daec5536d16485fdd3d51b032) ### How to use 1. Open the **View** tab in the right sidebar 2. Find the **Channels** section 3. Check or uncheck channels to include/exclude them from the view 4. Click **Select all** to show all channels *** ## Metrics filter The metrics filter controls which metrics are visible in tables and charts. ![Metrics filter showing available metrics](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-view-settings-metrics.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=37058ae19b0f2c8e5e0d4cf592d03640) ### Available metrics | Metric | Description | | - | - | | **Marketing spend** | Total marketing spend amount | | **New customer NGP2 + LTV** | New customer value with lifetime value | | **Net gross profit 3** | NGP2 minus marketing spend | | **Net gross profit 2** | Gross sales minus returns, COGS, and fulfillment costs | | **Gross sales** | Total revenue | | **ROAS** | Return on ad spend | | **epROAS** | Effective profit ROAS | ### How to use 1. Open the **View** tab in the right sidebar 2. Find the **Metrics** section 3. Check or uncheck metrics to show/hide them 4. Click **Select all** to show all metrics *** ## Date range selection The date range picker in the header controls the time period for analysis. ![Date picker showing available date range options](https://mintcdn.com/demaai/ENXyWUiEGS6ed4SA/images/mmm-date-picker.png?fit=max\&auto=format\&n=ENXyWUiEGS6ed4SA\&q=85\&s=268ae33b8b15e11d77cb57abc9429511) MMM operates on **aggregated weekly data**, with weeks starting on Monday. You can select complete previous weeks for historical reporting, or future weeks to plan upcoming budget allocations. For **historical analysis**, select past weeks to see what optimal allocation would have achieved compared to your actual spend. This helps you understand missed potential and validate model accuracy. For **future planning**, select upcoming weeks to get forecasted recommendations based on predicted seasonality and trends. You can also select a custom date range if you need a specific period—just ensure you're selecting complete weeks for accurate analysis. *** ## Saving view preferences View settings are saved as part of your **MMM configuration**. Adjust filters and aggregation to your preferred view, then click **Save** in the header. Your view preferences will be restored when you return. # Access and sharing Source: https://docs.dema.ai/guides/organization/access-and-sharing Learn how visibility and sharing work for agents, routines, skills, apps, and other resources in Dema. Agents, routines, skills, apps, dashboards, reports, and sessions start out private. You decide when to share them and with whom. *** ## How access works in Dema Access depends on roles, teams, and the visibility of each resource: | Layer | What it controls | Where to manage it | | - | - | - | | **Role** | Organization-wide capabilities (Admin, Member, Guest) | [Manage users](/guides/organization/manage-users) | | **Teams** | Which metrics, dimensions, and reports a group can see | [Creating and managing teams](/guides/organization/team) | | **Sharing** | Who can see and use a specific agent, routine, skill, app, or session | This page | Roles and teams set organization-wide access. Visibility controls access to a specific resource. *** ## Visibility levels Each agent, routine, skill, app, dashboard, and report has a **visibility** setting: | Visibility | Who can see and use it | | - | - | | **Private** | Only you | | **Teams** | You and everyone on the selected team(s) | | **Everyone** | Everyone in your organization | Sessions are either **Private** or **Shared** with your organization. A session also follows the visibility of its agent. See [Sharing agents and sessions](/guides/agent/access-and-sharing) for details. The person who creates a resource owns it. Sharing changes who can use the resource, not who owns it. For agents, skills, and apps, only the owner can change its visibility, rename it, or delete it. Only a routine's owner can change its visibility or delete it. *** ## What happens when you share Before you share a resource, Dema shows who will gain access. It also lists any linked resources that the new audience will be able to use. *** ## What happens when you make something private Before you make a resource private or limit it to fewer teams, Dema shows who will lose access. If another resource provides indirect access, Dema may remove that link when you confirm. You keep access as the owner. > [!WARNING] > > Making a resource more private can also remove indirect access through a resource shared with a wider audience. Review the summary before you confirm. *** ## Agents and sessions See [Sharing agents and sessions](/guides/agent/access-and-sharing) to learn how a shared agent provides access to its skills, apps, integrations, and sessions. *** > [!TIP] > > Share with the smallest audience that needs access. Use **teams** when only part of your organization needs a resource, and review the access summary before you confirm a change. # Using labels to organize reports Source: https://docs.dema.ai/guides/organization/labels Learn how to set up and use labels in Dema to organize, find, and filter reports with ease. ## What are labels? Labels in Dema provide an additional layer of organization for your reports. They allow you to: * Quickly find and filter reports by specific labels. * Add context or categorize reports beyond teams. * Simplify navigation when managing a large number of reports. *** ## Setting up labels To create a new label for your organization: 1. Navigate to **Settings → Labels**. 2. Click **Add Label**. 3. Enter a name for your label and select a color to represent it. > [!NOTE] > > **Tip**: Use meaningful label names to categorize reports by purpose, time frame, or audience (e.g., "Monday Morning Meeting"). *** ## Adding labels to reports You can add labels to reports directly from the report view: 1. Open the report you want to label. 2. In the right-hand panel, click **Add Label**. 3. Select an existing label or create a new one. *** ## Filtering reports by label To filter reports using labels: 1. Navigate to the **Reports** list. 2. Click **Filters** in the top-right corner of the report list view. 3. Select the label(s) you want to filter by. This allows you to quickly narrow down reports, making it easier to find those relevant to specific topics or purposes. *** ## Labels and teams While teams organize reports based on users and data access, labels provide an additional layer of categorization. For example: * A report shared with everyone in your organization can be labeled **"Monday Morning Meeting"** to highlight its purpose. * Combine labels with team filters to create a robust system for finding reports. *** > [!NOTE] > > **Best practice**: Use labels to group reports by themes, meetings, or time-sensitive tasks, while teams control who can access those reports. Together, they create an efficient way to manage your organization’s reporting. # Manage users Source: https://docs.dema.ai/guides/organization/manage-users Learn how to invite manage members to Dema, assign roles, and manage access levels for seamless collaboration across your organization. ## Invitation process ### How to invite team members [Manual input cost](https://demo.arcade.software/4flqbwwqm53WdiNlm8jM?embed\&embed_mobile=inline\&embed_desktop=inline\&show_copy_link=true) 1. Navigate to **Settings → Members**. 2. Click **Invite Member**. 3. Enter one or more email addresses. You can paste a list or press Enter after each email, up to 30 at a time. 4. Select a role (Admin, Member, or Guest). Everyone you invite in the same batch gets the same role, storefronts, and teams. 5. Optionally, select one or more **Teams**. Invitees join those teams when they accept the invitation. 6. Send the invitations. Each invited member receives an email with instructions to set up their account and password. > [!NOTE] > > **Google SSO Considerations**:\ > Invited users must create their account with an email and password during the invitation process. Once their account is created, they can use Google SSO for subsequent logins. ### Required details for invitations When inviting new members, only an email address is required. You can assign the role and teams during the invitation or update them later. ### Resending and revoking invitations Pending invitations appear under **Settings → Members**. Admins can resend or revoke a pending invitation from there. Resending replaces the invitation with a new one that has the same role, storefronts, and teams, so the link in the previous email stops working. *** ## Roles and permissions Assign permissions tailored to your needs by giving users one of the following roles: * **Admin**: Full control over the organization, including access to all settings, integrations, and user management. * **Member**: Access to all features with some restrictions, such as editing organizational settings (e.g., cost, integration, and mappings) or managing members. * **Guest**: Limited access to specific teams, reports, and datasets. Ideal for third parties or agencies requiring restricted data access. > [!NOTE] > > For more details on team-level restrictions, refer to the [Teams documentation](/guides/organization/team). ### Can roles be customized? Roles can be adjusted for each user under **Settings → Members**. Use the dropdown menu next to each member’s name to assign a new role. *** ## User management features ### Resetting passwords Users can reset their password by clicking **Forgot Password** on the login page or by visiting [Reset Password](https://app.dema.ai/auth/forgot-password). ### Managing user accounts Admins can manage user roles, deactivate accounts, or remove users under **Settings → Members**. ### Multiple Admins There’s no limit to the number of Admins an organization can have. Assign Admin rights to multiple members for collaborative management. *** ## Additional features ### Customizing profiles Users can customize their profiles by navigating to **Settings → Profile**, where they can: * Update their name. * Set or change their profile picture. * Change their email address. *** > [!NOTE] > > **Best Practices for Team Management**: > > * Regularly review user roles to ensure appropriate access levels. > > * Limit Admin roles to those responsible for organizational and integration settings. > > * Use Guest roles for external collaborators or agencies requiring limited access. # Directory Sync with Microsoft Entra ID Source: https://docs.dema.ai/guides/organization/microsoft-directory-sync Learn how to provision and manage Dema users automatically from Microsoft Entra ID using SCIM. Microsoft Entra ID Directory Sync uses the System for Cross-domain Identity Management (SCIM) standard to keep your Dema users aligned with your organization directory. Directory Sync complements [Microsoft Single Sign-On (SSO)](/guides/organization/microsoft-sso): SSO authenticates users when they sign in, while Directory Sync creates, updates, deactivates, and reactivates their Dema accounts based on changes in Entra ID. *** ## Prerequisites Before configuring Directory Sync, make sure: * [Microsoft SSO](/guides/organization/microsoft-sso) is configured for your Dema organization. * You have at least the **Application Administrator** role in Microsoft Entra ID. * You can access the enterprise application used for Dema SSO. * You have selected a test user and decided which users or groups should have access to Dema. * You have received the **SCIM endpoint URL** and **secret token** from your Dema representative. > [!WARNING] > > Treat the secret token like a password. Store it securely, do not share it over unapproved channels, and never include it in screenshots or support messages. *** ## Configure automatic provisioning ### Step 1: Open the Dema enterprise application 1. Sign in to the [Microsoft Entra admin center](https://entra.microsoft.com/). 2. Go to **Entra ID → Enterprise applications**. 3. Select the enterprise application already used for Dema SSO. 4. Select **Provisioning**. ### Step 2: Connect Entra ID to Dema 1. Set **Provisioning Mode** to **Automatic**. 2. Under **Admin Credentials**, enter the values provided by Dema: * **Tenant URL** — enter the SCIM endpoint URL exactly as provided. * **Secret Token** — enter the SCIM secret token. 3. Select **Test Connection**. 4. After the connection succeeds, select **Save**. > [!NOTE] > > The SCIM endpoint and token are separate from the SAML values used for SSO. Do not enter the SSO Reply URL, Entity ID, or federation metadata URL here. ### Step 3: Verify user attribute mappings Open **Mappings → Provision Microsoft Entra ID Users** and confirm that the following SCIM attributes are mapped: | SCIM attribute | User information | | - | - | | `userName` | Primary sign-in identifier | | `name.givenName` | First name | | `name.familyName` | Last name | | `emails[type eq "work"].value` | Work email address | | `active` | Whether the user is enabled | > [!WARNING] > > Every provisioned user must have a work email mapped to `emails[type eq "work"].value`. Provisioning fails if the email is sent only as `userName`. ### Step 4: Set the provisioning scope 1. Under **Settings**, set **Scope** to **Sync only assigned users and groups**. 2. Review the users and groups already assigned to the enterprise application. 3. Assign the test user if they are not already assigned. 4. Keep automatic provisioning stopped until the test user has been verified. Only users assigned directly or through an assigned group are included in this scope. Review existing assignments carefully before starting provisioning, because they determine which accounts Entra ID manages in Dema. *** ## Test with one user Test the connection before enabling scheduled provisioning for everyone: 1. In the enterprise application, open **Provisioning**. 2. Select **Provision on demand**. 3. Search for and select the test user. 4. Select **Provision** and review the result for each provisioning step. 5. Ask your Dema representative to confirm that the user is active and that their name and email address are correct. 6. If needed, update the test user's name in Entra ID and provision them again to confirm that changes are synchronized. > [!TIP] > > Record the provisioning time and result. This information helps Dema investigate the request if the user does not appear as expected. *** ## Enable Directory Sync After the test succeeds: 1. Reconfirm the users and groups assigned to the enterprise application. 2. Return to the application's **Provisioning** page. 3. Start provisioning. 4. Monitor **Provisioning logs** while Entra ID completes the initial cycle. 5. Confirm in Dema that the expected users are active. The initial provisioning cycle can take longer than later updates. Use **Provision on demand** when you need to test a specific user immediately. After Directory Sync is enabled, manage synced names, email addresses, and account status in Entra ID. Changes made there are sent to Dema automatically. *** ## User lifecycle behavior | Change in Microsoft Entra ID | Result in Dema | | - | - | | Assign a new user | Creates and activates the user's Dema account. | | Update a user's mapped attributes | Updates the corresponding Dema account. | | Disable or unassign a user | Deactivates the Dema account and prevents the user from signing in. | | Re-enable or reassign a user | Reactivates the existing Dema account. | Directory Sync deactivates users instead of deleting them. This makes offboarding reversible and preserves the user's existing Dema account if they are assigned again later. *** ## Troubleshooting | Issue | What to check | | - | - | | **Test Connection fails** | Re-enter the endpoint URL and secret token exactly as provided. Make sure the endpoint does not contain an extra trailing slash. | | **A user is not provisioned** | Confirm that the user is enabled, assigned to the enterprise application, and included in the selected provisioning scope. Review the Entra provisioning result for skipped steps or errors. | | **Provisioning reports a missing email** | Confirm that the user's work email is mapped to `emails[type eq "work"].value`; `userName` alone is not sufficient. | | **A change has not appeared in Dema** | Confirm that provisioning is running and check **Provisioning logs**. Use **Provision on demand** to test the user immediately. | | **A user was deactivated unexpectedly** | Check whether the user was disabled, directly unassigned, or removed from an assigned group in Entra ID. | If the issue continues, contact your Dema representative with the affected user's email address, the provisioning timestamp, and the result shown in Entra ID. Do not include the secret token. For more information, see Microsoft's guides to [automatic SCIM provisioning](https://learn.microsoft.com/en-us/entra/identity/app-provisioning/use-scim-to-provision-users-and-groups) and [on-demand provisioning](https://learn.microsoft.com/en-us/entra/identity/app-provisioning/provision-on-demand). # Single Sign-On (SSO) with Microsoft Entra ID Source: https://docs.dema.ai/guides/organization/microsoft-sso Learn how to configure Microsoft Entra ID (formerly Azure AD) as a SAML-based SSO provider for your Dema organization. ## What is Microsoft SSO? Microsoft Single Sign-On allows users in your organization to log in to Dema using their existing Microsoft credentials. This is configured through a SAML connection with Microsoft Entra ID (formerly Azure Active Directory), enabling centralized access management and enhanced security. > [!TIP] > > To create, update, and deactivate Dema users automatically from Microsoft Entra ID, see [Directory Sync with Microsoft Entra ID](/guides/organization/microsoft-directory-sync). *** ## Prerequisites Before setting up Microsoft SSO, make sure: * You have **admin access** in Dema. * Someone from your IT department has access to your organization's **[Microsoft Azure portal](https://azure.microsoft.com/en-us/get-started/azure-portal)**. * You have identified the **email domains** that should require SSO login (e.g. `yourcompany.com`). *** ## How the setup works Configuring Microsoft SSO is a coordinated process between your IT team and Dema. Dema provides a set of SAML values that your IT team enters into Microsoft Entra ID. Once configured, your IT team shares back a metadata URL to complete the connection. ### Step 1: Receive SAML values from Dema Contact your Dema representative to initiate the SSO setup. Provide the **email domains** that should require SSO (e.g. `yourcompany.com`). Dema will respond with two values that your IT team needs for the Microsoft configuration: | Field | Description | | - | - | | **Reply URL (Assertion Consumer Service URL)** | The endpoint where Microsoft sends the SAML response after a user authenticates. | | **Identifier (Entity ID)** | A unique identifier that tells Microsoft which service provider the SAML connection is for. | > [!NOTE] > > Keep these values ready since they are needed in Step 4 below. ### Step 2: Create an enterprise application in Microsoft Your IT team performs the following steps in the Microsoft Azure portal: 1. Sign in to the **[Microsoft Azure portal](https://azure.microsoft.com/en-us/get-started/azure-portal)**. 2. Navigate to **Enterprise applications** (found under the Azure Services section, or under **All services → Identity**). 3. Select **New application**. 4. Select **Create your own application**. 5. Enter a name for the application (e.g. your company name or "Dema SSO"). 6. Choose **Integrate any other application you don't find in the gallery (Non-gallery)**. 7. Select **Create**. ### Step 3: Assign users or groups Before users can authenticate via SSO, they must be assigned to the enterprise application: 1. In the enterprise application's **Getting Started** section, select **Assign users and groups**. 2. Select **Add user/group**. 3. Search for and select the users or groups who should have access. 4. Select **Assign**. > [!TIP] > > You can assign individual users or entire groups. For detailed instructions on group assignment, refer to [Microsoft's documentation](https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/assign-user-or-group-access-portal?pivots=portal). ### Step 4: Configure SAML settings 1. In the application's sidebar, open **Manage** and select **Single sign-on**. 2. Choose **SAML** as the sign-on method. 3. In the **Basic SAML Configuration** section, select **Edit**. 4. Enter the values provided by Dema: * **Identifier (Entity ID)** — paste the Identifier value from Step 1. * **Reply URL (Assertion Consumer Service URL)** — paste the Reply URL value from Step 1. 5. Select **Save** and close the panel. ### Step 5: Verify attribute mappings On the same **Set up Single Sign-On with SAML** page, find the **Attributes & Claims** section and verify the following mappings are present: | Attribute | Claim name | Expected value | | - | - | - | | Email address (required) | `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress` | `user.mail` | | First name (optional) | `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname` | `user.givenname` | | Last name (optional) | `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname` | `user.surname` | > [!NOTE] > > These are the default attribute mappings and typically do not require changes. However, incorrect attribute mappings are a common source of SAML configuration errors, so it is worth verifying. ### Step 6: Share the metadata URL with Dema 1. On the **Set up Single Sign-On with SAML** page, find the **SAML Certificates** section. 2. Copy the **App Federation Metadata Url**. 3. Send this URL to your Dema representative. This is the final piece of information needed to complete the SSO connection on Dema's side. > [!WARNING] > > Both sides must complete their configuration for SSO to work. Users will not be able to log in via Microsoft until Dema has processed the metadata URL and enabled the connection. ### Step 7: Verify the connection After Dema confirms the connection is active: 1. A user with an SSO-enforced email domain navigates to the Dema login page. 2. They are automatically redirected to the Microsoft login screen. 3. After authenticating with Microsoft, they are returned to Dema and logged in. > [!TIP] > > We recommend testing with a single user before rolling out SSO to your entire organization. *** ## Frequently asked questions ### Can users still log in with email and password after SSO is enabled? Users whose email domain is included in the SSO domains list will be required to authenticate through Microsoft. Other users in your organization can continue using email and password. ### Do users need to be invited to Dema first? If your organization uses SSO without Directory Sync, users must be invited to Dema before they can log in. Admins can invite users from **Settings → Members → Invite Member**. With [Directory Sync](/guides/organization/microsoft-directory-sync), assigned users are provisioned automatically and do not need a separate Dema invitation. ### How long does the setup take? The technical configuration takes only a few minutes on each side. The main requirement is coordination between your IT team and Dema to exchange the configuration values. ### Can we use Microsoft SSO alongside Google SSO? Yes. Different users within the same organization can use different SSO providers depending on their email domain configuration. # Reset password Source: https://docs.dema.ai/guides/organization/reset-password Users can reset their password by clicking **Forgot Password** on the login page or by visiting [Reset Password](https://app.dema.ai/auth/forgot-password). # Single Sign-On (SSO) with Google Source: https://docs.dema.ai/guides/organization/sso Learn how to set up and use Google SSO for secure and streamlined access to Dema. ## What is Google SSO? Google Single Sign-On (SSO) allows users to securely log in to Dema using their Google account. It eliminates the need to remember additional passwords and simplifies user management across your organization. *** ## How does Google SSO work in Dema? ### Key features of Google SSO in Dema: * **Streamlined Access**: Users can log in using their Google account credentials instead of creating a new username and password. * **Enhanced Security**: Google SSO leverages Google’s robust authentication protocols to secure access. * **User Invitations**: Users must first be invited or created within Dema before being able to log in using Google SSO. > [!NOTE] > > **Tip**: For organizations with many users, Google SSO minimizes password-related support issues and simplifies account management. *** ## Setting up Google SSO ### For new users: 1. **Receive an invitation**: Admins invite users to join the organization via **Settings → Members → Invite Member**. 2. **Account creation**: During the invitation process, users must create their account using an email and password. 3. **Switch to Google SSO**: Once the account is set up, users can log in using their Google credentials. > [!WARNING] > > **Note**: Users cannot create accounts directly using Google SSO. They must first be invited to the organization and set up their initial credentials. > [!TIP] > > Looking for Microsoft SSO instead? See [Single Sign-On (SSO) with Microsoft Entra ID](/guides/organization/microsoft-sso). # Creating and managing teams Source: https://docs.dema.ai/guides/organization/team Learn how to set up and manage teams in Dema to streamline navigation, restrict data access, and simplify reporting. ## What are teams used for? Teams in Dema provide a flexible way to organize and manage access to reports, metrics, and dimensions within your organization. They serve three main purposes: 1. **Streamline navigation**: Quickly find and share reports with your team. 2. **Simplify data visibility**: Teams can show or hide relevant metrics and dimensions for easier analysis. 3. **Restrict guest user access**: Limit the scope of metrics and dimensions available to guest users. *** ## Creating a team Any user, except guest users, can create a team. Follow these steps: 1. Navigate to **Settings → Add Team**. 2. Enter a name for your team. 3. Choose an icon to represent your team. Once created, all members in your organization can join the team, and Admins can add other members to the team. ### Adding members to a team To add members to an existing team: 1. Navigate to **Settings → Teams**. 2. Click on the team name. 3. Select **Add Members** and choose the members you’d like to add. To add someone who isn't in your organization yet, click **Invite by email** in the team's members view. The invite dialog opens with the team already selected, and the invitee joins the team when they accept. Pending invites for the team are listed in the same view, where you can resend or revoke them. Resending replaces the invite, so the link in the previous email stops working. > [!NOTE] > > **Admins**: Admins can add or remove members at any time. Guest users can only join teams they are explicitly added to. *** ## Team data settings Teams can control which metrics and dimensions are visible for their members. This helps improve focus and restricts data visibility for guest users. ### Setting team data access 1. Go to **Settings → Teams** and select your team. 2. Click on the **Data** tab. 3. Choose which metrics and dimensions this team has access to. For example: * A team with access to **"Channel"** and **"Country"** as dimensions and **"Average Order Value"** and **"ROAS"** as metrics will only see these options in the report section. #### Data access for different roles * **Guest users**: * Only see the metrics and dimensions assigned to their team(s). * Cannot view or access any other data. * **Other members and Admins**: * Can still access all metrics and dimensions across the platform. * Teams act as "filters" for ease of navigation rather than strict limits. *** ## Sharing and managing reports with teams Dema allows you to control the visibility of reports by sharing them with specific teams. ### Sharing reports 1. In the **Reports** view, create or select a report. 2. Set the report visibility to: * **Private**: Only visible to you. * **Everyone**: Shared with all members in your organization. * **Specific teams**: Share with one or more teams. ### Accessing shared reports * Team members can view shared reports by selecting **All Reports** or clicking on the specific team name in the **Reports** view. * Guest users can only access reports shared with their team(s). > [!NOTE] > > Teams also scope sharing for agents, skills, and apps. See [Access and sharing](/guides/organization/access-and-sharing) for how visibility works across those resources. *** ## Benefits of teams * **Simplify data access**: Focus only on metrics and dimensions relevant to your team. * **Enhanced collaboration**: Share reports seamlessly with relevant teams. * **Control guest access**: Restrict guest users to specific data while maintaining full visibility for other members. > [!NOTE] > > **Best practice**: Use teams to group users with shared goals or responsibilities, such as marketing, operations, or finance, to create a more focused and efficient workflow. # How filters work in reports Source: https://docs.dema.ai/guides/reports/filters Learn how to apply filters to your reports in Dema, refine your data, and focus on what matters most using dimension and metric filtering. ## Introduction to filters Filters in Dema allow you to refine your reports by narrowing down the data you see. Filters can be applied in two ways: 1. **Directly from the table.** 2. **Using the "Filters" menu at the top to filter out data not visible in the report.** Let’s go through both methods in detail. *** ## Applying filters directly from the table ### Filtering dimensions [Manual input cost](https://demo.arcade.software/F5oYz2yMlVTf1lt4vy1l?embed\&embed_mobile=inline\&embed_desktop=inline\&show_copy_link=true) To filter dimensions directly: 1. Hover over the column header of a dimension. 2. Click the downward arrow. 3. Select **Filter**. You can apply the following types of filters to dimensions: * **Is any of**:\ Select specific values from the dimension list that you want to include. Only rows with these selected values will be displayed. * **Is none of**:\ Select specific values that you want to exclude. Rows with these values will not be displayed. * **Contains**:\ Enter a keyword or phrase. Rows containing this keyword (case-insensitive) will be included.\ *Example:* Filtering for "paid" would return rows like "not\_paid" and "PAID." * **Does not contain**:\ The inverse of "Contains." Rows with the specified keyword will be excluded. ### Filtering metrics To filter metrics directly: 1. Hover over the column header of a metric. 2. Click the downward arrow. 3. Select **Filter**. The following types of filters are available for metrics: * **Is greater than**:\ Displays rows where the metric value is greater than the specified number. * **Is less than**:\ Displays rows where the metric value is less than the specified number. * **Is between**:\ Enter two numbers to filter rows where the metric value falls between these values. * **Is top %**:\ Displays the top percentage of rows based on the metric value.\ *Example:* Entering "10" will show the top 10% of rows. * **Is bottom %**:\ Displays the bottom percentage of rows based on the metric value.\ *Example:* Entering "10" will show the bottom 10% of rows. > [!WARNING] > > **Note:** If you use multiple filters, and one of them is a **top %** or **bottom %** filter, these filters will always be applied **last** in the sequence. *** ## Filtering using the "Filters" menu [Manual input cost](https://demo.arcade.software/2CuHgfksYRquVbgZk5fK?embed\&embed_mobile=inline\&embed_desktop=inline\&show_copy_link=true) The **Filters** menu at the top allows you to filter values from dimensions that are not visible in your report. This is useful when you want to refine your data further without explicitly adding the dimension to your report. ### Example use case Suppose you are analyzing channel performance and want to exclude data for a specific category like "Shoes," but "Category" is not currently a dimension in your report. 1. Go to the top of the report and click **Filters**. 2. Select the dimension you want to filter (e.g., **Category**). 3. Apply the desired filter type (e.g., **Is none of** -> "Shoes"). *** ## Important compatibility rules ### Metric-dimension compatibility Filters can only be applied to dimensions and metrics that are compatible with each other. For example: * If you have a metric like **Current inventory**, you cannot use a dimension like **Landing page** since these are not compatible. * Similarly, if a dimension is incompatible with the metrics in your report, you cannot use it as a filter. This compatibility logic ensures that reports remain meaningful and accurate. *** ## Best practices for filtering 1. **Use table filters for granular refinement**:\ Apply filters directly from the table when you need precision over specific columns. 2. **Use the Filters menu for broader exclusions**:\ Use the top menu to refine data based on dimensions not visible in your report. 3. **Check compatibility**:\ Ensure the dimensions and metrics in your report support your intended filters. > [!NOTE] > > By mastering Dema's filtering capabilities, you can gain sharper insights and focus on the metrics and dimensions that matter most for your business. # Setting your attribution model Source: https://docs.dema.ai/guides/reports/select-attribution Learn how to customize and apply attribution models in Dema reports to better analyze and distribute your revenue data. ## What is an attribution model? Attribution models in Dema determine how revenue and performance metrics are attributed across campaigns, channels, or touchpoints. Selecting the right model helps you analyze the effectiveness of your marketing efforts based on your business objectives. > [!NOTE] > > An attribution model does not affect the raw data but only influences how revenue is attributed in your reports.\ > [Learn more about attribution models in Dema →](/guides/fundamentals/attribution) *** ## Setting your attribution model [Manual input cost](https://demo.arcade.software/J7G1B7WyOEXGpZ2u22Fu?embed\&embed_mobile=inline\&embed_desktop=inline\&show_copy_link=true) ### Selecting an attribution model 1. Open your report in Dema. 2. In the right-hand panel, click **See additional information** under the **Attribution** section. 3. Choose from one or multiple attribution models: * **Dema MTA** (Multi-Touch Attribution): Our proprietary model designed to give an accurate, data-driven distribution of revenue. * **Linear**: Distributes revenue equally across all touchpoints. * **Last click**: Attributes all revenue to the last touchpoint before conversion. * **Ad platform**: Uses the attribution logic provided by the ad platform (e.g., Meta or Google). * **Dema CFA** (Causal Factor Attribution): Adjusts MTA or ad platform values using causal multipliers from incrementality experiments and platform-wide benchmarks. [Learn more →](/guides/causal-factor-attribution/how-it-works) > [!WARNING] > > **Ad platform attribution** data is available the day after, as it relies on data fetched directly from the platforms. *** ### Customizing your metrics with attribution models You can apply attribution models to specific metrics: 1. Click on the **Metric** dropdown in the report view. 2. Use the checkboxes to select which metrics you want to see for each attribution model. 3. Selected attribution models will create separate columns for the metric, clearly labeled with the model name. If you select "Gross sales" for all five models, your table will include separate columns for: * Gross sales (Dema MTA) * Gross sales (Linear) * Gross sales (Last click) * Gross sales (Ad platform) * Gross sales (Dema CFA) > [!NOTE] > > If no attribution model is selected, **Dema MTA** is used by default. *** ## Limitations and considerations * **Metric availability**: Not all metrics are compatible with all attribution models. For example, New customer % relies on order data captured via Dema’s tracking and e-commerce integrations and is therefore not available to combine with Ad platform attribution. * **Data delays**: The **Ad platform** attribution model reflects data fetched from the platforms and may not show same-day results. * **Analysis precision**: Using multiple attribution models for the same metric can provide valuable insights into how different models interpret your data. *** ## Best practices * Use **Dema MTA** for a balanced, data-driven view of revenue distribution. * Select multiple models to compare performance across attribution methods. * Leverage **Ad platform** attribution to align your reports with platform-reported metrics. * Regularly review attribution settings to ensure consistency with your business objectives. > [!NOTE] > > To better understand how attribution models influence your reports, experiment with different models for key metrics like Gross sales, ROAS, and Marketing spend. # Create product sets Source: https://docs.dema.ai/guides/segmentation/create-product-sets Learn how to create product sets in Dema to segment your catalog and export custom labels for Google and Meta feeds. ## Why segmentations matter Segmenting your products lets you **slice and dice** performance data by profitability, inventory levels, or other meaningful dimensions. By building product sets, you can quickly identify opportunities—for example, which products have low impressions, which are high-margin, or which are slow movers—and leverage that information across **Google** and **Meta** feeds. *** ## How it works Dema’s **Segmentations** feature allows you to group products into sets based on **rules**. These rules can reference key metrics (e.g., impressions, gross sales, net gross margin) or dimensions (e.g., category, channel). Once your product sets are defined, you can: 1. **Export** a CSV mapping each relevant product to its **custom label** (e.g., “High margin,” “Low impressions”). 2. **Use** these labels in your Google or Meta feeds for more targeted campaigns or bidding strategies. *** ## Creating a product set [Manual input cost](https://demo.arcade.software/00djn6aebl17DPE3Ngwr?embed\&embed_mobile=inline\&embed_desktop=inline\&show_copy_link=true) 1. **Go to “Segmentations.”** * In the Dema platform, look for the **Segmentations** section to manage product-level groupings. 2. **Click “New product set.”** * Give your product set a **name** (e.g., “Slow movers” or “High margin products”) to easily recognize it. * Pick a **custom label**—this label will appear in your output CSV and can be mapped to a **custom\_label\_x** field in Google or Meta. 3. **Save.** * After entering a name and custom label, click **“Save.”** * You can always come back and edit these details later. *** ## Adding rules to your product set Once your product set is created, **click its name** to configure **rules** that define which products belong in it. 1. **Click “Add rule.”** * Provide a **description** for the rule (e.g., “Products without impressions”). * Configure **filters** to identify which products match your criteria. * Remember that the **timeframe** in the top-right corner (e.g., last 28 days) controls the data window for all metrics. 2. **Choose filters.** * You can filter on **metrics** (e.g., impressions, gross sales, net gross margin) or **dimensions** (e.g., category, channel). * For example, a rule might say: **Impressions** \< 500 AND **Channel** = “Google.” Any product meeting **all** filters in this rule qualifies for that label. 3. **Assign a label.** * In the rule configuration, set a **Label** (e.g., “Low impressions”). This label will be applied as the **custom label** in your exported feed whenever a product matches these filters. 4. **Optional: set an expiry date.** * If you want this rule to expire on a certain date—e.g., after a seasonal promotion—include an expiry date. After that date, the rule disappears. 5. **Rule order matters.** * If a product matches multiple rules, it inherits the label from the **first** matching rule in the list. * Reorder rules if you want different prioritization. 6. **Save.** * Each time you add or modify a rule, click **“Save.”** Dema then updates the product set accordingly. *** ## Viewing the results Once your rules are in place, you’ll see **charts** on the right side (or elsewhere in the interface) that show: * **% of products** in the set (by count) * **% of marketing spend** (feed-based ads) these products account for * **% of gross sales** they represent * **% of inventory value** they hold These metrics help you assess each segment’s importance to your overall business. For example, if 5% of products consume 20% of your marketing spend, that might warrant closer examination. *** ## Practical examples * **Rule 1: Low impressions** * Filters: **Impressions (Product ads) \< 500** AND **Channel = Google** * Label: “Low impressions” * Captures products with fewer than 500 impressions on Google in the last 28 days. * **Rule 2: Slow moving clothes** * Filters: * **Forecast sell-through (Rest of season) \< 50%** * **Category = CLOTHING** * **Gross sales \< 20,000** * Label: “Slow movers” * Targets items with low sell-through rates and modest sales. * **Rule 3: High margin** * Filter: **Net gross margin 2 > 50.00%** * Label: “High margin” * Ideal for identifying highly profitable products to promote further. *** ## Exporting your product sets to feeds After defining your product sets, you can **export** them as a CSV for use in Google or Meta: 1. **Find the export option.** * In the **Segmentations** view, locate the **three dots** (⋮) next to your product set and select **Copy link to CSV file.”** 2. **How the CSV is structured.** * The CSV contains **product IDs** at a higher “product” level, rather than size or variant level. * Dema also pulls in **all relevant feed-based ad IDs** to properly label items in Google or Meta. For instance, if product 1920 in Dema has size variants 1920-1, 1920-2 in Google, the CSV will list all those variant IDs under the same custom label. * **Important**: If a product hasn’t had **any** marketing spend in feed-based ads (i.e., it never appeared in Google or Meta), Dema doesn’t have a corresponding external ID. Consequently, that Google ID won’t appear in the exported file. 3. **Mapping IDs.** * Since Dema aggregates marketing data, it knows how product 1920 in your e-commerce platform relates to IDs 1920-1, 1920-2, etc. in Google, and possibly 1920 in Meta. * All these IDs get the same **custom label** in the export, meaning you can easily update your Google or Meta feeds to reflect the segmentation. 4. **Use in Google or Meta.** * In your advertising platforms, map the exported **custom label** column to **custom\_label\_x** or whichever attribute is appropriate. This allows you to create specialized campaigns or rules (e.g., increase bids on “High margin” items, limit spend on “Slow movers,” etc.). *** ## Tips and best practices 1. **Keep labels short and descriptive.** * “LowImpr” or “HighMargin” are easier to manage in ad platforms than lengthy names. 2. **Timeframe awareness.** * Rules use the data from the timeframe in the top-right corner (e.g., last 28 days). If you need a broader overview, adjust the date range. 3. **Mind the rule order.** * The first matching rule is applied, so prioritize rules carefully to avoid unintended overlaps. 4. **Monitor the charts.** * The segmentation charts help you see how each product set affects overall business metrics. 5. **Regularly refresh rules.** * Product statuses change over time (e.g., a slow mover could become high margin if costs drop). Revisit your rules periodically. 6. **Check product IDs.** * If a product has never had any feed-based ad spend, Dema can’t export an external ID for it. It won’t appear in the CSV. *** ## Next steps 1. **Create product sets** aligned with your goals—e.g., handling slow movers, capitalizing on high-margin items, or grouping low-impression products for improvement. 2. **Refine rules** and watch the segmentation charts to understand the impact on marketing spend, gross sales, and inventory value. 3. **Export** the CSV once you’re satisfied with your segment definitions. 4. **Update your feeds**: Upload the CSV to Google or Meta, mapping Dema’s custom labels to the correct attribute fields. 5. **Optimize campaigns** based on these new labels—target, bid, or pause segments strategically for higher profitability. By leveraging **Segmentations** in Dema, you gain deeper insight into product performance and can act on those insights by customizing your ads. This ensures your **ad budgets** and **product promotions** are continuously aligned with what’s most profitable and strategically important in your catalog. # Export to Klaviyo Source: https://docs.dema.ai/guides/segmentation/export-to-klaviyo Learn how to export your customer set labels to Klaviyo as custom properties for segmentation and campaigns. ## What does exporting segmentation labels to Klaviyo do? Exporting segmentation labels to Klaviyo lets you push Dema customer set labels directly into Klaviyo **custom properties**. Once enabled, customers in a set are updated in Klaviyo with a consistent format (e.g., `DEMA|My Set|VIP`), so you can use those properties when building segments and campaigns. *** ## Prerequisite Connect Klaviyo yourself from Dema: 1. In Klaviyo, create a **Private API Key** with **Full Access** scope for **Lists**, **Profiles**, and **Segments**. 2. In Dema, go to **Settings > Integrations**. 3. On the **Klaviyo** card, click **Connect**. 4. Paste the Private API Key into the **API Key** field and save. *** ## How to export segmentation labels to Klaviyo 1. Click the **•••** button on the right side of the customer set. 2. Click **"Manage export integrations."** 3. From the list, opt in for **Klaviyo**. 4. Click **"Apply"**. > [!NOTE] > > It may take up to 10 minutes for changes to appear in Klaviyo. If you do not see updates after that, contact us. *** ## How it works **Properties in Klaviyo are updated:** * Every morning * When the Klaviyo export is enabled for a customer set * Whenever the customer set is updated (clicking **"Save"** inside the set) * When the name of the customer set is changed **Properties in Klaviyo are removed:** * When the Klaviyo export is disabled for a customer set * When the customer set is deleted *** ## How custom properties look Custom properties in Klaviyo follow this format: Key: `dema_label`\ Value: `DEMA||