Insert script on the header of my site
-
hi, how can I add a script in html on my website’s header?It’s fo addign cookies aceptation.
The blog I need help with is: (visible only to logged in users)
-
hi, how can I add a script in html on my website’s header?It’s fo addign cookies aceptation.
-
https://www.googletagmanager.com/gtag/js?id=UA-122953694-1
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());gtag(‘config’, ‘UA-122953694-1’);
-
Hi there,
Scripts and other code is not allowed on WordPress.com for security reasons and you can read more about it here:
However, WordPress.com already displays a cookie banner at the bottom of each site and there’s no need for extra coding:
-
-
<!-- Google Tag Manager --> (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-T2ZL4C8'); <!-- End Google Tag Manager -->
-
-
If you’d like to modify a copy of WordPress you can do that by managing your own installation at another host: https://get.wp.com
Also if you’ll let us know what you’re trying to do with this script, we could look for other alternatives.
-
<!– Global site tag (gtag.js) – Google Analytics –>
https://www.googletagmanager.com/gtag/js?id=UA-124538125-1window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag(‘js’, new Date());gtag(‘config’, ‘UA-124538125-1’);
- The topic ‘Insert script on the header of my site’ is closed to new replies.