生成GTM脚本的PHP cronjob

I am having problems with my session library that's why sometimes I am losing data on my thank-you page. As a result of this, I can't send data to GTM (dataLayer.push) on thank-you page because of missing data.

To avoid missing data on GTM, I decided to write a cronjob which will detect the missing ones from database and send them to GTM programmatically each 15 minutes.

After investigating, I found this :
https://github.com/antoniotajuelo/google-tag-manager-php a library to send data to GTM. It is generating/outputting GTM container, scripts, push object, etc...

I wrote the method by using that library, It is working well when I call it on browser like "https://example.com/my-method". When I check source code of page, I see that It is rendering Google Tag Manager container, datalayer, scripts, push, etc...

After all, I added it as a cron on server level:
*/15 * * * * /usr/bin/curl -k 'https://example.com/my-method' >/dev/null 2>&1

I thought It will work well but It is not. Js is only working on browser side, not on server side. Is there a way to make it work on server level (rendered scripts, etc...)?