> ## Documentation Index
> Fetch the complete documentation index at: https://doc.lucidworks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Beacon configuration interface

export const LwTemplate = ({title = "Key questions to get you started", icon = "sparkles", cta = "Powered by Agent Studio", linkHref = "https://lucidworks.com/demo/?utm_source=docs&utm_medium=referral&utm_campaign=docs_cta_ai"}) => {
  const [isLoaded, setIsLoaded] = useState(false);
  useEffect(() => {
    const timer = setTimeout(() => {
      setIsLoaded(true);
    }, 500);
    return () => clearTimeout(timer);
  }, []);
  return <div className="lw-template-container">
      <Card title={title} icon={icon}>
        {isLoaded && <span dangerouslySetInnerHTML={{
    __html: `<lw-template id="a029c1a9-28be-427e-b0e1-5d918920246a"></lw-template
            >`
  }} />}
        <Link href={linkHref} className="agent-studio-link text-left text-gray-600 gap-2 dark:text-gray-400 text-sm font-medium flex flex-row items-center hover:text-primary dark:hover:text-primary-light group-hover:text-primary group-hover:dark:text-primary-light">Powered by Lucidworks Agent Studio</Link>
      </Card>
    </div>;
};

[localhost link]: http://localhost:3000/docs/lw-platform/lw-analytics/signals/beacon-configuration-interface

[mintlify link]: https://doc.lucidworks.com/docs/lw-platform/lw-analytics/signals/beacon-configuration-interface

[old doc.lw link]: https://doc.lucidworks.com/lw-platform/analytics/k6vyeq

This topic details the `BeaconConfig` interface, including related interfaces, types, and default values.

For more information about the script to paste into the `<head>` tag of your website’s HTML file and the JSON configuration, see [Signals Beacon](/docs/lw-platform/lw-analytics/signals/signals-beacon).

<LwTemplate />

## BeaconConfig

This object details the primary configuration interface for the signals beacon.

<ResponseField name="BeaconConfig" type="object">
  <ResponseField name="type" type="SignalAppType" default="Retail">
    The beacon supports both Retail signals and legacy site search signals.
  </ResponseField>

  <ResponseField name="attributes" type="BeaconAttributes">
    This attribute specifies a global configuration that will be inherited by each explicit action configuration for the beacon signals.

    <Expandable title="actions">
      <ResponseField name="query" type="BeaconQueryProps">
        Configuration for query signals.
      </ResponseField>

      <ResponseField name="click" type="BeaconClickProps">
        Configuration for click signals.
      </ResponseField>

      <ResponseField name="cartAdd" type="BeaconCartAddProps">
        Configuration for add-to-cart signals.
      </ResponseField>

      <ResponseField name="purchase" type="BeaconPurchaseProps">
        Configuration for purchase complete signals.
      </ResponseField>
    </Expandable>
  </ResponseField>

  <ResponseField name="fields" type="{ [field: string]: BeaconFieldConfig }" default=":scope @id">
    The main section for extracting product field values from your site.
  </ResponseField>

  <ResponseField name="query" type="BeaconQueryProps">
    This specifies how beacon signals should be handled when the main product page is searched.
  </ResponseField>

  <ResponseField name="click" type="BeaconClickProps">
    The configuration for beacon signals sent when a product is clicked.
  </ResponseField>

  <ResponseField name="cartAdd" type="BeaconCartAddProps">
    The configuration for beacon signals sent when a product is added to the shopping cart or bag.
  </ResponseField>

  <ResponseField name="purchase" type="BeaconPurchaseProps">
    The configuration for beacon signals sent when the user proceeds to the checkout phase on your site.
  </ResponseField>
</ResponseField>

## BeaconFieldConfig

This is a type alias for field configuration. The value can be a string, or a `BeaconFieldRichConfig` object.

## BeaconFieldRichConfig

This object details the interface to fine tune field details.

<ResponseField name="BeaconFieldConfig" type="object">
  <ResponseField name="path" type="string">
    This is the field value path.
  </ResponseField>

  <ResponseField name="exclude" type="string">
    This string is excluded from the raw value.
  </ResponseField>

  <ResponseField name="type" type="string" default="string">
    This property provides additional typing information that allows for proper transformation of the value.
  </ResponseField>
</ResponseField>

## BeaconAttributes

This object details the interface for the global configuration inherited by each action configuration.

