Skip to main content

user_events

Creates, updates, deletes, gets or lists a user_events resource.

Overview

Nameuser_events
TypeResource
Idgoogle.retail.user_events

Fields

The following fields are returned by SELECT queries:

SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_catalogs_user_events_writeexecprojectsId, locationsId, catalogsIdwriteAsyncWrites a single user event.
projects_locations_catalogs_user_events_collectexecprojectsId, locationsId, catalogsIdWrites a single user event from the browser. For larger user event payload over 16 KB, the POST method should be used instead, otherwise a 400 Bad Request error is returned. This method is used only by the Retail API JavaScript pixel and Google Tag Manager. Users should not call this method directly.
projects_locations_catalogs_user_events_purgeexecprojectsId, locationsId, catalogsIdDeletes permanently all user events specified by the filter provided. Depending on the number of events specified by the filter, this operation could take hours or days to complete. To test a filter, use the list command first.
projects_locations_catalogs_user_events_importexecprojectsId, locationsId, catalogsIdBulk import of User events. Request processing might be synchronous. Events that already exist are skipped. Use this method for backfilling historical user events. Operation.response is of type ImportResponse. Note that it is possible for a subset of the items to be successfully inserted. Operation.metadata is of type ImportMetadata.
projects_locations_catalogs_user_events_rejoinexecprojectsId, locationsId, catalogsIdStarts a user-event rejoin operation with latest product catalog. Events are not annotated with detailed product information for products that are missing from the catalog when the user event is ingested. These events are stored as unjoined events with limited usage on training and serving. You can use this method to start a join operation on specified events with the latest version of product catalog. You can also use this method to correct events joined with the wrong product catalog. A rejoin operation can take hours or days to complete.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
catalogsIdstring
locationsIdstring
projectsIdstring
writeAsyncboolean

Lifecycle Methods

Writes a single user event.

EXEC google.retail.user_events.projects_locations_catalogs_user_events_write 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@catalogsId='{{ catalogsId }}' --required,
@writeAsync={{ writeAsync }}
@@json=
'{
"eventType": "{{ eventType }}",
"visitorId": "{{ visitorId }}",
"sessionId": "{{ sessionId }}",
"eventTime": "{{ eventTime }}",
"experimentIds": "{{ experimentIds }}",
"attributionToken": "{{ attributionToken }}",
"productDetails": "{{ productDetails }}",
"completionDetail": "{{ completionDetail }}",
"attributes": "{{ attributes }}",
"cartId": "{{ cartId }}",
"purchaseTransaction": "{{ purchaseTransaction }}",
"searchQuery": "{{ searchQuery }}",
"filter": "{{ filter }}",
"orderBy": "{{ orderBy }}",
"offset": {{ offset }},
"pageCategories": "{{ pageCategories }}",
"userInfo": "{{ userInfo }}",
"uri": "{{ uri }}",
"referrerUri": "{{ referrerUri }}",
"pageViewId": "{{ pageViewId }}",
"entity": "{{ entity }}",
"panels": "{{ panels }}"
}';