1. Events

SC_SEARCH_WIDGET_VIEW events

Version:

The SC_SEARCH_WIDGET_VIEW event tracks when the site visitor views a Sitecore Search widget in your app. This event only triggers when non-empty widgets are viewed. You can set up this event when you're implementing a Sitecore Search widget.

You can send SC_SEARCH_WIDGET_VIEW events by using the event function and passing it the event data object.

The event data object

The event data object represents all the required and optional data about the event.

This is the object where you provide data about the event. All this data is sent to Sitecore, so make sure to provide the correct data depending on your organization's requirements. Construct the object in the following way:

Examples

Tip

During development, use your web browser's developer tools to check the payload containing all the event data that is sent to Sitecore.

Example 10. Sending an SC_SEARCH_WIDGET_VIEW event

Here's an example event data object for a SC_SEARCH_WIDGET_VIEW event:

You can send this event by passing the object to the event function:

For this event data object, the following payload is sent to Sitecore:

{
  "browser_id": "a38b230c-11eb-4cf9-8d5d-274e9f344925​",
  "client_key": "",
  "pos": "",
  "requested_at": "2025-08-29T12:13:28.417Z",
  "sc_search": {
    "metadata": {
      "ut_api_version": "1.0"
    },
    "data": {
      "value": {
        "rfk_id": "rfkid_7",
        "request": {
          "keyword": "SitecoreAI",
          "page_size": 9
        },
        "context": {
          "page": {
            "uri": "https://www.sitecore.com/search?phrase=XM+Cloud"
          }
        },
        "entities": [
          {
            "id": "https___www_sitecore_com_products_xm-cloud",
            "entity_type": "content",
            "entity_subtype": "Products"
          },
          {
            "id": "https___www_sitecore_com_partners_solution-catalog_americaneaglemigrationaccelerator",
            "entity_type": "content",
            "entity_subtype": "Partner Solution"
          },
          {
            "id": "https___www_sitecore_com_partners_solution-catalog_perficient-xmcloud-jumpstart",
            "entity_type": "content",
            "entity_subtype": "Partner Solution"
          },
          {
            "id": "https___www_sitecore_com_knowledge-center_digital-marketing-resources_migrating-to-xm-cloud",
            "entity_type": "content",
            "entity_subtype": "Knowledge Center"
          },
          {
            "id": "https___www_sitecore_com_partners_solution-catalog_sai-digital-catalyzer-loyalty",
            "entity_type": "content",
            "entity_subtype": "Partner Solution"
          },
          {
            "id": "https___www_sitecore_com_partners_solution-catalog_altudo-composable-commerce-accelerator",
            "entity_type": "content",
            "entity_subtype": "Partner Solution"
          },
          {
            "id": "https___www_sitecore_com_partners_solution-catalog_espire-xm-cloud-accelerator",
            "entity_type": "content",
            "entity_subtype": "Partner Solution"
          },
          {
            "id": "https___www_sitecore_com_partners_solution-catalog_altudo-xm-cloud-accelerator",
            "entity_type": "content",
            "entity_subtype": "Partner Solution"
          },
          {
            "id": "https___www_sitecore_com_partners_solution-catalog_altudo-xm-cloud-workshop",
            "entity_type": "content",
            "entity_subtype": "Partner Solution"
          }
        ]
      }
    }
  },
  "type": "SC_SEARCH_WIDGET_VIEW"
}


If you have suggestions for improving this article, let us know!