Using the HTML and JavaScript webparts does NOT render any additional div tags so you must have something coded or setup to wrap them with a div tag. I'm guessing your ZoneContent
zone has a div wrapper in the layout. NOTE modifying the /CMSPages/PortalTemplate.aspx
file will cause breaking changes for future upgrades. Also note, you are not able to modify it from the Kentico Admin UI.
What I would do is modify your master page template's layout and place it in the layout at the very top of the layout. I've installed several GTM codes and have had no problem with this approach or using a JavaScript webpart.