What counts as a lead in AxiTrace, the Leads list and its settings, the 90-day history window, excluding a lead, turning a lead into an order or linking an existing one, privacy, and how to send products and a value with form submit, subscribe, start trial and custom events from the PHP SDK, the JavaScript SDK, the dataLayer and the HTTP API.

Leads: lead events, products and the Leads workspace

Leads lists the form submissions, sign-ups, subscriptions and trial starts your site records, how each person was acquired, and whether the lead became an order. Open it from Leads in your workspace menu, right after Orders. The first part of this page explains the Leads workspace; the second part shows how to send the products and the value a lead is about.

You install it on your storefront

AxiTrace never edits your store, your website or your server code. Adding the SDK calls and the payload fields on this page is done by you, the store owner, or by your developer. Leads works without any change for the forms, subscriptions and trials you already track; products and a value are optional extras you can add when you are ready.

What counts as a lead

A lead is one real submission of one of these events:

  • Inquiry forms: contact, quote and other inquiry forms sent as a form submit.
  • Registration forms: account sign-up forms.
  • Subscriptions: subscribe events and newsletter sign-up forms.
  • Trial starts: start trial events.
  • Custom events you choose: a custom event counts as a lead only when it is registered in your workspace and you switch it on in Settings > Leads. Choosing it changes only what Leads shows, never how the event is tracked or sent to ad platforms.

AxiTrace decides the kind of a form from the form itself, the same way it decides what to send to ad platforms (see How form submissions are classified). Login, search, checkout-step and system forms (password reset, e-mail verification, invitations, app installs) are never leads. When you know what a form is, declare its type and it is final (see Declaring the form type yourself).

One submission is one lead. A retried request with the same eventSalt (or, on /v1/custom-events, the same event_id) is stored once. Two submissions by the same person are two leads, even on the same day; AxiTrace never merges leads by guessing.

Settings > Leads and the 90-day history window

Settings > Leads is where you choose which sources appear in Leads. It is always available, even before your first lead arrives. Inquiry forms, registration forms, subscriptions and trial starts are on by default.

  • Switching a source on shows its leads from up to 90 days before that moment, at once. No import runs: the leads were already recorded as events.
  • Your plan's data retention can shorten that window. When raw events older than your retention are gone, their leads are gone too; the settings page shows from which date each source is visible.
  • Switching a source off hides the leads that arrive afterwards. The earlier ones stay listed, with their exclusions and orders.
  • Switching it on again starts a new 90-day window from that moment. Leads recorded while the source was off reappear when they fall inside the new window.

Owners and editors can change the settings. Viewers see them read-only, and demo workspaces cannot be changed.

The Leads list and lead details

The Leads menu item appears as soon as the first lead of a switched-on source is recorded. Each row shows when the lead was received, its source, the contact, the country, the lead value, the products, the first line of the visitor's message, the first click and the last click, and whether it was converted. Six cards sum up the selection:

  • Total leads: every lead in the date range that is not excluded.
  • Converted in the panel: leads a team member turned into an order in AxiTrace, by creating the order from the lead or linking an existing order. A conversion that is still pending, or that failed, does not count.
  • Panel conversion rate: leads converted in the panel divided by total leads.
  • Median time to panel conversion: from the lead to the purchase time of its order.
  • Linked to an order by hand: leads a team member linked to an order, at any time after the lead.
  • Matched to an order (any time): leads for which AxiTrace found a later order of the same person on its own (same visitor profile, e-mail or phone), with no time limit.

If your team does not convert leads in the panel, the first three cards stay at zero while Matched to an order shows the real follow-up orders. The question "how many leads became customers" is answered by the Leads vs Orders report: it counts only the first order within the conversion window and leaves out repeat leads, existing customers and purchases made in the same session as the lead, so its Converted leads figure is usually lower than Matched to an order.

You can filter by date, country, lead value and currency, source, conversion state, exclusion, product, and by the source, medium and campaign of the first click and of the last click. The search covers order IDs, visitor IDs and, if your access includes personal data, e-mail, name and the message.

