[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-09-05。"],[[["\u003cp\u003eThis page provides instructions on how to view and analyze recorded user event data within the Google Cloud console.\u003c/p\u003e\n"],["\u003cp\u003eUser event information, including event counts, changes over time, and metrics for each event type, can be found on the \u003cstrong\u003eEvents\u003c/strong\u003e tab of your app's \u003cstrong\u003eData\u003c/strong\u003e page.\u003c/p\u003e\n"],["\u003cp\u003eYou can use the \u003ccode\u003euserEvents.purge\u003c/code\u003e API method to remove user events that were not recorded correctly.\u003c/p\u003e\n"],["\u003cp\u003eUser event filtering, based on fields such as \u003ccode\u003eeventTime\u003c/code\u003e, \u003ccode\u003eeventType\u003c/code\u003e, \u003ccode\u003evisitorID\u003c/code\u003e, and \u003ccode\u003euserID\u003c/code\u003e, is possible when purging events to identify exactly which events to delete.\u003c/p\u003e\n"],["\u003cp\u003eThe date and time format when filtering events must use the \u003ca href=\"https://www.ietf.org/rfc/rfc3339.txt\"\u003eZulu Time date format\u003c/a\u003e when purging.\u003c/p\u003e\n"]]],[],null,["# Manage user events\n\nThis page describes how to view user event information and purge user events.\n\nTo record user events as they happen, see\n[Record real-time user events](/generative-ai-app-builder/docs/record-user-events). To import user event data from\npast events, see [Import historical user events](/generative-ai-app-builder/docs/import-user-events).\n\nView aggregated user event information\n--------------------------------------\n\nYou can see information about recorded user events for your app in the\nGoogle Cloud console on the **Events** tab of your app's **Data** page.\n\nThis page shows information such as number of events ingested, number of\nunjoined events, percentage change in number of events over a period, and\naverage count of event type per document. In addition, you can see metrics for\neach event type over time. Metrics appear about 24 hours after you first upload\nevents.\n\nTo see your user event information:\n\n1. In the Google Cloud console, go to the **AI Applications** page.\n\n [AI Applications](https://console.cloud.google.com/gen-app-builder/start)\n2. Click the name of the app that you want to see user event information for.\n\n3. On the **Data** page, go to the **Events** tab. User event information is\n displayed on this tab.\n\nPurge user events\n-----------------\n\nIf you have user events that were not recorded correctly and need to remove\nthem, you can do so using the [`userEvents.purge`](/generative-ai-app-builder/docs/reference/rest/v1/projects.locations.dataStores.userEvents/purge) API method.\n\nSpecify the events you want to remove by using a [user event filter](#filter).\nYou can use the user event filter to specify the events that you want to purge.\nYou can filter with the `eventTime`, `eventType`, `visitorID`, and `userID`\nfields.\n\nThis example filters for a time range, which must use the\n[Zulu Time date format](https://www.ietf.org/rfc/rfc3339.txt). \n\n```bash\ncurl -X POST \\\n -H \"Authorization: Bearer \"$(gcloud auth application-default print-access-token)\"\" \\\n -H \"Content-Type: application/json; charset=utf-8\" \\\n --data '{\n \"filter\":\"eventTime \u003e \\\"2023-12-21T18:25:43.511Z\\\" eventTime \u003c \\\"2023-12-21T18:30:43.511Z\\\"\",\n }' \\\n \"https://discoveryengine.googleapis.com/v1/projects/\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e/locations/global/dataStores/\u003cvar translate=\"no\"\u003eDATA_STORE_ID\u003c/var\u003e/userEvents:purge\"\n```\n\nYou should receive a response object similar to the following, where\n`purge-user-events-54321` is the operation ID: \n\n```bash\n{\n \"name\": \"projects/\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e/locations/global/catalogs/default_catalog/operations/purge-user-events-54321\"\n}\n```\n\nThis example requests the operation status: \n\n```bash\ncurl -H \"Authorization: Bearer $(gcloud auth application-default print-access-token)\" \\\n\"https://discoveryengine.googleapis.com/v1/projects/\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e/locations/global/dataStores/\u003cvar translate=\"no\"\u003eDATA_STORE_ID\u003c/var\u003e/operations/\u003cvar translate=\"no\"\u003eOPERATION_ID\u003c/var\u003e\"\n```\n\nOperation status example: \n\n```bash\n{\n \"name\": \"projects/\u003cvar translate=\"no\"\u003ePROJECT_NUMBER\u003c/var\u003e/locations/global/catalogs/default_catalog/operations/\u003cvar translate=\"no\"\u003eOPERATION_ID\u003c/var\u003e\",\n \"done\": true,\n \"response\": {\n \"@type\": \"type.googleapis.com/google.cloud.discoveryengine.v1.PurgeUserEventsResponse\"\n \"purgedEventsCount\": \"1\"\n }\n}\n```\n\n\u003cbr /\u003e\n\nUse the user event filter\n-------------------------\n\nYou can filter user events to be deleted.\n\nThe filter is a string that contains one or more of the following restrictions:\n\n- `eventTime`: Provides a timestamp to bound the events to be deleted. This\n filter can be specified once or twice, with a greater-than (`\u003e`) or less-than\n (`\u003c`) symbol. The bounded time must be a single contiguous block.\n\n- `eventType`: Restrict the events to be deleted to a single event type.\n\n- `visitorID`: Restrict the events to be deleted to a single visitor ID.\n\n- `userID`: Restrict the events to be deleted to a single user ID.\n\nOnly user events that satisfy all of the restrictions are deleted.\n\nFor example, to delete all user events of type `add-to-cart` that were logged\non or after February 1, 2023, you would provide the following filter string: \n\n```bash\neventTime \u003e \"2023-02-01T00:00:00Z\" eventType = add-to-cart\n```\n\nWhat's next\n-----------\n\n- [Record real-time user events](/generative-ai-app-builder/docs/record-user-events)\n- [Import historical user events](/generative-ai-app-builder/docs/import-user-events)."]]