Hey all, I am trying to add some <script>...</script>
code directly beneath the </head>
tag. Any suggestions please?
Specifically, I am trying to add Facebook Pixel Event code, and it’s required that this code goes just below the </head>
tag: https://developers.facebook.com/docs/ads-for-websites/pixel-events#setup
Thanks!
Does adding an HTML block as the first item on the page work? That way it would be directly below the /head.
Thanks @cowontherun - however, if you add an element there, it actually appears in the <body>
after several lines of other bubble code
(please see section highlighted below):
Are you sure it’s supposed to be below the head? Normally they go in the head as states here:
In fact on the page you link to it states “In the page’s HTML, add the code to your website pages before the ending /head tag”
So all you need to do is go to Settings > SEO tab and add it there.
jarrad
October 4, 2017, 1:47pm
5
var getUpThere;
getUpThere = $('<script id="PlugBubble"></script>');
$('head').first().append(getUpThere);
jarrad
October 4, 2017, 1:49pm
7
var getUpThere;
getUpThere = $('<script id="PlugBubble"></script>');
$('body').first().prepend(getUpThere);
1 Like
Thanks @jarrad I’ll try that out.
I am also experimenting with loading the FB code via Google Tag Manager, which seems to work really well too.
yon
September 7, 2018, 7:05am
9
Hi Jarrad, Im having the same problem with the facebook pixel events. Where would you place this code to be able to insert the script right beneath the body?