First click is the first visit of this visitor. Last click is the visit in which the lead was submitted. Leads show these two only; data-driven attribution applies to orders, not to leads.

The campaign, ad set and ad of each click come from the URL parameters on your ads. Which parameters to add on each ad platform, and what the ID confidence of a click means, is explained in Tracking URL parameters per platform.

Lead value and products are context, never revenue. They are shown on the lead and can be filtered on, but they are not counted as orders, revenue, profit or ROAS anywhere. A lead without a value shows Unknown, never zero.

Lead statuses

Every lead has a status that shows where it is in your sales process. A new lead starts with the default status, New. Change it from the coloured badge in the Status column of the Leads list or on the lead's page; the change is saved at once and the lead's page shows who changed it last and when.

Each workspace starts with seven statuses: New, Contacted, Qualified, Proposal sent, Won, Lost and Unqualified. Edit them in Settings > Leads > Lead statuses: rename them, pick a colour (or no highlight), change their order, choose the default, add your own (up to 30) or delete the ones you do not use. Leads with a deleted status show the default status again. The default status cannot be deleted; make another status the default first.

A coloured status highlights the lead's row in the list. Filter the list by one or more statuses, or sort it by status (in the order of your settings, newest first within a status). Excluded leads stay gray whatever their status.

The status marked Won on order (Won by default) is set automatically when a lead is turned into an order or linked to an existing one. You can still change it afterwards. Statuses are independent of the conversion state and of exclusion: they never change orders, reports or what is sent to ad platforms.

Excluding a lead

Spam, a test submission or a duplicate you do not want to count can be excluded with Exclude from Leads metrics on the lead's page. The lead stays listed, grayed, and stops counting in all four cards. Restore to Leads metrics counts it again. Exclusion affects only the Leads page: orders, other reports, attribution and what was sent to ad platforms stay as they are.

Turning a lead into an order

When a lead becomes a sale outside your store checkout (a signed quote, an order taken by phone), an editor can open the lead and choose Create order. The form asks only for the commercial part:

  • Order ID: optional. Leave it empty and AxiTrace generates one starting with AXL-. If an order with your ID already exists, AxiTrace offers to link it instead.
  • Revenue, currency and payment method.
  • Purchase time in your workspace time zone, between the lead time and now. Attribution uses this time.
  • Products: prefilled from the lead when it carried products. Each line needs SKU, name, quantity and unit price.

The customer of the order is the lead's own customer: visitor, session, contact details and ad click IDs are taken from the lead and cannot be edited, so the order lands on the lead's visitor profile and gets normal purchase attribution at its purchase time. A lead that carries no identifier at all (no visitor, session, customer ID, e-mail or phone) shows a warning first: its order would have no history and no attribution.

The lead shows Conversion pending while the order is stored and Converted with a link to the order once it is done. If storing fails, Retry sends the same order again (a repeated attempt never creates a second order) and Cancel conversion removes the failed attempt so you can create it again with changed data. On the Orders list, an order created from a lead shows a From lead link back to it.

Internal only, or sent to your ad platforms

A created order is internal only by default: it appears in AxiTrace reports and attribution and is not sent anywhere. To also deliver it as a purchase to the ad platforms you have connected and enabled for purchases, switch on Also send this order to eligible integrations for that one conversion. Consent rules apply as for every order. The choice is made per conversion and is shown on the lead afterwards.

If the order already exists in AxiTrace (for example the customer later bought in your store), enter its order ID under Link an existing order and confirm. Nothing is matched automatically.

  • Linking changes nothing in the order: no purchase is sent again, and its attribution and visitor profile stay as they are.
  • An order placed before the lead cannot be its conversion.
  • An order of another visitor profile needs an extra confirmation. The link records the relation only; the profiles are not merged.
  • Refunded or excluded orders can still be linked; the link stays as a historical conversion.
  • Each lead links to one order, and each order to one lead.

