Hi @petskratt, in the end we did not need a solution because the requirements in the project changed. But the solution described above which should work according to wpdreams was to implement Google Analytics without Tag Manager so that Ajax Search Lite has access to the ga/gtag functions as needed. We did not test that though, because of the changes in the project.
Another workaround considered was that you can filter for searches via Ajax Search Lite in Analytics since each search generates a distinctive URL including the string “?s=”. With this knowledge you can go to Behaviour/Website Content/All Pages in Analytics and inpu ?s= in the search box to see the searches.
Hope this helps!