How to place Google Tag Manager code within <body> tag?


We have successfully placed ‘Google Tag Manager’ code within < head> tag. Can anyone please guide us how to place ‘Google Tag Manager’ code within < body> tag?

Thanks & Regards,

Hi @skghosh

Do you need to insert custom HTML or Javascript code (or something else?)
Also, what OJS version are you using?

Hello @Vitaliy , This is a Javascript code and the OJS version is

If you want to inject a script tag within the body, it is probably going to be outputting HTML for display. Otherwise, you could just inject it into the head as well. If you want it to display somewhere, where exactly do you want it to appear. OJS 2.x supports numerous template hooks which can be used to target specific elements. Another common use case is to place code in a block, and then place the block within the sidebar.

@ctgraham @Vitaliy

The Google Tag Manager needs to insert two codes one is above the header and one is below the body tag.

Install Google Tag Manager
Copy the code below and paste it onto every page of your website.
Paste this code as high in the **<head>** of the page as possible:

<!-- Google Tag Manager -->
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
<!-- End Google Tag Manager -->

Additionally, paste this code immediately after the opening **<body>** tag:

<!-- Google Tag Manager (noscript) -->
<noscript><iframe src="'----------------Removed------------'"
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->

It is required to insert both codes to run Google Tag Manager properly. I successfully placed 1st code help of Custom Header Plugin. Please help with the second code.
I am using: OJS