Server-side tracking for Magento 2 and Adobe Commerce
Create a Magento integration with access to orders and ROASaurus fetches paid orders over the REST API every 5 minutes, then sends them to your ad platforms from the server.
| Magento at a glance | |
|---|---|
| Orders arrive by | REST API polling every 5 minutes |
| Credentials | Integration access token; consumer key, consumer secret and access token secret when bearer use is off |
| Resource access | Sales › Operations › Orders |
| Paid orders | State processing or complete |
| Order id | The increment id customers see |
How Magento connects
- Content › Design › Configuration › your store view › HTML Head › Scripts and Style Sheets: add the ROASaurus script tag.
- System › Extensions › Integrations › Add New Integration, with resource access Sales › Operations › Orders. Activate it and copy the access token.
- Enter the token in ROASaurus. Add the shop URL only if the API runs on another address than your shop domain.
Bearer token or OAuth 1.0a
Since Magento 2.4.4, "Allow OAuth Access Tokens to be used as standalone Bearer tokens" is off by default. If it is off in your shop, also enter the consumer key, consumer secret and access token secret from the same integration. ROASaurus then signs every request with OAuth 1.0a instead of sending a bearer token.
How orders are read
Magento Open Source has no order webhooks, so ROASaurus asks the REST API for orders updated since its last run, every 5 minutes, with a 30-minute overlap. Orders in state processing or complete count as paid. The order id is the increment id. Configurable products appear twice in Magento's order data, as parent and child; ROASaurus keeps the parent lines so quantities aren't doubled.
From each order it reads the grand total, currency, customer email and name, billing phone and address with region code, customer id and the customer's IP address.
Linking orders to ad clicks
For exact matching, have your developer fire the ROASaurus purchase snippet on checkout/onepage/success with the order increment id and grand total. Without it, ROASaurus uses an email the visitor gave earlier on your site, such as in a popup, then the IP address when only one visitor fits.
Limits
- No webhooks: orders reach your ad platforms up to 5 minutes after payment. "Fetch orders now" runs a sync on demand.
- The success page snippet needs a small custom module, which your developer adds.
- The connector is built from the platform's official API documentation. Press Test connection after saving your credentials, then place a test order and check the Event log.
Related
Questions, answered
Why are Magento orders fetched every 5 minutes?
Magento Open Source has no order webhooks. ROASaurus polls the REST API every 5 minutes instead, with an overlap so no order is missed, and ignores orders it already has.
My token is rejected. What should I check?
Since 2.4.4, standalone bearer tokens are off by default. Enter the consumer key, consumer secret and access token secret too, and ROASaurus signs requests with OAuth 1.0a.
Does it work with Adobe Commerce?
The connector uses the Magento 2 REST API and integrations, which Magento Open Source and Adobe Commerce share.
Every sale, traced to the ad that earned it
Server-side tracking, profit and lifetime value in one app. 14-day free trial, no credit card.
Start your free trial →