dbt Semantic Layer vs a Managed Semantic Layer for Ecommerce Metrics

David Lopes

TL;DR

  • Pick the dbt Semantic Layer if you already run dbt in production, have at least one analytics engineer, and need metrics that go beyond commerce (finance, operations, supply chain).
  • Pick a managed ecommerce semantic layer if you have no analytics engineer, want trusted Shopify, ads and email metrics in weeks rather than quarters, and want AI agents to query them on day one.
  • Run both if you have a data team and a commerce stack: let the managed layer own commerce metrics and let dbt own everything else.

Last updated: November 2026. Written by the Polar Analytics team. dbt facts come from dbt Labs' public docs and pricing page as of November 2026.

Ask three people at a $20M brand for last month's blended CAC and you can get three numbers. The ads lead divides Meta and Google spend by new customers in Shopify. Finance adds agency fees and influencer costs. The dashboard counts any customer without a previous order on that store as new, even if they bought on Amazon last year. Nobody is wrong. They are using three definitions.

A semantic layer fixes this by defining each metric once and serving that definition to every dashboard, spreadsheet and AI agent. The question for an ecommerce team is where that layer should live: in a dbt project your data team builds and maintains, or in a managed layer that ships with commerce definitions already written.

How a semantic layer works

A semantic layer sits between your data and every place that shows a number. Data comes in from Shopify, ad platforms and email tools, lands in a warehouse, and gets cleaned into data models (orders, customers, ad spend). The semantic layer reads those models and turns them into business terms: net sales, new customers, blended CAC, contribution margin.

How a semantic layer works: sources, warehouse, data models, semantic layer, and the tools that read it

Three ideas make it work:

  • Business-friendly names. People ask for "blended CAC by channel, last 30 days", not for a join between four tables. The layer translates the request into SQL.
  • Logic in one place. The formula for each metric lives in the layer, not in each dashboard. Change it once and every tool gets the new version.
  • One API, many endpoints. Dashboards, spreadsheets, AI agents and internal apps all call the same layer. This is the hub-and-spoke model: the layer is the hub, every tool is a spoke, and no spoke keeps its own copy of the logic.

Semantic layer, metrics layer, context layer: the terms

Vendors use these words loosely. Here is how they relate:

Metrics layer inside the semantic layer inside the context layer
  • Semantic model. The description of one dataset: its entities (order, customer), dimensions (date, channel, country) and measures (revenue, units). It is the building block.
  • Semantic layer. All the semantic models plus the metrics built on them and the joins between them, served to tools through an API.
  • Metrics layer or metrics store. The part that holds metric definitions only. In practice most products sold as a metrics layer today are semantic layers.
  • Headless BI. A semantic layer with no dashboards of its own. It only serves numbers to other tools.
  • Context layer. A newer term: the semantic layer plus what an AI agent needs to use it safely, such as metric descriptions, data freshness and usage notes.

In this article, "semantic layer" means the full layer: models, metrics, joins and the API that serves them.

What a semantic layer gets you

  • One number everywhere. Blended CAC in the Monday report, in the board deck and in an AI answer comes from the same formula. Meetings stop being about whose spreadsheet is right.
  • Fewer tickets for the data team. A merchandiser can pull LTV by first product purchased without asking an analyst to write SQL. Analysts spend time on analysis, not on rebuilding the same query.
  • Reuse. Contribution margin is defined once and reused in a P&L dashboard, a cohort report and a forecast, instead of being rebuilt three times with three small differences.
  • Governance. Access rules and change history sit on the definitions themselves, which matters once finance, an auditor or a parent company reads the numbers.
  • AI readiness. An AI agent that asks the layer for a metric by name gets the governed definition. Without it, the agent writes its own SQL and can answer the same question two different ways.

Common use cases of an ecommerce semantic layer

  • Reporting and BI. The weekly trading report, the channel P&L and the board deck all read from the same layer, so the numbers match across them.
  • Self-serve analysis. The retention lead slices repeat rate by acquisition channel and first product without waiting on the data team.
  • AI agents and LLMs. Claude or ChatGPT answers "why did CAC rise last week?" by querying governed metrics through an MCP server or an API instead of guessing at table names.
  • Embedded and operational use. The same definitions feed tools outside the BI stack: a margin target in a pricing sheet, an audience sent to an email tool, a KPI shown in an internal app.
  • Exploration. An analyst drills from a drop in net sales to the country, product and discount code behind it, with every step using the same definitions.