Privacy and access

  • Leads are read from the events you already send. AxiTrace keeps no second copy of the contact details, so your data retention and a workspace deletion remove leads together with the events.
  • Contact details (name, e-mail, phone, IP address) are masked for team members whose access does not include personal data, whatever their edit rights.
  • The visitor's message is personal data too: team members whose access does not include personal data see only that a message exists, never its text. It is erased with the contact details.
  • Only owners and editors can exclude, convert or link a lead; viewers see the page read-only, and demo workspaces cannot be changed.
  • When a customer asks for their data to be erased (for Shopify stores, the customers/redact request), the contact details on their leads are blanked. The lead stays listed without contact, and an order created from it afterwards carries no contact either.

Sending products and a value with a lead

Every lead event can carry the products the lead is about (the sofa in a quote request, the box in a subscription, the plan of a trial) and, where the event has none yet, a value. Both are optional. They appear on the lead, prefill the order form of a conversion and can be filtered on.

Event Products Value and currency Retry identity
Form submit root products root value, currency (new) eventSalt
Subscribe root products root value, currency (new) eventSalt (new on /v1/subscribe)
Start trial root products unchanged: trial_value, trial_currency eventSalt (new on /v1/start_trial)
Custom event root products unchanged: value, currency event_id

A product line has the same shape as a line of a transaction: sku, name, quantity and finalUnitPrice as {"amount": 1200, "currency": "EUR"}, plus the optional categories, image, url, netUnitPrice, tax, regularPrice, discountPrice, discountPercent and externalId.

Rules for lead products

  • Products are always optional. A lead without products is a complete lead.
  • A line is kept only when it is a valid purchase line: a non-empty sku and name, a finalUnitPrice of zero or more and a quantity greater than 0.
  • An invalid line is dropped, and the lead is always stored. A product never makes AxiTrace reject a lead, and the response stays a success. The response does not list dropped lines, so check what you send against these rules.
  • One currency per lead. When the event has a value currency (currency, or trial_currency on a trial), every line must be in that currency. Without one, the first valid line that names a currency sets it. A line in another currency is dropped. A price given as a bare number takes that currency. Currency codes are read case-insensitively and stored in upper case (eur is EUR). Give the prices a currency one way or the other: when neither the event nor any line names one, the lines are dropped, on every path (JavaScript SDK, PHP SDK and HTTP API).
  • unitCost is not part of a lead. It is removed from every line (the line itself is kept); product costs belong on the order.
  • The value is context. A negative or unreadable value, or a currency that is not a three-letter ISO 4217 code, is left out and the lead is still stored.
  • No new limit on the number of products; the usual request size limits apply.

Existing integrations keep working

Nothing changes for a call that does not send the new fields: the same request is accepted and stored exactly as before, with the same response. There is no new version number to send, no nested lead object and no new contact field; contact details stay in the fields every event already has. A native form whose own fields happen to be called value, currency or products keeps sending them as form parameters unless they have the shape described here.

PHP SDK

From PHP SDK 1.12.0, FormSubmitEvent, SubscribeEvent, StartTrialEvent and CustomEvent have addProduct() and setProducts() with the same signatures as TransactionEvent: each entry is an AxiTrace\Model\Product or a plain array in the transaction line shape. For a Product, the SKU falls back to its item ID and the quantity to 1. FormSubmitEvent and SubscribeEvent gain setValue($value, $currency), and SubscribeEvent and StartTrialEvent gain setEventSalt(). Only an entry that is neither an array nor a Product throws; an invalid line is dropped when the event is sent.

<?php
use AxiTrace\AxiTrace;
use AxiTrace\Model\Event\CustomEvent;
use AxiTrace\Model\Event\FormSubmitEvent;
use AxiTrace\Model\Event\StartTrialEvent;
use AxiTrace\Model\Event\SubscribeEvent;
use AxiTrace\Model\Product;

