Archived topic
Where in the admin to enter Google Tracking Codes
3 replies · Started by Vladimir on November 10, 2022
Hi,
On your theme READ, is there in admin designated area to copy and paste Google Tracking codes. Designated areas should place Google Tag Manager code into the <head> and another one should place code immediately after the opening <body> tag. I am trying to avoid having to go into the theme code to do this and I hope you have build admin interface for it. The website i am working on is mtelblog.ba
Below are two code types I want to place into the website.
Paste this code as high in the <head> of the page as possible:
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id='+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,'script','dataLayer','GTM-WL6Q6XL');</script>
<!-- End Google Tag Manager -->
Additionally, paste this code immediately after the opening <body> tag:
<!-- Google Tag Manager (noscript) -->
<noscript><iframe src=https://www.googletagmanager.com/ns.html?id=GTM-WL6Q6XL
height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>
<!-- End Google Tag Manager (noscript) -->
Hi Vlad,
You can use a Hook Element to inject Google Tag Manager codes into your site.
Here's an article you may refer to for assistance: https://docs.generatepress.com/article/implement-google-tag-manager/
Worked well. Closing ticket.
Glad that worked! You're welcome Vlad!