• Resolved sandissparkle

    (@sandissparkle)


    Hi,
    So i inserted ads with your plugin and only one is showing up. I inserted ads after paragraph 2,6. Seperated them with a comma as shown in the documentation, but the ad image is only seen after the second paragraph. When i turn Label Blocks i see that Block 1 C=1 N=2 is created and is working, but the image doesn’t show up. Can you help me with this?

    <!-- GPT AdSlot 1 for Ad unit 'responsive_unit' ### Size: [[400,250],[390,325],[340,280],[635,406],[300,250]] -->
    <div id='div-gpt-ad-1535863-1'>
      <script>
        googletag.cmd.push(function() { googletag.display('div-gpt-ad-1535863-1'); });
      </script>
    </div>
    <!-- End AdSlot 1 -->
    <!-- Start GPT Tag -->
    <script async src='https://securepubads.g.doubleclick.net/tag/js/gpt.js'></script>
    <script>
      window.googletag = window.googletag || {cmd: []};
      googletag.cmd.push(function() {
        var mapping1 = googletag.sizeMapping()
                                .addSize([700, 0], [[640, 400]])
                                .addSize([500, 0], [[440, 275]])
                                .addSize([425, 0], [[390, 325]])
                                .addSize([400, 0], [[360, 300]])
                                .addSize([0, 0], [[336, 280]])
                                .build();
    
        googletag.defineSlot('/22718203122/responsive_unit', [[440,275],[390,325],[360,300],[640,400],[336,280]], 'div-gpt-ad-1535863-1')
                 .defineSizeMapping(mapping1)
                 .addService(googletag.pubads());
    
        googletag.pubads().enableSingleRequest();
        googletag.enableServices();
      });
    </script>
    <!-- End GPT Tag -->

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

