Site logo

Archived topic

taboola ads not showing up

3 replies · Started by Taehyun on January 18, 2023

Viewing posts 1–4 of 4

Hello, I have added taboola ads codes in my website "funnyissue.com"

I have put the code below in <head>

<script type="text/javascript">
window._taboola = window._taboola || [];
_taboola.push({article:'auto'});
!function (e, f, u, i) {
if (!document.getElementById(i)){
e.async = 1;
e.src = u;
e.id = i;
f.parentNode.insertBefore(e, f);
}
}(document.createElement('script'),
document.getElementsByTagName('script')[0],
'//cdn.taboola.com/libtrc/mugtimes-funnyissuecom/loader.js',
'tb_loader_script');
if(window.performance && typeof window.performance.mark == 'function')
{window.performance.mark('tbl_ic');}
</script>

and the code below in <body>

<script type="text/javascript">
window._taboola = window._taboola || [];
_taboola.push({flush: true});
</script>

And finally the code below in footer widget

<div id="taboola-alternating-thumbnails-a"></div>
<script type="text/javascript">
window._taboola = window._taboola || [];
_taboola.push({
mode: 'alternating-thumbnails-a',
container: 'taboola-alternating-thumbnails-a',
placement: 'Below Article Thumbnails ',
target_type: 'mix'
});
</script>

However, the taboola ad, which is supposed to appear as infinite feed below articles or pages, don't show up.
When checking my website in DevTools(F12), I can still see the code in the footer widget, but it is not appearing.

I have applied the taboola ad code in one of my other website "mugtimes.com", which is using newspaper theme, and it works fine.

I tried to solve this issue, but I can't find out what the problem is.
Could you please help me out with this issue?

Thanks.

Hi Taehyun,

Yes, we can try to help.

For reference, how are you specifically adding these codes at the moment?

I have added the codes in <head> and <body> by using 'WPCode Lite' plugin, which helps me to insert scripts to the header and footer.

And I have put
`

<script type="text/javascript">
window._taboola = window._taboola || [];
_taboola.push({
mode: 'alternating-thumbnails-a',
container: 'taboola-alternating-thumbnails-a',
placement: 'Below Article Thumbnails ',
target_type: 'mix'
});
</script>'
code in the footer widget 1 by [Appearance] > [customize] > [Widgets] > [Footer Widget 1]

I see.

Can you try using a Hook Element instead? Reference: https://docs.generatepress.com/article/hooks-element-overview/

For the head code, set the hook to wp_head.

For the body code, set the hook to wp_body_open.

For the footer code, set the hook to wp_footer.

You'll need to have 3 Hook Elements for each code.

Let us know how it goes.

This archived topic is closed to new replies.