When I place google tag manager script
in the head part of my website as strongly recommended by google;
the script basically delays the onload event causing to increase the Time To Interact of the page.
I had a work around for this issue by injecting the script after a time of 3000 ms using setTimeout() function
.
This has improved the performance of the website drastically.
But this is not recommended by the Google
.
Since I know there is a problem with the gtm script. Is there a workaround?