It looks like your implementation simply appends event15 and event43 to the s.events string, regardless of what is in that string already, e.g.
s.events = (s.events ? ',' : '') + 'event15,event43';
A better option is to use the "apl" plugin. Reference: https://experienceleague.adobe.com/docs/analyti...