How to trigger an analytic when component gets re-rendered?

I need to trigger an analytic when a component gets re-rendered because someones searches in the search bar. When someone searches, the component LibraryManager gets re-rendered to address that search value. I need to trigger an analytic when that component gets re-rendered. The best way to trigger that analytic is in the render function but I’m told not to add the trigger to the render function because of side effects. Is there another function I can use to add the analytics trigger in lit?