Store connections

Set up ROASaurus on Magento 2 / Adobe Commerce

Updated

Magento needs no ROASaurus module. Create an Integration in the Magento admin, paste its access token in ROASaurus, and add the tracking script under the HTML head of your store view. ROASaurus fetches paid orders every 5 minutes.

Before you start

  • Magento admin access to System › Extensions › Integrations and Content › Design › Configuration.
  • Optional: a developer for the success-page snippet.

Steps

  1. Add the store

    In ROASaurus, open the store menu at the top of the sidebar, choose Add a store, then Magento / Adobe Commerce. Enter the address your customers visit and click Continue.

    You should see: Connect Magento / Adobe Commerce, with Last order received: none yet, Last sync: never, the numbered setup steps and the credential fields.

  2. Add the tracking script

    Copy the script tag from step 1 of the connection page. It contains your store key. Paste it under Content › Design › Configuration › your store view › HTML Head › Scripts and Style Sheets and save. Flush the page cache.

    You should see: Open your shop with ?roasaurus=connected at the end of the address: the browser says "ROASaurus is connected."

  3. Create an integration

    System › Extensions › Integrations › Add New Integration, with resource access to Sales › Operations › Orders and Stores › Settings › All Stores. Activate it and copy the access token into Integration access token. When "Allow OAuth Access Tokens to be used as standalone Bearer tokens" is off (the default since 2.4.4), also fill in the consumer key, consumer secret and access token secret. Fill in Shop URL only if the API runs on another address. Save and click Test connection.

    You should see: A success message from Test connection.

  4. Add the thank-you page snippet

    The connection page shows a snippet that fires the browser purchase with the order id. Your developer fires it on checkout/onepage/success with the order increment id. It links the order to the visitor and their ad click exactly; without it, ROASaurus matches by email or by IP address and browser.

  5. Fetch the first orders

    Press Fetch orders now. The first fetch reads the last 3 days of paid orders; after that ROASaurus fetches every 5 minutes by itself.

    You should see: "Fetched n paid orders, m new." and Last sync with the time. On Getting started, Connect the store turns green.

What you should see

Paid Magento / Adobe Commerce orders appear under Profit › Orders with their channel, and purchases go out to the ad platforms you connected (Data quality › Deliveries). Getting started shows Connected on with the date.

How orders arrive

Magento Open Source has no order webhooks, so ROASaurus fetches orders in the states processing and complete every 5 minutes. Configurable products are counted once, by the parent line. Headless Magento storefronts use the same script on their pages.

What ROASaurus reads

Only paid orders, with their products, totals, currency, customer contact details and address. Contact details are hashed before they go to an ad platform. Refunds follow where the platform reports them. Your shop is never changed.

Common problems

"Connection failed: … Save your credentials first, then test."
Test connection, Create webhook and Fetch orders now use the saved credentials. Click Save after you change a field, then test again. The text after "Connection failed" is the platform's own answer, for example a refused key.
"Sync failed: …" or the Connect the store step turns red
The platform refused the fetch, most often because the key was removed or lacks read access to orders. Create a new key with the access listed on the connection page, save it and press Fetch orders now.
Test connection answers 401
The token is refused as a Bearer token. Fill in the consumer key, consumer secret and access token secret too, so ROASaurus signs requests with OAuth 1.0a.

Next step

Next: connect your ad platforms and add your costs.

Continue with Getting started

Still stuck? Email us.

Every sale, traced to the ad that earned it

Server-side tracking, profit and lifetime value in one app. Free plan, no credit card.