Viewing 15 replies - 1 through 15 (of 19 total)
  • Plugin Author Spacetime

    (@spacetime)

    Hello,

    remote debugging doesn’t seem to be enabled:
    https://wordpress.org/support/topic/ad-inserter-support-forum-before-you-ask-for-help/

    You are inserting ad code with id more than once. Consequently only the first insertion works.
    HTML element IDs need to be unique on the page.

    You need to insert codes with different ids:
    https://adinserter.pro/documentation/ad-manager-ads

    Thread Starter sandissparkle

    (@sandissparkle)

    Does [ADINSERTER counter=”block”] work only for the pro version? Because i cant seem to get it fixed…

    <!-- GPT AdSlot 1 for Ad unit 'responsive_unit' ### Size: [[400,250],[390,325],[340,280],[635,406],[300,250]] -->
    <div id='div-gpt-ad-1535863-[ADINSERTER counter="block"]'>
      <script>
        googletag.cmd.push(function() { googletag.display('div-gpt-ad-1535863-[ADINSERTER counter="block"]'); });
        
      </script>
    </div>
    <!-- End AdSlot 1 -->
    <!-- Start GPT Tag -->
    <script async src='https://securepubads.g.doubleclick.net/tag/js/gpt.js'></script>
    <script>
      window.googletag = window.googletag || {cmd: []};
      googletag.cmd.push(function() {
        var mapping1 = googletag.sizeMapping()
                                .addSize([700, 0], [[640, 400]])
                                .addSize([500, 0], [[440, 275]])
                                .addSize([425, 0], [[390, 325]])
                                .addSize([400, 0], [[360, 300]])
                                .addSize([0, 0], [[336, 280]])
                                .build();
    
        googletag.defineSlot('/22718203122/responsive_unit', [[440,275],[390,325],[360,300],[640,400],[336,280]], 'div-gpt-ad-1535863-[ADINSERTER counter="block"]')
                 .defineSizeMapping(mapping1)
                 .addService(googletag.pubads());
    
        googletag.pubads().enableSingleRequest();
        googletag.enableServices();
      });
    </script>
    <!-- End GPT Tag -->
    Plugin Author Spacetime

    (@spacetime)

    The block counter shortcodes work in all versions.
    Both codes for block 1 are properly inserted:

    <!-- GPT AdSlot 1 for Ad unit 'responsive_unit' ### Size: [[400,250],[390,325],[340,280],[635,406],[300,250]] -->
    <div id="div-gpt-ad-1535863-1">
      <script>
        googletag.cmd.push(function() { googletag.display('div-gpt-ad-1535863-1'); });
        
      </script>
    </div>
    <!-- End AdSlot 1 -->
    <!-- GPT AdSlot 1 for Ad unit 'responsive_unit' ### Size: [[400,250],[390,325],[340,280],[635,406],[300,250]] -->
    <div id="div-gpt-ad-1535863-2">
      <script>
        googletag.cmd.push(function() { googletag.display('div-gpt-ad-1535863-2'); });
        
      </script>
    </div>
    <!-- End AdSlot 1 -->

    However, you have wrong / missing header codes for the ads.
    Please follow the instructions for Multiple Ad Manager ad blocks with server-side unique IDs

    Thread Starter sandissparkle

    (@sandissparkle)

    Now i fixed my header code to this, now with the inspect tool i see that the blocks have diffrent ids, but no ad image is showing up, i have enabled remote debbuging tool, if you could help:

    <!– Start GPT Tag –>
    <script async src=’https://securepubads.g.doubleclick.net/tag/js/gpt.js’></script&gt;
    <script>
    window.googletag = window.googletag || {cmd: []};
    googletag.cmd.push(function() {
    var mapping1 = googletag.sizeMapping()
    .addSize([700, 0], [[640, 400]])
    .addSize([500, 0], [[440, 275]])
    .addSize([425, 0], [[390, 325]])
    .addSize([400, 0], [[360, 300]])
    .addSize([0, 0], [[336, 280]])
    .build();

    googletag.defineSlot(‘/22718203122/responsive_unit’, [[440,275],[390,325],[360,300],[640,400],[336,280]], ‘div-gpt-ad-1535863-[ADINSERTER counter=”block”]’)
    .defineSizeMapping(mapping1)
    .addService(googletag.pubads());

    [ADINSERTER HEAD group=”Google tags”]

    googletag.pubads().enableSingleRequest();
    googletag.enableServices();
    });
    </script>
    <!– End GPT Tag –>

    Plugin Author Spacetime

    (@spacetime)

    You still have issues.

    – you can’t use block counter shortcodes in the header (code in the Header window) – [ADINSERTER counter="block"] makes no sense in the header, such shortcodes are defined only for blocks

    – you can’t use HEAD separators in the header (code in the Header window) – [ADINSERTER HEAD group="Google tags"] makes no sense in the header, such shortcodes can be used only in blocks to separate head and body code

    – missing shortcode for block header codes in the header (code in the Header window) – for example [ADINSERTER name="GOOGLE"]

    – Block 1 is still missing header code. For example:

    googletag.defineSlot(‘/22718203122/responsive_unit’, [[440,275],[390,325],[360,300],[640,400],[336,280]], ‘div-gpt-ad-1535863-[ADINSERTER counter="block"]’)
    .defineSizeMapping(mapping1)
    .addService(googletag.pubads());
    
    [ADINSERTER HEAD group="GOOGLE"]
    
    <!-- GPT AdSlot 1 for Ad unit 'responsive_unit' ### Size: [[400,250],[390,325],[340,280],[635,406],[300,250]] -->
    <div id='div-gpt-ad-1535863-[ADINSERTER counter="block"]'>
      <script>
        googletag.cmd.push(function() { googletag.display('div-gpt-ad-1535863-[ADINSERTER counter="block"]'); });
        
      </script>
    </div>
    <!-- End AdSlot 1 -->
    Thread Starter sandissparkle

    (@sandissparkle)

    <!-- GPT AdSlot 1 for Ad unit 'responsive_unit' ### Size: [[400,250],[390,325],[340,280],[635,406],[300,250]] -->
    <script>
    googletag.defineSlot(‘/22718203122/responsive_unit’, [[440,275],[390,325],[360,300],[640,400],[336,280]], ‘div-gpt-ad-1535863-[ADINSERTER counter="block"]’)
    .defineSizeMapping(mapping1)
    .addService(googletag.pubads());
    
    [ADINSERTER HEAD group="GOOGLE"]
    
    </script>
    
    <div id="div-gpt-ad-1535863-[ADINSERTER counter="block"]">
      <script>
        googletag.cmd.push(function() { googletag.display('div-gpt-ad-1535863-[ADINSERTER counter="block"]'); });
        
      </script>
    </div>
    <!-- End AdSlot 1 -->
    <!-- Start GPT Tag -->
    <script async src='https://securepubads.g.doubleclick.net/tag/js/gpt.js'></script>
    <script>
      window.googletag = window.googletag || {cmd: []};
      googletag.cmd.push(function() {
        var mapping1 = googletag.sizeMapping()
                                .addSize([700, 0], [[640, 400]])
                                .addSize([500, 0], [[440, 275]])
                                .addSize([425, 0], [[390, 325]])
                                .addSize([400, 0], [[360, 300]])
                                .addSize([0, 0], [[336, 280]])
                                .build();
    
        googletag.defineSlot('/22718203122/responsive_unit', [[440,275],[390,325],[360,300],[640,400],[336,280]], 'div-gpt-ad-1535863-1')
                 .defineSizeMapping(mapping1)
                 .addService(googletag.pubads());
                 [ADINSERTER name="GOOGLE"];
                
                 
                
        googletag.pubads().enableSingleRequest();
        googletag.enableServices();
      });
    </script>
    <!-- End GPT Tag -->

    This is my block and header code now, its still not displaying two images, only the first one!

    • This reply was modified 3 years, 11 months ago by sandissparkle.
    • This reply was modified 3 years, 11 months ago by sandissparkle.
    • This reply was modified 3 years, 11 months ago by sandissparkle.
    Plugin Author Spacetime

    (@spacetime)

    You code is still wrong.

    Please check again this post:
    https://wordpress.org/support/topic/automatic-ad-insertion-not-working/#post-15577756

    Thread Starter sandissparkle

    (@sandissparkle)

    I dont quite understand what is wrong,

    [ADINSERTER counter=”block”] made no sense in the header – i removed it from header.
    [ADINSERTER HEAD group=”Google tags”] made no sense in header so i removed it also.

    [ADINSERTER name=”GOOGLE”] added this to my header and fixed my block code, what is wrong still?
    Can you fix the code if you see what exactly is not correct?

    Plugin Author Spacetime

    (@spacetime)

    Header:

    This code should not be there as it will be inserted from HEAD code of the blocks:

    googletag.defineSlot('/22718203122/responsive_unit', [[440,275],[390,325],[360,300],[640,400],[336,280]], 'div-gpt-ad-1535863-1')
                 .defineSizeMapping(mapping1)
                 .addService(googletag.pubads());

    There should be no semicolon after the shortcode.

    Block 1:
    If you compare the codes you’ll see many issues – the codes differ significantly – you also put invalid tags there.

    Thread Starter sandissparkle

    (@sandissparkle)

    I have compared the codes and your provided Block code doesn’t work for some reason, this is my header and block code now.

    googletag.defineSlot(‘/22718203122/responsive_unit’, [[440,275],[390,325],[360,300],[640,400],[336,280]], ‘div-gpt-ad-1535863-[ADINSERTER counter="block"]’)
    .defineSizeMapping(mapping1)
    .addService(googletag.pubads());
    
    [ADINSERTER HEAD group="GOOGLE"]
    
    <!-- GPT AdSlot 1 for Ad unit 'responsive_unit' ### Size: [[400,250],[390,325],[340,280],[635,406],[300,250]] -->
    <div id='div-gpt-ad-1535863-[ADINSERTER counter="block"]'>
      <script>
        googletag.cmd.push(function() { googletag.display('div-gpt-ad-1535863-[ADINSERTER counter="block"]'); });
        
      </script>
    </div>
    <!-- End AdSlot 1 -->
    <!-- Start GPT Tag -->
    <script async src='https://securepubads.g.doubleclick.net/tag/js/gpt.js'></script>
    <script>
      window.googletag = window.googletag || {cmd: []};
      googletag.cmd.push(function() {
        var mapping1 = googletag.sizeMapping()
                                .addSize([700, 0], [[640, 400]])
                                .addSize([500, 0], [[440, 275]])
                                .addSize([425, 0], [[390, 325]])
                                .addSize([400, 0], [[360, 300]])
                                .addSize([0, 0], [[336, 280]])
                                .build();
    
     
                 [ADINSERTER name="GOOGLE"]
                
                 
                
        googletag.pubads().enableSingleRequest();
        googletag.enableServices();
      });
    </script>
    <!-- End GPT Tag -->
    Plugin Author Spacetime

    (@spacetime)

    Now the codes look fine.

    You only need to enable Output buffering to insert the header codes:
    https://adinserter.pro/documentation/plugin-settings

    Thread Starter sandissparkle

    (@sandissparkle)

    How do i enable it? I have generatpress theme, the red output buffering rectangle doesnt show up when i enable Ad inserter Label blocks.

    Plugin Author Spacetime

    (@spacetime)

    I posted link above – it is located on the general plugin settings tab.

    Thread Starter sandissparkle

    (@sandissparkle)

    Okay, i found it, enabled it, but still my ads are not working!

    Plugin Author Spacetime

    (@spacetime)

    I tested with the same settings and the same theme and it works fine – both ads are displayed.

    It seems you have some invalid HTML code in the post which prevents output buffer processing:

    <div class="entry-content" itemprop="text">
    			<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
    <?xml encoding="utf-8" ?><html><body><p>Bieži vien, kad tuvojas kādi svētki un ir jādomā par dāvanu, mēs izvēlamies pavisam vienkār&scaron;u ceļu. Starp tiem ir iespēja uzdāvināt kādu dāvanu karti vai arī aploksni ar naudu. Tomēr iesakām padomāt arī par kādu oriģinālāku apsveikumu. Jo vairāk pieaugam, jo vairāk novērtējam praktiskas dāvanas, piemēram, zeķes. Līdz ar to uzskatām, ka arī stilīgas un krāsainas zeķes ir labākā dāvana un for&scaron;s apsveikums svētkos.</p>

    This doesn’t belong there:

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
    <?xml encoding="utf-8" ?><html><body>

    Can you please check the post source code?

Viewing 15 replies - 1 through 15 (of 19 total)

The topic ‘Automatic Ad insertion not working’ is closed to new replies.