Add script in header

Posted in: Newspaper
Post count: 37

Hi,

I have a advertising company that I have settled an agreement to show ads on my page.

I have got a script code from them that should be placed between <head> and </head>

I tried both to implement the code in header.php and in the themes specificed custom code – script function.

None of the solutions work. Any tips where i Should impelement the code?

CODE:

<script>
var unruly = window.unruly || {};
unruly.native = unruly.native || {};
unruly.native.siteId = ********
</script>
<script src=”//video.unrulymedia.com/native/native-loader.js”></script>

Post count: 20685

Hi,

If the code needs to be added between the head tags, you must enter it in the header.php file found in the main theme folder – https://www.screencast.com/t/pJLx76GibF and if the code is valid it should work as intended. Try clearing any caching installed after you add the code.

Thanks

Post count: 37

Hi Simion,

Like this right?

Code

Its not working and the company tells me it looks just like it should, and that this method is working for theyre other customers.

Post count: 20685

Hi,

Well it should work if the code is valid, there should be no reason for it not to, if the only requirement is to insert the code in the header. Try clearing any caching you have installed, maybe it is preventing the code from taking effect.

Thanks

Post count: 37

It startet working after i cleared cache – thanks 🙂

  • This reply was modified 9 years by eivindert.
Viewing 5 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic.