I’m setting up view-item events using the Node.js UserEventServiceClient (instead of the pixel).
search, view-item, and view-home-page events all write successfully.
At first, analytics in the AI Applications app view weren’t populating. I fixed search events by including the engine parameter since an app is also an engine, this made sense: without it, events only go to the DataStore.
Docs say a successful request returns a copy of the event.
With view-item events, even when I send the same engine, the write succeeds, the response returns the event, but engine is missing. I suspect this is why app analytics shows no CTR or page view metrics. It’s not a 24-hour delay issue; I’ve been testing for a week.
Has anyone successfully sent view-item events via the service client and seen CTR or page view metrics populate in App Analytics? Am I doing something wrong ?
Here is what my request looks like, I send the parent as well formatted as
projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store} since I’m not working with a blended app.
{
eventType: 'view-item',
pageInfo: {
pageviewId: 'string',
uri: 'string,
referrerUri: 'string',
pageCategory: 'string'
},
engine: 'string',
attributionToken: 'string',
documents: [ { id: 'string' } ],
userPseudoId: 'string',
userInfo: {
userId: 'string'
},
eventTime: { seconds: number, nanos: number }
}
And this is the response
HTTP Response: {
success: true,
status: 'Event processed by Google Cloud Discovery Engine',
responseData: {
documents: [ [Object] ],
tagIds: [],
promotionIds: [],
panels: [],
attributes: {},
eventType: 'view-item',
userPseudoId: 'string',
eventTime: { seconds: 'string', nanos: number },
userInfo: {
userId: 'string'
},
directUserRequest: false,
pageInfo: {
pageviewId: 'string',
pageCategory: 'string',
uri: 'string',
referrerUri: 'string'
},
attributionToken: 'string',
searchInfo: null
},
metadata: null
}