<ResponseField name="BeaconAttributes" type="object">
  <ResponseField name="idQueryParam" type="string" default="pid">
    The URL query parameter used to get the product ID from the product page.
  </ResponseField>

  <ResponseField name="cartId" type="string" default="lwRetailCartId">
    The local storage key for the consumer page storing the cart UUID.
  </ResponseField>

  <ResponseField name="productPath" type="string" default=".lw-product-item">
    The CSS selector for targeting product elements. This is the global path inherited by each signal action.
  </ResponseField>

  <ResponseField name="sessionTimeoutThreshold" type="number" default="2400000">
    Optional inactivity threshold in milliseconds that ends a session and starts a new one. The default is 2400000 ms (40 minutes).
  </ResponseField>

  <ResponseField name="numberTypeFields" type="string[]" default="[price, quantity, revenue]">
    This specifies the fields that are treated as number type fields.
  </ResponseField>

  <ResponseField name="data" type="string">
    This provides a more advanced way to obtain product details using serialized JSON in an element attribute.
  </ResponseField>
</ResponseField>

## BeaconSignalProps

This object details the interface that provides common properties for beacon signals.

<ResponseField name="BeaconSignalProps" type="object">
  <ResponseField name="productPath" type="string">
    The custom selector to target product elements specific to particular retail actions. The action values are query, click, cartAdd, and purchase.
  </ResponseField>

  <ResponseField name="fields" type="{ [field: string]: BeaconFieldRichConfig }">
    The main section for extracting product field values from your site.
  </ResponseField>
</ResponseField>

## BeaconQueryProps

This object details the interface for configuring beacon signals sent during a product search.

<ResponseField name="BeaconQueryProps" type="object">
  <ResponseField name="QueryParam" type="string" default="query">
    The URL query parameter the beacon uses to monitor query updates.
  </ResponseField>

  <ResponseField name="trigger" type="string">
    The CSS selector for targeting multiple page elements related to product query activities. The beacon analyzes the comma-separated elements, monitors when the 'Enter' key is pressed on the input element as well as clicks on the remaining elements, then sends query signals accordingly.

    In addition, the beacon supports the ability to track the 'Enter' key along with clicks on the search button for scenarios where there is no query parameter if the `trigger` property is used. For example, the main search flow could use the query parameter `q` while the search within the search uses the beacon properties to record both the input and the search button clicks. An example configuration is:

    ```"query": { theme={"dark"}
      "queryParam": "q",
      "trigger": ".search-box input, .search-box .btn"
    }
    ```
  </ResponseField>

  <ResponseField name="delayForTrackQueryUpdate" type="number" default="1000">
    This specifies the delay, in milliseconds, for tracking element updates in the query.
  </ResponseField>
</ResponseField>

## BeaconClickProps

This object details the interface for configuring beacon signals when the user clicks a product.

<ResponseField name="BeaconClickProps" type="object">
  <ResponseField name="productPath" type="string">
    The custom selector to target product elements specific to particular retail actions. The action values are query, click, cartAdd, and purchase.
  </ResponseField>

  <ResponseField name="fields" type="{ [field: string]: BeaconFieldRichConfig }">
    The main section for extracting product field values from your site.
  </ResponseField>
</ResponseField>

## BeaconCartAddProps

This object details the interface for configuring beacon signals sent when a product is added to the shopping cart or bag.

<ResponseField name="BeaconCartAddProps" type="object">
  <ResponseField name="productPath" type="string">
    The custom selector to target product elements specific to particular retail actions. The action values are query, click, cartAdd, and purchase.
  </ResponseField>

  <ResponseField name="fields" type="{ [field: string]: BeaconFieldRichConfig }">
    The main section for extracting product field values from your site.
  </ResponseField>

  <ResponseField name="trigger" type="string">
    The CSS selector for targeting multiple page elements related to trigger add-to-cart actions.
  </ResponseField>
</ResponseField>

## BeaconPurchaseProps

This object details the interface for configuring beacon signals sent when the user proceeds to the checkout phase of the transaction.

<ResponseField name="BeaconPurchaseProps" type="object">
  <ResponseField name="productPath" type="string">
    The custom selector to target product elements specific to particular retail actions. The action values are query, click, cartAdd, and purchase.
  </ResponseField>

  <ResponseField name="fields" type="{ [field: string]: BeaconFieldRichConfig }">
    The main section for extracting product field values from your site.
  </ResponseField>

  <ResponseField name="trigger" type="string">
    The CSS selector for targeting multiple page elements related to trigger purchase or checkout actions.
  </ResponseField>

  <ResponseField name="revenue" type="string">
    The path to the element that displays the total sum of the items in the cart.
  </ResponseField>
</ResponseField>
