Question about IDs and click through stats

My current implementation of Algolia is such that when I create a new blog post, I clear the entire index and batch upload all my posts. That worked fine until I added click through tracking. I then noticed a problem in my implementation. I never assigned IDs to my objects so whenever I cleared and re-added, my objects got all new IDs.

So my question is this. If I define a standard way to assign IDs to my data, and I still clear and batch add, will click through stats work correctly? So in other words, I record a click on a search result of object ID X. Later, I delete all objects and re-add them, and the same object has an ID of X. Will my stats for clickthroughs work ok? Or will clearing the objects also clear stats?

Hi @raymondcamden, Clearing the objects should not clear the stats. If you provide an objectID when you import your data, that objectID will be used instead of creating a new one for you. So, assigning objectIDs should resolve your issue.

Thank you so much! I must have disabled notifications and I thought no one had answered due to the holidays. Thank you!