AxiTrace Select Item event - parameters, required fields, and integration examples.

Select Item Event

Track when users click or select a specific product from a list to view its details. This event pairs with View Item List to measure list-to-product click-through rates, analyze which products attract the most interest from different list positions, and optimize catalog layouts.

POST /v1/catalog/select_item

When to Use This Event

Trigger this event when a user clicks on a specific product from a listing to view its detail page:

  • User clicks a product from a category page listing
  • User clicks a product from search results
  • User clicks a product in a recommendation carousel ("You may also like")
  • User clicks a product in a "Recently viewed" section
  • User clicks a product in a collection or brand page
Browser and Server Both Work

Send this event from your backend with /v1/catalog/select_item, or from the browser with Axitrace._instance.track('select_item', { ... }). 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 select_item push into this event. See the Google Tag Manager guide.

The browser path is deliberately more forgiving than /v1/catalog/select_item: 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 catalog analytics (list click-through rate, product discovery paths) 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
items array Required Array containing exactly 1 item object - the selected product. Sending 0 or more than 1 item will return a 400 error.

List Context (Optional)

Include these fields to link the selection back to the View Item List event for funnel analysis:

Field Type Description
item_list_id string Identifier of the list where item was selected (e.g., category_running_shoes, search_results). Should match the item_list_id from the corresponding view_item_list event.
item_list_name string Human-readable list name (e.g., "Running Shoes", "Search: blue shoes"). Should match the item_list_name from the corresponding view_item_list event.
params object Additional custom parameters

Item Object

Field Type Description
item_id string Product SKU or ID (required)
item_name string Product name
price number Product price
index integer Position in the list where item was clicked (0-indexed). Useful for analyzing which list positions generate the most clicks.
item_category string Product category
item_brand string Product brand
item_variant string Product variant (e.g., "Blue", "Size 10")

Examples

JavaScript SDK (browser)

// Browser, with the JavaScript SDK. Pass the clicked product as a
// single-entry items array; item_list_id is what links the click back to the
// view_item_list impression it came from.
Axitrace._instance.track('select_item', {
    item_list_id: 'category_running_shoes',
    item_list_name: 'Running Shoes',
    items: [
        { item_id: 'SKU-1', item_name: 'Trail Runner', price: 349.00, quantity: 1 }
    ]
});

Server-Side (AxiTrace PHP SDK)

<?php
use AxiTrace\AxiTrace;

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

// Track product selected from a category page
// selectItem() accepts an array or a Product object
$response = $axitrace->selectItem([
    'item_id' => 'SKU-002',
    'item_name' => 'Adidas Ultraboost',
    'price' => 149.99,
    'index' => 1,
    'item_category' => 'Footwear',
    'item_brand' => 'Adidas',
], [
    'item_list_id' => 'category_running_shoes',
    'item_list_name' => 'Running Shoes',
]);
Auto-Read Cookies

AxiTrace::init() automatically reads the vt_vid and vt_sid cookies set by the JavaScript SDK, so you don't need to pass client_id or session_id manually. The SDK also reads the client's IP address and User-Agent from the PHP request context and forwards them via X-Client-IP and X-Client-User-Agent headers.

Server-Side (AxiTrace PHP SDK - Advanced)

For full control, use the SelectItemEvent and Product classes directly:

<?php
use AxiTrace\AxiTrace;
use AxiTrace\Model\Event\SelectItemEvent;
use AxiTrace\Model\Product;

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

// Build the product object
$product = new Product('SKU-002');
$product->setItemName('Adidas Ultraboost')
        ->setPrice(149.99)
        ->setIndex(1)
        ->setItemCategory('Footwear')
        ->setItemBrand('Adidas')
        ->setItemVariant('Core Black');

// Build the select item event
$event = new SelectItemEvent($product);
$event->setItemListId('category_running_shoes');
$event->setItemListName('Running Shoes');

// Auto-sets client_id, session_id from cookies
$response = $axitrace->track($event);

Server-Side (cURL)

curl -X POST https://stat.axitrace.com/v1/catalog/select_item \
  -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",
    "item_list_id": "category_running_shoes",
    "item_list_name": "Running Shoes",
    "items": [
        {
            "item_id": "SKU-002",
            "item_name": "Adidas Ultraboost",
            "price": 149.99,
            "index": 1,
            "item_category": "Footwear",
            "item_brand": "Adidas"
        }
    ]
  }'

Server-Side (Python)

import os
import requests
from flask import request

secret_key = os.environ.get('AXITRACE_SECRET_KEY')

# Read AxiTrace SDK cookies set by the JavaScript SDK
visitor_id = request.cookies.get('vt_vid')
session_id = request.cookies.get('vt_sid')

# Track product selection from a category page
requests.post(
    'https://stat.axitrace.com/v1/catalog/select_item',
    auth=(secret_key, ''),
    json={
        'client_id': visitor_id,
        'session_id': session_id,
        'item_list_id': 'category_running_shoes',
        'item_list_name': 'Running Shoes',
        'items': [{
            'item_id': 'SKU-002',
            'item_name': 'Adidas Ultraboost',
            'price': 149.99,
            'index': 1,
            'item_category': 'Footwear',
            'item_brand': 'Adidas',
        }]
    }
)

Response

Success Response (200 OK)

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

Error Responses

Status Error Description
400 at least one of client_id, user_id, or session_id is required No user identifier provided
400 items array must contain exactly 1 item for select_item The items array is missing, empty, or contains more than one item. You must send exactly 1 item - the product that was selected.
401 unauthorized Invalid or missing API key

Best Practices

  • Always include item_list_id and item_list_name - These link the selection back to the view_item_list event, enabling list-to-product click-through rate analysis
  • Include the item's index - Track which list position was clicked to analyze whether products at the top of lists get disproportionately more clicks (position bias)
  • Send exactly one item - This event represents a single product selection. The API will reject requests with 0 or more than 1 item.
  • Use consistent item_id - Match the item_id used in view_item_list, product.view, and product.addToCart for cross-event funnel analysis
  • Link to browser session - Pass SDK cookie values (vt_vid, vt_sid) to connect catalog selections with visitor profiles and browsing sessions
  • Send it from one side only - the browser SDK or your backend, never both for the same click, or list click-through rate is inflated.