$axitrace = AxiTrace::init('sk_live_YOUR_SECRET_KEY');

// Form submit: a quote request for one sofa, worth 1,200 EUR.
$form = (new FormSubmitEvent('quote-request'))
    ->setClientEmail($_POST['email'])
    ->setFormParams(['email' => $_POST['email'], 'message' => $_POST['message']])
    ->setEventSalt('quote-' . $quoteId)          // a retry is stored once
    ->setValue(1200.00, 'EUR')
    ->addProduct((new Product('SOFA-3'))->setItemName('Three-seat sofa')->setPrice(1200.00)->setQuantity(1));
$axitrace->track($form);

// Subscribe: a paid box subscription.
$subscribe = (new SubscribeEvent('reader@example.com'))
    ->setSubscriptionType('box')
    ->setEventSalt('subscription-' . $subscriptionId)
    ->setValue(29.00, 'EUR')
    ->setProducts([
        ['sku' => 'BOX-M', 'name' => 'Monthly box', 'finalUnitPrice' => 29.00, 'quantity' => 1],
    ]);
$axitrace->track($subscribe);

// Start trial: the value stays setTrialValue(); its currency anchors the lines.
$trial = (new StartTrialEvent('Pro Plan'))
    ->setTrialValue(49.99, 'USD')
    ->setEventSalt('trial-' . $accountId)
    ->addProduct(['sku' => 'PLAN-PRO', 'name' => 'Pro Plan', 'finalUnitPrice' => 49.99, 'quantity' => 1]);
$axitrace->track($trial);

// Custom event: the value and currency stay constructor arguments.
$custom = (new CustomEvent('quote_requested', ['menu_name' => 'Salad'], 149.50, 'PLN', null, $quote->getUuid()))
    ->addProduct(['sku' => 'MENU-SALAD', 'name' => 'Salad menu', 'finalUnitPrice' => 14.95, 'quantity' => 10]);
$axitrace->events()->send($custom);

The helpers formSubmit(), subscribe() and startTrial() read the same fields from their existing $params argument, so no signature changes: products (a list of lines), eventSalt, and on formSubmit() and subscribe() value together with currency (both are needed). Every other key is sent as before.

<?php
$axitrace->formSubmit('quote-request', [
    'email' => $_POST['email'],
    'message' => $_POST['message'],
], [
    'eventSalt' => 'quote-' . $quoteId,
    'value' => 1200.00,
    'currency' => 'EUR',
    'products' => [
        ['sku' => 'SOFA-3', 'name' => 'Three-seat sofa', 'finalUnitPrice' => 1200.00, 'quantity' => 1],
    ],
]);

$axitrace->subscribe('reader@example.com', [
    'subscription_type' => 'box',
    'value' => 29.00,
    'currency' => 'EUR',
    'products' => [['sku' => 'BOX-M', 'name' => 'Monthly box', 'finalUnitPrice' => 29.00, 'quantity' => 1]],
]);

$axitrace->startTrial('Pro Plan', [
    'trial_value' => 49.99,
    'trial_currency' => 'USD',
    'eventSalt' => 'trial-' . $accountId,
    'products' => [['sku' => 'PLAN-PRO', 'name' => 'Pro Plan', 'finalUnitPrice' => 49.99, 'quantity' => 1]],
]);

JavaScript SDK

The JavaScript SDK served from your tracking domain sends the new fields with no update on your side. For a form submit, a subscribe or a trial start, put products (and on form submit and subscribe a numeric value with its currency) among the properties of the call; the SDK moves them to the root of the request. For a custom event, pass products in the options, next to the value and currency.

// Form submit with a value and one product
Axitrace._instance.track('form.submit', {
    label: 'quote-request',
    email: 'jane@example.com',
    value: 1200,
    currency: 'EUR',
    products: [
        { sku: 'SOFA-3', name: 'Three-seat sofa', finalUnitPrice: 1200, quantity: 1 }
    ]
});

