hi, the task is simple - throw it away
\<\script\>console.log('hello world'); \<\/script\>\ into the page when the OnPageStart event occurs. How to do it right?
Tried something like \ Bitrix \ Main \ Page \ Asset :: getInstance () -> addString ('' ... '', true);
But such a disgrace is simply throwing code into the page, and it can be anywhere. For example, before <html></html>
This method also failit when I try to draw conclusions on some sales events. Due to the peculiarity of the work (the first hit on placing the order, then redirecting to the OK page for approval / payment) - the output to the page simply does not occur.
The question is how to do it right?