AxiTrace Add Shipping Info event - parameters, required fields, and integration examples.

Add Shipping Info Event

Track when users add shipping information during checkout. This event is part of the checkout funnel and helps measure conversion drop-off at the shipping step, analyze shipping method preferences, and optimize the checkout flow.

POST /v1/checkout/add_shipping_info

When to Use This Event

Trigger this event when a user successfully enters their shipping address or selects a shipping method during checkout:

  • User enters their shipping address
  • User selects a shipping method (standard, express, overnight)
  • User confirms free shipping eligibility
Browser and Server Both Work

Send this event from your backend with /v1/checkout/add_shipping_info, or from the browser with Axitrace._instance.track('add_shipping_info', { ... }). Both paths write the same row and forward to the same destinations.

If your shop already has a GA4 ecommerce dataLayer, you do not need to call anything at all: turn on autoTrackDataLayer and the SDK translates your existing GA4 add_shipping_info push into this event. See the Google Tag Manager guide.

The browser path is deliberately more forgiving than /v1/checkout/add_shipping_info: a missing currency or an empty items array is accepted rather than rejected, because a dataLayer is often not under your control field by field. The REST endpoint keeps the strict contract for backend callers, who are.

No Facebook / TikTok Pixel Mapping

This event does not map to any Facebook or TikTok standard event, so no pixel fires and no Meta or TikTok CAPI event is sent - there is no standard event on either platform to optimise toward, and inventing a custom one would create a conversion you never asked for. It can be forwarded to Google Analytics 4, where it is a recommended event: tick it on your GA4 connection under Events to forward. It is stored in AxiTrace for internal checkout funnel analytics whether or not you forward it anywhere.

If your shop already sends this event to GA4 with its own gtag.js or GTM tag, leave the checkbox off. Forwarding it as well would have GA4 count the same action twice. Forward it when AxiTrace is your only source for it.

Request Parameters

User Identification

At least one of these identifiers is required:

Field Type Description
client_id string Your custom user/visitor identifier (use SDK's vt_vid cookie value)
user_id string Authenticated user ID
session_id string Current session identifier (use SDK's vt_sid cookie value)

Required Fields

Field Type Required Description
currency string Required Currency code (ISO 4217, e.g., USD, EUR). Must be non-empty.
value number Required Cart value. Must be >= 0.
items array Required Array of cart item objects. Must contain at least one item.

Customer Data (for Facebook CAPI)

These top-level fields improve Facebook CAPI Event Match Quality. At the shipping step, you typically have the customer's contact info - include it.

Field Type Description
email string Customer email address. Send as plain text - AxiTrace auto-hashes for Facebook.
phone string Customer phone number (E.164 format). Send as plain text - AxiTrace auto-hashes for Facebook.

Optional Fields

Field Type Description
shipping_tier string Shipping method (e.g., standard, express, overnight, free)
coupon string Applied coupon code
params object Additional parameters (Facebook CAPI data: fbp, fbc, first_name, last_name, etc.)

Item Object

Field Type Description
item_id string Product SKU or ID
item_name string Product name
price number Unit price
quantity integer Quantity in cart
item_category string Product category
item_brand string Product brand

Examples

JavaScript SDK (browser)

// Browser, with the JavaScript SDK. The SDK supplies the visitor and session
// ids from its own cookies, so no client_id or session_id is needed.
Axitrace._instance.track('add_shipping_info', {
    currency: 'PLN',
    value: 698.00,
    shipping_tier: 'Next Day Air',
    items: [
        { item_id: 'SKU-1', item_name: 'Trail Runner', price: 349.00, quantity: 2 }
    ]
});

Server-Side (AxiTrace PHP SDK)

<?php
use AxiTrace\AxiTrace;

// Initialize - auto-reads vt_vid, vt_sid, _fbp, _fbc cookies
$axitrace = AxiTrace::init('sk_live_YOUR_SECRET_KEY');

// Track shipping info added during checkout
$response = $axitrace->addShippingInfo(129.99, 'USD', [
    [
        'item_id' => 'SKU-12345',
        'item_name' => 'Blue Running Shoes',
        'price' => 99.99,
        'quantity' => 1,
        'item_category' => 'Footwear',
        'item_brand' => 'Nike',
    ]
], [
    'shipping_tier' => 'express',
    'coupon' => 'FREESHIP',
]);

Server-Side (cURL)

# Add shipping info with customer email for Facebook CAPI
curl -X POST https://stat.axitrace.com/v1/checkout/add_shipping_info \
  -u "sk_live_YOUR_SECRET_KEY:" \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "value-from-vt_vid-cookie",
    "session_id": "value-from-vt_sid-cookie",
    "email": "customer@example.com",
    "phone": "+1-555-123-4567",
    "currency": "USD",
    "value": 129.99,
    "shipping_tier": "express",
    "coupon": "FREESHIP",
    "items": [
        {
            "item_id": "SKU-12345",
            "item_name": "Blue Running Shoes",
            "price": 99.99,
            "quantity": 1,
            "item_category": "Footwear",
            "item_brand": "Nike"
        }
    ],
    "params": {
        "fbp": "fb.1.1234567890.987654321",
        "fbc": "fb.1.1234567890.AbCdEfGhIjKl"
    }
  }'

Response

Success Response (200 OK)

{
    "success": true,
    "eventId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "action": "add_shipping_info"
}

Error Responses

Status Error Description
400 at least one of client_id, user_id, or session_id is required No user identifier provided
400 currency, value >= 0, and items are required Missing currency, negative value, or empty items array
401 unauthorized Invalid or missing API key

Best Practices

  • Always include email and phone - At the shipping step, you have customer contact info. Include it as top-level fields for Facebook CAPI matching.
  • Include shipping_tier - Track which shipping methods customers prefer to optimize shipping offerings and pricing
  • Send it from one side only - the browser SDK or your backend, never both for the same checkout step, or every shipping selection is counted twice.
  • Link to browser session - Pass SDK cookie values (vt_vid, vt_sid) and Facebook cookies (_fbp, _fbc)
  • Use consistent item_id - Match the item_id used in product.addToCart and begin_checkout for funnel analysis