1. Functions

entityView

Version:
TypeFunction
Import path@sitecore-cloudsdk/search/browser

Sends an entity view event.

Signature

export async function entityView(
  entityViewEventParams: EntityViewEventParams
): Promise<EPResponse | null>

Parameters

NameTypeDescription
entityViewEventParamsEntityViewEventParamsData for entity page view events.

Return value

Returns a promise.

Examples

Example 73. Running the entityView function

Note

To run this function, you have to first initialize the Cloud SDK.

See more examples and other data you can include in the event.

Here's an example of how to use the entityView function:

import { entityView } from "@sitecore-cloudsdk/search/browser";
import type { EntityViewEventParams } from "@sitecore-cloudsdk/search/browser";

const eventParams: EntityViewEventParams = {
  entity: { entity: "product", id: "1" },
  pathname: "/detail-page/1"
};

entityView(eventParams);

:::

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