// Subscribe with a value and one product
Axitrace._instance.track('subscribe', {
    email: 'reader@example.com',
    subscription_type: 'box',
    value: 29,
    currency: 'EUR',
    products: [{ sku: 'BOX-M', name: 'Monthly box', finalUnitPrice: 29, quantity: 1 }]
});

// Trial start: the value stays trial_value / trial_currency
Axitrace._instance.track('start_trial', {
    plan_name: 'Pro Plan',
    trial_value: 49.99,
    trial_currency: 'USD',
    products: [{ sku: 'PLAN-PRO', name: 'Pro Plan', finalUnitPrice: 49.99, quantity: 1 }]
});

// Custom event: products in the options
Axitrace.trackCustom('quote_requested', { menu_name: 'Salad' }, {
    value: 149.50,
    currency: 'PLN',
    products: [{ sku: 'MENU-SALAD', name: 'Salad menu', finalUnitPrice: 14.95, quantity: 10 }]
});

The SDK only tidies the shape (a numeric string becomes a number, a bare price gets the event currency); the rules above decide which line is kept. A value that is not a number of zero or more, and a currency sent with neither a value nor products, stay ordinary form parameters as before.

dataLayer: generate_lead

With GA4 dataLayer auto-tracking on, a generate_lead push becomes a form submit with its value and currency, and its items become the lead's products: item_id is the SKU, item_name the name, price the unit price in the push's currency, item_category the category, and a missing quantity counts as 1.

window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
    event: 'generate_lead',
    ecommerce: {
        value: 1200,
        currency: 'EUR',
        items: [{ item_id: 'SOFA-3', item_name: 'Three-seat sofa', price: 1200, quantity: 1 }]
    }
});

HTTP API

Server requests send the same fields at the root of the body of /v1/form/submit, /v1/subscribe, /v1/start_trial and /v1/custom-events, with your secret key as for every server endpoint (see Authentication).

curl -X POST https://stat.axitrace.com/v1/form/submit \
  -u "sk_live_YOUR_SECRET_KEY:" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "quote-request",
    "client": { "customId": "value-of-the-vt_vid-cookie", "email": "jane@example.com" },
    "sessionId": "value-of-the-vt_sid-cookie",
    "eventSalt": "quote-1001",
    "params": { "email": "jane@example.com", "message": "Price for the grey sofa?" },
    "value": 1200,
    "currency": "EUR",
    "products": [
      { "sku": "SOFA-3", "name": "Three-seat sofa", "quantity": 1,
        "finalUnitPrice": { "amount": 1200, "currency": "EUR" } }
    ]
  }'

curl -X POST https://stat.axitrace.com/v1/subscribe \
  -u "sk_live_YOUR_SECRET_KEY:" \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "value-of-the-vt_vid-cookie",
    "email": "reader@example.com",
    "subscription_type": "box",
    "eventSalt": "subscription-2001",
    "value": 29,
    "currency": "EUR",
    "products": [
      { "sku": "BOX-M", "name": "Monthly box", "quantity": 1,
        "finalUnitPrice": { "amount": 29, "currency": "EUR" } }
    ]
  }'

curl -X POST https://stat.axitrace.com/v1/start_trial \
  -u "sk_live_YOUR_SECRET_KEY:" \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "value-of-the-vt_vid-cookie",
    "plan_name": "Pro Plan",
    "trial_value": 49.99,
    "trial_currency": "USD",
    "eventSalt": "trial-3001",
    "products": [
      { "sku": "PLAN-PRO", "name": "Pro Plan", "quantity": 1,
        "finalUnitPrice": { "amount": 49.99, "currency": "USD" } }
    ]
  }'

