• Resolved vich11

    (@vich11)


    Today I’ve been trying to add code in Ad Inserter Pro but am having strange problems. When I add javascript, I can see what the code generates (in this case, a Taboola widget) on the site when I am logged into WordPress. But if I log out (like a regular visitor) the code and the widget do NOT appear.

    I have disabled all caching and this still is a problem.

    Also, as a test, I added an HTML comment in Ad Inserter pro (<!– example comment –>) and that worked absolutely fine and as expected. As another test, I removed some javascript that had been working on the site just fine, and when I took it out, it disappeared for non-logged in visitors (as it should).

    But when I put the code back IN, it would not reappear for logged in visitors! I can see it when logged in, though.

    I have NO idea what the problem is or what is causing this. My site is hosted on Pagely and I’ve checked the Disable All Caching box. I’ve also disabled the CDN and disabled Cloudflare.

    When I add any sort of plain HTML text, the non-logged in version of the site reflects the change just fine. It seems to be when I try to add javascript that there is a problem.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter vich11

    (@vich11)

    Update:

    The issue seems to be specifically related to Taboola code. Regardless of whether it is a div with taboola in the ID name or Taboola related javascript. I just added some other code and it worked fine.

    Plugin Author Spacetime

    (@spacetime)

    I see the code (block 14) properly inserted after element div.td-block-row:

    <div class='code-block code-block-14' style='margin: 8px 0; clear: both;'>
    <div id="taboola-below-article-thumbnails"></div>
    <script type="text/javascript">
      window._taboola = window._taboola || [];
      _taboola.push({
        mode: 'alternating-thumbnails-a',
        container: 'taboola-below-article-thumbnails',
        placement: 'Below Article Thumbnails',
        target_type: 'mix'
      });
    </script></div>

    You are using client-side insertion and maybe Taboola code can’t be loaded asynchronously.

    I would suggest to use server-side insertion for this block (you need to enable Output buffering):
    https://adinserter.pro/documentation/automatic-insertion#before-after-html-element

    Thread Starter vich11

    (@vich11)

    Thank you. That change allowed the in-content code to render, but no matter what I try I can’t get the code that goes in the head section to render. And I still can’t figure out why it works when logged in but not when logged out. Here’s the head code if it helps:

    <script type=”text/javascript”>
    console.log(‘taboola test’);
    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/warp10llc/loader.js’,
    ‘tb_loader_script’);
    if(window.performance && typeof window.performance.mark == ‘function’)
    {window.performance.mark(‘tbl_ic’);}
    </script>

    Plugin Author Spacetime

    (@spacetime)

    It seems the code is inserted. I would suggest to contact Taboola.

    Thread Starter vich11

    (@vich11)

    Where do you see it inserted? It should appear below the Keywee code in the header and it is not there.

    Also, do you have any explanation for how or why it DOES work for logged in users but does not for non-logged in? This makes no sense to me.

    On a related note, the opposite happens to me with the regular display ads. When I’m logged in, no display ads appear, but when not logged in all display ads load normally.

    Thanks

    Plugin Author Spacetime

    (@spacetime)

    Block 14 is inserted below Previous / Next article links.

    You can use debugging functions to visualize inserted blocks and to diagnose insertion problems:
    https://adinserter.pro/documentation/debugging

    I have no clue why it doesn’t work for non-logged users.
    Maybe you have caching issues. Try to flush all caches.

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Ads and changes only show when logged into WordPress’ is closed to new replies.