View Single Post
  #1  
Old 08-06-2016, 12:34 AM
 
paulmighty paulmighty is offline
 

Member
  
Join Date: Apr 2014
Posts: 11
 

Default Include GTM Script immediately after <body> tag?

Having a really tough go at getting my Google Tag Manager code to appear right after the <body> tag. I have the GTM being included in custom module, which is working great, except I can't get it to appear in the correct location. Google demands that the GTM script appear immediately after the <body> tag.

I am able to insert the script successfully into the <head> tag, but when I try to reconfigure to have it be included right after the opening <body> tag, I can never seem to get to it display before the <nav id="slider"> tag. Even when my GTM tpl has @ListChild (list="layout.slidebar", weight="5"), the <nav id="slider"> always appears first. When my GTM tpl has @ListChild (list="body", weight="5"), it also does not appear immediately after the <body> tag. I even tried setWeight(100) on 'XLite\View\Slidebar' in my runBuildCacheHandler, which changed the weight in the DB from 10 to 100, but didn't change the frontend hierarchy.

Any suggestion will be greatly appreciated. I'm running out of ideas :/

Thanks!
-Paul
__________________
X-Cart Version: 5.2
Reply With Quote