curl -X POST https://stat.axitrace.com/v1/custom-events \
  -u "sk_live_YOUR_SECRET_KEY:" \
  -H "Content-Type: application/json" \
  -d '{
    "event_name": "quote_requested",
    "event_id": "5f0c7a52-8a4e-4a53-9a3e-0f1d2c3b4a51",
    "client_id": "value-of-the-vt_vid-cookie",
    "value": 149.50,
    "currency": "PLN",
    "products": [
      { "sku": "MENU-SALAD", "name": "Salad menu", "quantity": 10,
        "finalUnitPrice": { "amount": 14.95, "currency": "PLN" } }
    ]
  }'

A custom event key must be registered in your workspace before it can be sent (see Custom Events) and switched on in Settings > Leads to appear in Leads.

Sending the visitor's message with a lead

Many inquiry forms have a free-text box ("Your remarks, requests or questions about the order"). Its text is the lead's message: shown in full on the lead page, as one line in the Leads list, and searchable by team members whose access includes personal data. Any lead event can carry it: form submit, subscribe, start trial and custom event.

  • Plain text. Send exactly what the visitor typed. It is never rendered as HTML: markup such as <b> is shown as text, and line breaks are kept.
  • Optional, and never a reason to reject a lead. A message that is not a string is ignored and the lead is still stored.
  • At most 5000 characters. A longer message is cut and ends with an ellipsis (…); the lead is still stored.
  • Tidied before it is stored: line breaks become one kind, control characters other than line breaks and tabs are removed, and so are the invisible right-to-left override marks that can make text read differently from what it says; spaces at the end of lines, more than two empty lines in a row and the whitespace around the text are removed.
  • Never sent to your ad platforms and never copied into an order created from the lead.

JavaScript SDK

On a lead form, the SDK finds the message box by itself and sends it as the lead's message instead of as a form field: a <textarea> whose name, id, placeholder or label reads like a message (for example message, comment, notes, inquiry, uwagi, wiadomosc, zapytanie, nachricht), otherwise the form's only <textarea>, otherwise a text field with such a name. Password, hidden and payment fields are never read. To point at the field yourself, add data-axitrace-message to it. Forms in the checkout keep their fields as before.

From your own code, put message among the properties of a form submit, subscribe or trial start, or in the options of a custom event:

<textarea name="remarks" data-axitrace-message></textarea>
Axitrace._instance.track('form.submit', {
    label: 'inquiry',
    email: 'jane@example.com',
    phone: '+48600100200',
    message: 'Is the chair available in pink?\nPlease call after 5 pm.'
});

Axitrace.trackCustom('quote_requested', { plan: 'pro' }, {
    message: 'We need 20 seats from March.'
});

A message is not read from a GA4 generate_lead push: the dataLayer usually feeds Google Analytics, which does not allow personal data, so keep free text out of it.

PHP SDK

Call setMessage() on FormSubmitEvent, SubscribeEvent, StartTrialEvent or CustomEvent, or pass a string message in the $params of formSubmit(), subscribe() or startTrial(). The form fields in $formData are sent as they are.

$axiTrace->formSubmit('inquiry', ['email' => $email, 'phone' => $phone], [
    'message' => $_POST['remarks'] ?? '',
]);

$event = (new FormSubmitEvent('inquiry'))
    ->setClientEmail($email)
    ->setFormParams(['email' => $email])
    ->setMessage($_POST['remarks'] ?? '');

HTTP API

Send message as a string at the root of the body of /v1/form/submit, /v1/subscribe, /v1/start_trial or /v1/custom-events, next to products:

curl -X POST https://stat.axitrace.com/v1/form/submit \
  -u "sk_live_YOUR_SECRET_KEY:" \
  -H "Content-Type: application/json" \
  -d '{
    "label": "inquiry",
    "client": { "customId": "value-of-the-vt_vid-cookie", "email": "jane@example.com" },
    "params": { "email": "jane@example.com", "phone": "+48600100200" },
    "message": "Is the chair available in pink?\nPlease call after 5 pm.",
    "products": [
      { "sku": "CHAIR-EASY-PINK", "name": "Easy chair, pink", "quantity": 1,
        "finalUnitPrice": { "amount": 599, "currency": "PLN" } }
    ]
  }'