So I did a little more testing, and my original technique as written will not work with Entry Archives. But, with one minor change to the Header template module, things will work just fine.
The default Header template module includes the following bits for the body tag:
<body class="<MTIf name="body_class"><$MTGetVar name="body_class"$> </MTIf><$MTGetVar name="page_layout" default="layout-wtt"$>"<MTIf name="body_onload"> onload="<$MTGetVar name="body_onload"$>"</MTIf>>
Since it specifies the onload property in there, it conflicts with the javascript code that performs the search for google visitors, so I changed it to look like the following:
TC.attachLoadEvent (checkReferer);
<MTIf name="body_onload">TC.attachLoadEvent (function () { <$MTGetVar name="body_onload"$> } );</MTIf>
</script>
</head>
<body class="<MTIf name="body_class"><$MTGetVar name="body_class"$> </MTIf><$MTGetVar name="page_layout" default="layout-wtt"$>">
Pulling the onload code out of the body tag and putting it into an anonymous function seems to do the trick for me.
Enjoy!
Leave a comment