• Resolved topfgartenwelt

    (@topfgartenwelt)


    At the moment I’m trying the free plugin, but it seems that AdInserter is causing a CLS in the desktop version. Lighthouse is reporting that the following peace of code is the problem:

    div.code-block.code-block-2

    How can I avoid it? Without the plugin my CLS is nearly 0.

    I have tried to set a height in custom css (350 pixel) –> CLS
    I have tried a banner –> CLS after insertion

    Greetings Kathrin

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

Viewing 15 replies - 16 through 30 (of 35 total)
  • Plugin Author Spacetime

    (@spacetime)

    When you define ad (block) height (assuming this is the maximum block height), then there will be no layout shift.
    I suggest cheking the source code – the wrapping div should have the height defined with an inline style.

    AMP pages:
    https://adinserter.pro/documentation/amp-pages

    Thread Starter topfgartenwelt

    (@topfgartenwelt)

    Do you mean I have to write an own div-wrapper? I just used the option from your plugin: misc –> display –> define height.

    I don’t know how to write a div-wrapper and I don’t know where I should put the code so that wrapper works with your plugin.

    Greetings Kathrin

    Plugin Author Spacetime

    (@spacetime)

    No, the plugin creates a wrapping div around the block code according to the settings:
    https://adinserter.pro/documentation/alignments-and-styles

    Thread Starter topfgartenwelt

    (@topfgartenwelt)

    Ok, but that wrapper causes a CLS when I use dynamic blocks: client side insert and I found another problem with this option, when I browse from google index at first an indexed amp page is opened, when I click another intern link I don’t see the ad blocks for mobile on mobile sites. When I change the settings from client side insert to server side everything works well with the exception of amp sites that are not defined yet.

    I’m using a server side caching that is splitted into a cache for desktop and a cache for mobile. I think that’s the problem, when I set the dynamic block to client side insert. What’s your opinion to that theory?

    I read your link for the styles but there is no wrapper listed with inline option 🙁

    Greetings Kathrin

    Plugin Author Spacetime

    (@spacetime)

    When you define ad (block) height which should be the maximum block height, there will be no layout shift.

    And if you are using caching then you can’t use any server-side insertion.

    Unfortunately, on AMP pages you can’t use any (client) javascript code.
    Maybe the best approach would be to use separate blocks for ads on AMP pages (using AMP separator).

    Another option would be to disable any caching:
    https://adinserter.pro/documentation/caching
    In such case you can use server-side insertions for all cases.

    Thread Starter topfgartenwelt

    (@topfgartenwelt)

    I have set a maximum block height 250 px (I have also tried 300 px) and there is a layout shift about 0,123 measured by Google Lighthouse, when I use dynamic blocks: client side insert. It’s completely irrelavant which height I define, it is measured as CLS. I don’t know what I should do, the CLS is there using that method. But the CLS is gone when I set to server side and the Amazon Dummy Ad is shown and also the dummy text. What will happen if I will try the server-side method for AdSense? Is this a policy violation to use server side?

    The server side caching is done by the hoster, I have no extra caching plugin therefore. I can’t disable the cache because than the site is too slow.

    Can I use an own block only for AMP-Ads?

    Greetings Kathrin

    Plugin Author Spacetime

    (@spacetime)

    Server-side insertion is the default insetion which happens when the page is created.
    It works for all ad codes.
    The only issue is that pages may be cached so dynamic content may not work.

    You can use a block only for AMP code, put it below the AMP separator:
    https://adinserter.pro/documentation/amp-pages

    Thread Starter topfgartenwelt

    (@topfgartenwelt)

    In the meantime I have tried it with an AdSense Code and it worked too. The AdSense Code was also shown. And also the referrer blacklist works as it should. Also the AMP-Ads work great.

    I have this passage under Caching:
    However, Ad Inserter also supports some of the functions above even when caching is enabled:

    Client-side device detection
    Client-side referer check
    Client-side cookie check
    Client-side client check

    And I don’t use and will not use any of this options:

    Ad rotation
    Server-side device detection
    Server-side referer check
    Server-side cookie check
    GEO targeting (IP address check)
    Scheduling
    User check
    Debugging functions

    If I use dynamic block client side insertion I can’t rid off the CLS. And the CLS appears in the mobile as in the desktop version of the theme. It’s a mess. Isn’t there any working solution?

    If I continue using the server-side option would it be the only problem that recurring users wont see any ads?

    Greetings Kathrin

    Plugin Author Spacetime

    (@spacetime)

    I see no issues with client-side insertion.

    You can use server-side dynamic blocks, the only possible issue with your current settings is the referrer check which may not work with cached pages.

    The cached page will have ads (and cookie script) according to the referrer when the page was cached.

    Thread Starter topfgartenwelt

    (@topfgartenwelt)

    Ok, so I will give it a try.

    Is there a way to make a break between ad tag and ad? Because at the moment there is the ad tag and the ad is directly following. But I want to have the ad tag – blank sapace – ad.

    Thanks for your patience.

    Plugin Author Spacetime

    (@spacetime)

    Thread Starter topfgartenwelt

    (@topfgartenwelt)

    I don’t want to change the size of the wording, I to set a break between ad tag and advertisement. How I should mangage that? Writing </break> before the script of the ad?

    Plugin Author Spacetime

    (@spacetime)

    Well, you don’t have to change the font.
    Change only what is needed, for example to increase the margin of the label:

    <style>
      .code-block-label {
        margin-bottom: 30px;
      }
    </style>
    Thread Starter topfgartenwelt

    (@topfgartenwelt)

    Thank you very much, it works perfectly.

    But now I get the following message in the console in red (I think it wasn’t there before):

    document.write called after page load:

    document.write @ aussaatkalender-januar-7-gemuese-blumen-kraeuter:4641
    jg @ show_ads.js:81
    hi @ show_ads.js:150
    gi @ show_ads.js:148
    ki @ show_ads.js:157
    (anonymous) @ show_ads.js:157
    p.U @ show_ads.js:52
    ke @ show_ads.js:60
    (anonymous) @ show_ads.js:157
    (anonymous) @ show_ads.js:157

    But I thought the plugin doesn’t use document write…

    Greetings Kathrin

    Plugin Author Spacetime

    (@spacetime)

    Ad Inserter doesn’t use document.write.

    You should contact the authors of the script that causes issues.

Viewing 15 replies - 16 through 30 (of 35 total)

The topic ‘CLS’ is closed to new replies.