I am attempting to send a clickedObjectIDsAfterSearch click event to Algolia (I have sent other events successfully) and am receiviing a 422 error. I have tried this using JavaScript and PHP and get the same error. As far as I can tell I am coding this correctly as per https://www.algolia.com/doc/api-reference/api-methods/clicked-object-ids-after-search/. The error returned says “Invalid type for field events: expected string, got number”.
When I go to the Events Debugger in the Algolia Dashboard and click the errored event this is what I see:
{
"events": [
{
"eventType": "click",
"userToken": 20281,
"index": "my_index_name_here",
"eventName": "Dropdown: Product Clicked",
"queryID": "acf55d7618e1e98922028e8dc7c43e11",
"objectIDs": [
24729
],
"positions": [
6
]
}
]
}
So I can see why that error is returned. But as far as I can tell this is being coded correctly. I feel like I’m missing something obvious. If anyone can give me a pointer as to what I could be doing wrong that would be appreciated.