What the dbt Semantic Layer is

The dbt Semantic Layer lets a data team define metrics in YAML files inside their dbt project, on top of models they have already built. It is powered by MetricFlow, which reads those definitions and generates the SQL, joins included, each time someone asks for a metric by a dimension or a time grain.

What matters for a buying decision, as of November 2026:

  • Plans. Defining and querying metrics through the Semantic Layer APIs needs a dbt platform Starter, Enterprise or Enterprise+ account. Starter is listed at $100 per developer seat per month, with five seats and 5,000 queried metrics per month. Enterprise is custom priced, with 20,000 queried metrics per month and caching (dbt pricing).
  • Open source part. MetricFlow is released under the Apache 2.0 license (MetricFlow on GitHub). Teams on dbt Core can define metrics and query them locally from the command line, but they cannot use the APIs or the BI integrations (dbt Semantic Layer FAQs).
  • Warehouses. Snowflake, BigQuery, Databricks, Redshift, Postgres and Trino.
  • Consumption. BI tools and spreadsheets through dbt's APIs and integrations, and AI tools like Claude and ChatGPT through the dbt MCP server.

It is a strong engine for teams that already model their data in dbt. It does not model the data for you, and it does not know what a Shopify refund is.

What a managed ecommerce semantic layer is

A managed semantic layer comes with the pipeline, the warehouse, the data model and the metric definitions. You connect Shopify, your ad accounts and your email tool, and metrics like net sales, new customer revenue, blended ROAS, contribution margin and LTV already exist, defined the same way for every channel.

You still customize. The difference is that you start from hundreds of commerce definitions and change the few that are specific to your business, instead of starting from empty YAML files.

Four ways to define ecommerce metrics, compared

Most brands do not choose between two options. They choose between four, and many start with the first one without deciding anything.

MethodWhere the definition livesWho maintains itCommerce definitions includedAI agent accessMain cost
Metrics inside a BI toolEach dashboard or BI modelWhoever builds the dashboardNoThrough the BI tool's own AI, if anyBI licences, plus time spent reconciling numbers
dbt Semantic Layer (MetricFlow)YAML in your dbt projectAnalytics engineersNo, you write them on top of your own modelsdbt MCP server and APIs (paid dbt plans)dbt seats, warehouse compute, analytics engineering time
Universal semantic layer (for example Cube)Data models in the semantic layer toolData engineersNoAPIs and integrationsTool licence or hosting, warehouse, engineering time
Polar (managed ecommerce layer)Polar's semantic layer, on a dedicated Snowflake database per brandPolar ships the definitions, your team edits them without codeYes, 400+ ecommerce metricsPolar MCP, Ask Polar, Polar OperatorPolar subscription, priced on annual GMV

The first method is where metric chaos usually starts. The three others all solve it. What differs is who does the modeling work and what the layer knows about commerce.

The hard part: ecommerce metrics start before the YAML

Defining a metric in MetricFlow is short. Here is blended CAC in the classic MetricFlow spec, which dbt 1.12 still accepts (1.12 also adds a newer spec built on simple metrics, the idea is the same):

semantic_models:
- name: orders
model: ref('fct_orders')
defaults:
agg_time_dimension: order_date
entities:
- name: order_id
type: primary
dimensions:
- name: order_date
type: time
type_params:
time_granularity: day
measures:
- name: new_customers
agg: count_distinct
expr: case when is_first_order then customer_id end

metrics:
- name: new_customers
type: simple
type_params:
measure: new_customers
- name: blended_cac
label: Blended CAC
type: ratio
type_params:
numerator: total_ad_spend # simple metric from an ad spend model
denominator: new_customers

