Linking Adobe Commerce (Magento) as a source

Let AI connect your sources for you

Skip the manual setup — run this in your project and the wizard auto-detects your databases and APIs and connects them to PostHog.

Learn more
PostHog Wizard hedgehog

Alpha release

This source is currently in alpha. The interface and available tables may change.

The Adobe Commerce (Magento) connector syncs orders, invoices, shipments, and more into the PostHog data warehouse, so you can analyze them alongside your product data.

Prerequisites

Credentials that can read the data you want to sync. PostHog only reads data, so read access is enough.

Adding a data source

  1. In PostHog, go to the Sources tab of the data pipeline section.
  2. Click + New source and click Link next to this source.
  3. Enter your credentials (see Configuration below) and click Next.
  4. Select the tables you want to sync, choose a sync method and frequency, then click Import.

Once the syncs are complete, you can start querying this data in PostHog.

Enter your Adobe Commerce (Magento 2) store URL and API credentials to pull your store data.

The recommended way to connect is an integration access token: in the admin go to System > Extensions > Integrations, create an integration, grant it read access to Sales, Catalog, Customers and Carts, then activate it and copy the Access Token.

On Magento 2.4.4 and later, integration tokens are rejected as bearer tokens until you set Stores > Configuration > Services > OAuth > Access Token Expiration > Allow OAuth Access Tokens to be used as standalone Bearer tokens to Yes. If you can't change that setting, connect with an admin username and password instead and PostHog will mint a short-lived admin token for each sync.

You'll be asked for:

  • Store URL: for example https://store.example.com.
  • Authentication method: choose between Integration access token (recommended) and Admin username and password.

Sync modes

Each table can be synced in one of several modes, depending on what the source supports:

  • Webhook (when available) – the source pushes changes to PostHog in real time. Fastest freshness, lowest ongoing cost, and the only mode that reliably captures updates and deletes.
  • Incremental – only new or updated rows are synced on each run, using a cursor field (such as an updated_at timestamp). Cheaper than a full refresh, but deletes aren't captured.
  • Append only – new rows are appended using a cursor field; existing rows are never updated. Ideal for immutable, append-only tables like event logs.
  • Full refresh – the whole table is reloaded on every sync. Use it when a table has no reliable cursor or when you need deletions reflected.

See sync methods for a full explanation of how each mode works and how to choose between them.

All Adobe Commerce (Magento) tables are full refresh. Each sync replaces the contents of the table.

Configuration

OptionTypeRequired
Store URLtextYes
Store code (optional)textNo
Authentication methodselectYes

Supported tables

TableDescriptionSync methodIncremental fieldPrimary key
orders

Sales orders placed in the store, with their totals, status, addresses, payment and line items.

Incremental, Full refreshupdated_at—
invoices

Invoices issued against orders, recording the amounts captured for a set of order line items.

Incremental, Full refreshupdated_at—
shipments

Shipments dispatched against orders, with their packages, tracking numbers and shipped items.

Incremental, Full refreshupdated_at—
creditmemos

Credit memos (refunds) issued against orders, recording refunded amounts and returned items.

Incremental, Full refreshupdated_at—
transactions

Payment gateway transactions recorded against order payments (authorization, capture, refund, void).

Incremental, Full refreshcreated_at—
products

Catalog products with their type, price, status, attribute set, custom attributes and media.

Incremental, Full refreshupdated_at—
categories

Catalog categories, one row per category in the tree, with its position, level and path.

Incremental, Full refreshupdated_at—
customers

Registered customer accounts with their identity, group, store scope and addresses.

Incremental, Full refreshupdated_at—
carts

Shopping carts (quotes), including active carts and the abandoned ones left behind at checkout.

Incremental, Full refreshupdated_at—
coupons

Coupon codes attached to cart price rules, including auto-generated codes and their usage limits.

Incremental, Full refreshcreated_at—
customer_groups

Customer groups used for pricing, tax classes and cart price rule targeting.

Full refresh——
product_attributes

Product EAV attribute definitions, describing every field the catalog can store on a product.

Full refresh——
tax_classes

Tax classes that products and customer groups are assigned to when calculating tax rules.

Full refresh——
store_views

Store views configured on the instance — the storefront scope that localizes catalog and prices.

Full refresh——
store_groups

Store groups, the middle scope that binds a root category to a set of store views.

Full refresh——
websites

Websites configured on the instance — the outermost scope, owning customer accounts and base currency.

Full refresh——
countries

Directory of countries the instance knows about, with their ISO codes, locale names and regions.

Full refresh——

Troubleshooting

  • If the connection fails with an authorization error, the access token is wrong, expired, or has been revoked. Create a new one, then reconnect the source.
  • If a table syncs no rows, the credential may not have access to that data. Check its permissions, then reconnect the source.

If your sync is failing or data looks wrong, see the Data warehouse troubleshooting guide. If that doesn't help, contact support – we're happy to help.

Still have questions?

Was this page useful?