Update:
i have changed the code event listener to templater_template_post_render
on PAGE_CONTAINER and check with preg_match_all $output the inserted code from the macros which i want to track the views of.
In the Listener i call my logView function in the repository, i did this like xenforo did, logThreadView function (Memory table).
What do you think, is this a good idea?