About thirty lines. The work is everything those lines assume already exists:

  • fct_orders has to be right. Shopify order data has edits, partial refunds, exchanges, cancelled orders, test orders and draft orders. Net sales only matches finance if each of those is handled the same way every day.
  • is_first_order has to mean something. First order on this store, on any of your stores, or across Shopify and Amazon? Each answer gives a different new customer count, so a different CAC.
  • Refund timing has to be decided. A refund booked in March for a February order lowers February or March net sales. Both are defensible. Mixing them is not.
  • total_ad_spend has to be complete. Meta, Google, TikTok, Pinterest and Amazon Ads each name campaigns, currencies and time zones differently. Someone has to land, clean and union all of them, and fix the pipeline when an API changes.
  • Currencies have to be converted at a rate everyone agrees on, if you sell in more than one market.
The upstream work a semantic layer metric depends on: ingestion, order cleanup, customer identity, refund timing, ad spend union, currency conversion

With dbt, your team writes and maintains all of this as models. With a managed layer, the vendor ships it and keeps it running when Shopify or Meta change their APIs. So the choice is about who owns that upstream work, not about writing YAML or clicking in a UI.

Governance and access control, compared

Consistent definitions are half the job. The other half is controlling who can see and change them. This matters most for brands with several stores, several brands or an outside agency in the account.

Capabilitydbt Semantic LayerPolar
Access controlProject and environment permissions in the dbt platform. Semantic Layer queries authenticate with service tokens or personal access tokens mapped to warehouse credentialsFour default roles (Admin, Analyst, Viewer, Connector) and custom roles with access set per dashboard, folder and report. Data exploration and Ask Polar are separate toggles
Row-level securityEnforced by the warehouse: the Semantic Layer respects the access policies tied to the credential it usesNo row-level rules. Roles limit dashboards, folders, reports, metrics and app features, and can hide customer details. To isolate one brand, use a separate workspace
Metric ownershipGroups with a named owner; metrics can belong to a groupCreator and creation date are recorded on metrics, dimensions and dashboards. No assigned owner field
LineageLineage graph from sources to metrics in dbt Catalog (Starter plan and above)Each custom metric shows the formula it is built from. No lineage graph
Audit logLog of user and system events, kept at least 12 months (Enterprise and Enterprise+ plans)Creator is recorded on every object, last editor on reports. No customer-facing audit log
Definition versioningGit: branches, pull requests and code reviewVersion history with restore for dashboards, reports, metrics and dimensions. No branches
Multi-store and multi-brandYou model it, for example with a store dimension in your modelsSeveral Shopify stores in one workspace, with a store filter and no per-store fee. Customers are not matched across stores

Sources: dbt Semantic Layer FAQs, dbt docs on groups, Catalog and the audit log, and Polar's help center, as of November 2026.

The table shows the trade-off. dbt gives a data team code-level governance: lineage, owners, audit logs and pull requests. Polar gets a commerce team to a trusted number faster. Most brands under $50M in GMV need the second first.

What each option really costs

The dbt Semantic Layer is cheap on its own. Starter is $100 per seat per month. The full cost of running it for commerce metrics includes:

  • Ingestion. A tool or custom code to load Shopify, ad platforms and email into the warehouse.
  • Warehouse compute. Every metric query runs SQL on your warehouse.
  • Modeling time. The staging and fact models described above, and their upkeep. This is usually the largest line, because it is people.
  • Plan limits. Starter includes 5,000 queried metrics per month. Teams that put AI agents on top of the layer should check how their agents' queries count against that number.

A managed layer bundles ingestion, warehouse, modeling and definitions into one subscription. You pay more for the software and much less in engineering time. For a brand without an analytics engineer, the managed layer usually costs less in total. For a brand with a data team already running dbt, adding the Semantic Layer can cost very little.

When dbt is the right call

  • You already run a dbt project in production, and your Shopify and ad data is already modeled.
  • You have analytics engineers who own metric definitions and want them in version control, with pull requests and code review.
  • Your metrics go beyond commerce: inventory planning, finance close, wholesale operations, product usage.
  • You run several warehouses or business units and want one layer across all of them.

When a managed ecommerce layer is the right call

  • You have no analytics engineer, or the one you have is fully booked.
  • Your core metrics are commerce metrics: revenue, margin, CAC, ROAS, LTV, retention, by channel and by product.
  • You want trusted numbers in weeks, not after a multi-quarter data project.
  • You want AI agents to answer questions and act on your data now, and you want them to read governed definitions instead of writing their own SQL.

