Skip to content

The moment it happens

Report shop orders to Meta for better ad targeting

Every order is sent to your Meta pixel as a purchase, so your ads learn from real sales.

Runs
The moment it happens
Apps
Facebook Pages
AI
Not needed
Access
pixel access (ads_management or a CAPI token)

Send this to your assistant

Create a ClickRuntime automation: give me a link my shop can send new orders to. For each one, send a Purchase event with the order value, currency and hashed email and phone to my Meta pixel.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

Meta's ad system learns from conversions, but browser tracking loses a share of them to ad blockers, privacy settings and cookie limits. When purchases or leads never reach Meta, the campaign optimizes on incomplete information, reports poor results and spends budget on the wrong audiences. Fixing that means sending events from your server, which most small teams cannot build alone. The cost is wasted ad budget that nobody can see.

When your shop or form sends a webhook for an order or lead, ClickRuntime receives it, normalizes the customer details, hashes them with SHA-256 as Meta requires, and posts the event to the Conversions API with an event ID so Meta can match it with browser events without counting twice.

It suits stores and lead-generation sites running Meta ads that want better attribution.

What you get out of it

  • Report conversions browsers miss

    Server-side events arrive even when the browser blocked tracking. Meta sees more of the real purchases, so its reports and bidding rely on more of what actually happened. Attribution gaps shrink and reports line up with your own sales records.

  • Improve ad optimization

    Meta's system targets people like those who convert. With complete conversion data, it finds better audiences, which can lower the cost of each lead or sale over time. Better data means better targeting without raising the budget.

  • Hash personal data properly

    Email and phone details are normalized and hashed before leaving your systems, as Meta requires. Raw customer data is not sent in the clear, which supports your privacy obligations. That protects customers and keeps you on the right side of platform rules.

  • Avoid double counting

    Each event carries an event ID matching the browser event, so Meta merges them rather than counting two sales. Your reported conversions stay accurate and trustworthy. Clean numbers make every later decision easier to trust, from budgets to creative.

  • Skip custom development

    Building and hosting a server integration takes engineering time. Receiving a webhook and forwarding the event gets the benefit without maintaining code of your own. Your team keeps working on the shop, not plumbing for ads.

How it works

What happens, step by step

  1. When your shop sends a new order to your ClickRuntime link, the automation runs straight away.

  2. It scrambles the customer's email and phone number in the standard way Meta requires, so the raw details are never shared.

  3. It sends the order to your Meta pixel as a purchase with its value and currency, so your ads learn from real sales.

  4. Each order carries its own order number, so Meta counts it only once even if your website also reports it.

Before it runs live

  • Connect Facebook Pages
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Report shop orders to Meta for better ad targetingjust nowSucceeded
Meta Events Manager · PixelPurchase · 129.00 USD · event_id 5521 · matched on email and phone

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other Facebook Pages steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
send_orders_and_leads_to_meta_conversions_api.pyexample
import hashlib, time
from clickruntime import on_event, credentials, http

PIXEL_ID = "987654321000000"

def sha(value):
    return [hashlib.sha256(value.strip().lower().encode()).hexdigest()] if value else []

@on_event
def handle(event):
    order = event.json
    customer = order.get("customer") or {}
    phone = "".join(ch for ch in (customer.get("phone") or "") if ch.isdigit())
    payload = [{"event_name": "Purchase", "event_time": int(time.time()), "event_id": str(order["id"]),
                "action_source": "website",
                "user_data": {"em": sha(order.get("email") or customer.get("email")), "ph": sha(phone)},
                "custom_data": {"value": float(order["total_price"]), "currency": order["currency"]}}]
    resp = http.post(f"https://graph.facebook.com/v21.0/{PIXEL_ID}/events",
                     json={"data": payload, "access_token": credentials.secret("META_CAPI_TOKEN")})
    resp.raise_for_status()
    return {"events_received": resp.json()["events_received"]}

FAQ

Common questions

Which events can it send?
Any standard event your webhook represents, such as Purchase, Lead or CompleteRegistration, along with the value and currency. The event name is mapped from the webhook so each order or lead is sent as the right type. Value and currency are included for purchases.
Do I need a Meta access token?
Yes. The Conversions API needs your Pixel or dataset ID and an access token generated in Events Manager. The token is stored as a secret and is used only to send events from this flow. The ID is kept in the secrets store.
How do I check that events arrive?
Open the Test Events tab in Meta's Events Manager and send a test event code. The flow can include the code during setup, and the ClickRuntime dashboard logs each call and the response from Meta. Matching events in the same view confirm deduplication.
What permissions does it need?
pixel access (ads_management or a CAPI token). Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run for each event the app sends.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Report shop orders to Meta for better ad targeting” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.