> For the complete documentation index, see [llms.txt](https://docs.adpage.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.adpage.io/data-and-insights/marketing-integrations/magento.md).

# Magento

Connect Magento 2 with integration credentials for orders, revenue, products and stock.

Connect Magento 2 so AdPage reads orders and product data from your shop directly. Magento has no consumer OAuth flow, so this is a credential connection: you create an integration in the Magento admin and paste four values into AdPage.

AdPage only reads. It never writes an order, a product or a price.

### Before you start

You need **administrator access to the Magento admin**, and your shop's REST API must be reachable from the internet. A staging environment behind an IP allowlist or basic auth will fail the connection test — correctly, because AdPage genuinely cannot reach it.

You will create a Magento *integration*, which yields four values:

| Value               | Magento's name for it |
| ------------------- | --------------------- |
| Consumer key        | Consumer Key          |
| Consumer secret     | Consumer Secret       |
| Access token        | Access Token          |
| Access token secret | Access Token Secret   |

{% hint style="warning" %}
**Magento shows these once.** After you activate the integration, the four values are displayed on a single screen and never again. Copy all four before closing it. Losing them means deleting the integration and creating a new one.
{% endhint %}

### Create the integration in Magento

{% stepper %}
{% step %}

#### Open the integrations screen

In the Magento admin, go to **System → Extensions → Integrations** and select **Add New Integration**. Name it something recognisable, such as `AdPage`.
{% endstep %}

{% step %}

#### Grant read access to the right resources

Under **API**, set Resource Access and select at least **Sales → Operations → Orders** (including **Actions → View**), **Catalog → Products**, and **Stores → Settings → All Stores** (the connection test reads the store configuration, and [full Magento revenue](https://docs.adpage.io/data-and-insights/data-studio/full-magento-revenue.md) needs the names of your store views). Granting full access also works if your policy allows it.
{% endstep %}

{% step %}

#### Activate and copy the four values

Save, then select **Activate** on the integration row and approve. Magento displays the four values — copy all of them now.
{% endstep %}
{% endstepper %}

### Connect Magento in AdPage

{% stepper %}
{% step %}

#### Open the tile

Go to **Integrations**, select the container, and open the **Magento** tile.

<figure><img src="https://1954565367-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FK5kjEu8mwstNkOrvFl6S%2Fuploads%2F7PIGMqu7n9IEfh38r7Rr%2Fintegrations-magento-tile-en.webp?alt=media" alt="Magento tile opened with the connection fields"><figcaption><p>The Magento tile on the Integrations page.</p></figcaption></figure>
{% endstep %}

{% step %}

#### Fill in the base URL and the four values

The **base URL** is your REST endpoint, including the API path — for example `https://yourshop.nl/rest/V1`. A trailing slash is removed automatically.

Paste the consumer key, consumer secret, access token and access token secret.
{% endstep %}

{% step %}

#### Save

AdPage calls your shop before storing anything and reads the store configuration to prove the credentials work. Credentials that fail are never saved, so the tile cannot claim to be connected while every widget stays empty.

On success the tile shows your store name, read from Magento itself — which is also your confirmation that you connected the shop you meant to.
{% endstep %}
{% endstepper %}

### What you get

Orders, revenue and product data in **Business & Revenue** and **Product Performance**, plus inventory available to the Data Assistant: stock levels, out-of-stock views, and demand against availability.

**Full revenue, including orders created in the admin.** AdPage keeps its own copy of your Magento orders and shows **Revenue (Magento, total)** on the Blended ROAS dashboard, split into web shop, offline, B2B and marketplace. Quotes and phone orders that never send an order webhook are included. See [Full Magento revenue](https://docs.adpage.io/data-and-insights/data-studio/full-magento-revenue.md).

Order revenue also feeds the **Marketing Mix Model**, which needs a reliable revenue series far more than it needs tracked conversions.

### Reading the numbers

**Order status matters.** Magento keeps pending, processing, complete, cancelled and closed orders in the same place. A revenue figure that looks too high usually includes statuses you would not count as a sale. Revenue (Magento, total) leaves cancelled orders out and subtracts refunds.

**Multi-store views share one endpoint.** A Magento installation with several store views returns all of them. If a container should cover only one, say so to support so the scope can be set.

**Tax display varies.** Magento can report totals including or excluding tax depending on configuration. Check which yours does before comparing to another source.

### Troubleshooting

**The connection test fails immediately.** Check the base URL first — it must include `/rest/V1`, and it must be the public URL. `http://` instead of `https://`, or a staging host AdPage cannot reach, both fail here.

**"Unauthorized" or a 401.** One of the four values is wrong, or the integration was never activated. An integration that is saved but not activated produces tokens that do not work.

**"Forbidden" or a 403.** The credentials are valid but the integration lacks resource access. Edit it in Magento and grant the resources listed above. If Magento asks you to reauthorize the integration, it issues a new access token and secret: paste those into the Magento tile again.

**Revenue (Magento, total) says the orders could not be fetched.** The integration may not read orders. Grant **Sales → Operations → Orders → Actions → View**, as above.

**It worked and then stopped.** Someone deleted or reactivated the integration in Magento — reactivating issues new tokens and invalidates the old ones. Create fresh credentials and paste them again.

**Orders are missing for one store view.** See multi-store above.

Still stuck? Contact <support@adpage.io> with the container and the base URL — never the keys.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.adpage.io/data-and-insights/marketing-integrations/magento.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

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