Running both

The two approaches are not exclusive. A setup that works for brands with a data team:

  • The managed layer owns commerce metrics: orders, ad spend, email, attribution, margin, cohorts.
  • dbt owns the rest: ERP, finance, logistics, anything specific to the company.
  • Tables your team already models in dbt are pulled into the managed layer, so commerce metrics can use them (product costs, wholesale orders, retail sales).

This keeps one definition per commerce metric without throwing away work your team has already done.

How Polar does it

Polar is a managed semantic layer built for ecommerce, and the base of the Polar Data Platform. Here is how Polar's semantic layer works in practice:

  • Definitions ship ready. Polar's semantic layer comes with 400+ ecommerce metrics and dimensions, like blended CAC, net sales, contribution margin and LTV, defined once and applied the same way across Shopify, ad platforms and email.
  • Your team customizes without code. Custom metrics and dimensions use formulas, filters and if/then logic, and get the same governance as the built-in ones. Changes to dashboards, reports, metrics and dimensions keep a version history you can restore. It is not git: there are no branches or pull requests.
  • The data model is included. Polar has 45+ native commerce connectors, plus an AI Data Engineer that builds a connector for any other source. Everything loads into a dedicated Snowflake database for each brand. Shopify data refreshes every 15 minutes.
  • Your dbt work is not lost. Polar can connect your own Snowflake or BigQuery as a source and read the tables and views your team already maintains, such as product costs, wholesale or retail sales.
  • Access is set by role. Default and custom roles control who sees which dashboards and reports, and whether they can explore data or use Ask Polar.
  • SQL access is an option. Data teams can query the Snowflake data with the Snowflake Reader Account option, which is paid and read-only.
  • AI reads the same definitions. Dashboards, Ask Polar, the Polar Operator and the Polar MCP all use the same layer. When Claude or ChatGPT asks for blended CAC through the MCP, it gets Polar's definition, not a guess at your tables.

Where Polar is not the right fit: Shopify has to be your core store, and Polar does not replace dbt for metrics outside commerce. If most of your metrics are finance or operations metrics, keep them in dbt and use Polar for the commerce side.

For a ranking of ecommerce tools by the quality of their semantic layer, see our guide to the best semantic layer for ecommerce data.

Want to see your commerce metrics defined on day one? Book a demo.

Table of contents

Make strategic decisions in minutes

See every metric that matters, in one place.

Book a demo

Ecommerce Benchmark

4,000+ brands, refreshed weekly.

See the benchmark

Frequently asked questions

Is the dbt Semantic Layer free?

Partly. MetricFlow is open source under Apache 2.0, and dbt Core users can define metrics and query them locally. Querying through the Semantic Layer APIs and integrations needs a paid dbt platform plan: Starter at $100 per seat per month with 5,000 queried metrics, or a custom Enterprise plan.

What is the difference between the dbt Semantic Layer and MetricFlow?

MetricFlow is the engine: it reads metric definitions and generates SQL. The dbt Semantic Layer is the hosted service around it, with APIs, caching on Enterprise plans, access control and integrations with BI and AI tools.

Is a metrics layer the same as a semantic layer?

In practice, mostly yes. A metrics layer focuses on metric definitions. A semantic layer also covers entities, dimensions and the joins between them. The dbt Semantic Layer and Polar both cover entities, dimensions and joins, not only metrics.

Can I use dbt and Polar together?

Yes. Polar can read tables and views from your own Snowflake or BigQuery, so models your team builds in dbt can feed Polar's commerce metrics. Teams usually keep non-commerce metrics in dbt.

Do AI agents need a semantic layer?

If you want consistent answers, yes. Without one, an agent writes its own SQL against raw tables and can define the same metric differently from one question to the next. With one, it asks for a metric by name and gets the governed definition. Both the dbt Semantic Layer (through the dbt MCP server) and Polar (through the Polar MCP) give agents that access.

Ready to stop guessing and start growing?

Make strategic decisions in minutes, not weeks.

Book a demo