Home > widget-integration > FilterAPI > addCustomerParams

FilterAPI.addCustomerParams() method

Adds customer identification and session tracking parameters to API request.

Includes customer ID (if logged in) and marks the request as not a first load. The API uses customer ID for personalization. Override to add custom customer attributes or implement shop-specific customer tracking.

Signature:

protected addCustomerParams(params: FilterAPIParams): FilterAPIParams;

Parameters

Parameter

Type

Description

params

FilterAPIParams

Current filter parameters being built

Returns:

FilterAPIParams

Enhanced parameters with first_load flag and customer_id if available

Remarks

Customer Tracking: - first_load is always false (initial load handled separately) - customer_id is undefined for guest users - Customer ID is used for personalized recommendations and pricing

Example

Override to add customer segment information:

window.boostWidgetIntegration.extend('FilterAPI', (FilterAPI) => {
  return class CustomFilterAPI extends FilterAPI {
    protected addCustomerParams(params) {
      const enhanced = super.addCustomerParams(params);
      // Add customer segment for targeted filtering
      const customer = this.getCustomerData();
      if (customer) {
        enhanced.customer_segment = customer.tags?.includes('vip') ? 'vip' : 'standard';
        enhanced.customer_lifetime_value = customer.totalSpent || 0;
      }
      return enhanced;
    }
  };
});