Store connections

Connect a custom website

Updated

Add the tracking script to every page, send each paid order to ROASaurus (as JSON to your webhook URL, or to the orders API), and fire the purchase with the same order id on your thank-you page. That covers visits, orders and the link between them.

Before you start

  • A developer, or a no-code tool (Zapier, Make, n8n) that sees your paid orders.
  • A store added as Add a store › Other / custom webhook.

Steps

  1. Add the store

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

    You should see: Connect Other / custom webhook, 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 before </head> on every page; site builders call this custom code, code injection or header scripts.

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

  3. Send paid orders

    Choose one way:

    • Webhook: POST each paid order as JSON to Your webhook URL. Fields: order_id, total, currency, email, phone, first_name, last_name, country, zip, client_ip, user_agent, items (variant_id, quantity, price) and, when you can, visitor_id: the value of the _tl cookie. A list of orders in one request works too.
    • Orders API: POST https://app.roasaurus.com/api/v1/orders with the headers X-Roasaurus-Key (your store key) and Authorization: Bearer with an API key from Settings › Store › Orders API. The example request is shown there.

    You should see: The order under Profit › Orders, and Last order received on the connection page.

  4. Add the thank-you page snippet

    The connection page shows a snippet that fires the browser purchase with the order id. Fill in the order id, total and currency on your order confirmation page. It links the order to the visitor and their ad click exactly; without it, ROASaurus matches by email or by IP address and browser.

What you should see

Visits and ad clicks come from the script, paid orders from your backend, and each order carries the clicks of its visitor, from the visitor_id or the thank-you page event.

How orders are matched to visits

Most reliable first: the visitor_id in the order, the purchase event on the thank-you page with the same order id, an email address the visitor gave earlier with consent, and, as a last resort, the only visitor on the same IP address and browser shortly before the order.

A Shopify store without the app

A Shopify admin webhook for order payment (or order creation with an external checkout) to the same URL works too, and a Refund creation webhook takes refunds off revenue. The app gives you more: history, product costs and refunds without setup.

Headless

Headless Shopify (Hydrogen) has its own module: Hydrogen and headless storefronts.

Common problems

Orders arrive but have no channel
Neither visitor_id nor the thank-you event reaches ROASaurus. Pass the _tl cookie as visitor_id, or add the thank-you snippet with the same order id.
I sent an order again with changes, but nothing changed
ROASaurus keeps the first order with a given order_id and ignores repeats, so sending an order twice never counts it twice. Send each order once, when it is paid.
Orders API answers 401
The API key is missing or was regenerated. Create one under Settings › Store › Orders API and send it as a Bearer token with the X-Roasaurus-Key header.

Next step

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.