Adding Google Tag Manager to Service Portal

PranavSuj96
Mega Expert

Hi all,

I was given instructions to post the code below on every page of the website (service portal). However when I look at the pages there is only options to style css, but no html section. How would I do this:

INSTRUCTIONS:

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 -->

<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-NLLDWBR');</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-NLLDWBR"

height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript>

<!-- End Google Tag Manager (noscript) -->

 

Thanks

Pranav

4 REPLIES 4

nathanfirth
Tera Guru

You would add the HTML to the Header or Footer widgets configured on the Theme. 

The header and footer are the only widgets that will persist from page to page.

Hope that helps,

-----------------
Nathan Firth
Founder and ServiceNow Architect
NewRocket, Inc.
nathan.firth@newrocket.com
http://serviceportal.io
http://newrocket.com

Bharat23
Kilo Guru

Hi Pranav,

Did you figure out where to put these code snippets and in order to make them work?

Anusha Reddy1
Giga Expert

Hello,

Did you figure out where to put these code snippets and in order to make them work?

rafael_merces2
Tera Guru

Pranav, have you ever found a solution for this?