Hi, Sorry about that! Please look again.
Remote debugging doesn’t seem to be enabled.
I had it on but now I disabled caching too so hopefully it should work this time, if it doesn’t I’ll have no idea why.
Also just wanted to mention that the ads are showing up but they are being defined twice (can be seen in [ADINSERTER HEAD group=”Google tags”] in the header) which is causing some issues.
I can’t identify any duplicated code:
<script>
googletag.cmd.push(function() {
googletag.defineSlot('/61175202/GC-EN-Public-BB-300x250', [300, 250], 'gpt-ad-BB-300x250-').addService(googletag.pubads()); // Big Box EN
googletag.defineSlot('/61175202/GC-EN-Public-LB-728x90', [728, 90], 'gpt-ad-LB-Competitions-EN-728x90-1').addService(googletag.pubads()); // LB - Competitions - EN
/* googletag.defineSlot('/61175202/GC-EN-Public-BB-300x250', [300, 250], 'gpt-ad-BB-Competitions-300x250-1').addService(googletag.pubads()); */
googletag.defineSlot('/61175202/GC-EN-Public-BB-300x250', [300, 250], 'gpt-ad-BB-NewsEN-300x250-1').addService(googletag.pubads());
googletag.defineSlot('/61175202/GC-EN-Public-BB-300x250', [300, 250], 'gpt-ad-BB-SearchEN-300x250-1').addService(googletag.pubads());
googletag.defineSlot('/61175202/GC-EN-Public-BB-300x250', [300, 250], 'gpt-ad-BB-CourseEN-300x250-1').addService(googletag.pubads());
googletag.defineSlot('/61175202/GC-FR-Public-BB-300x250', [300, 250], 'gpt-ad-BB-NewsFR-300x250-1').addService(googletag.pubads());
googletag.defineSlot('/61175202/GC-FR-Public-BB-300x250', [300, 250], 'gpt-ad-BB-SearchFR-300x250-1').addService(googletag.pubads());
googletag.defineSlot('/61175202/GC-FR-Public-BB-300x250', [300, 250], 'gpt-ad-BB-CourseFR-300x250-1').addService(googletag.pubads());
googletag.pubads().enableSingleRequest();
googletag.enableServices(); });
</script>
Can you please clarify which code (block) is duplicated?
What page is this on? On the homepage in the page’s source code I see this
<script>
googletag.cmd.push(function() {
googletag.defineSlot('/61175202/GC-EN-Public-LB-728x90', [728, 90], 'gpt-ad-LB-EN-728x90-1').addService(googletag.pubads()); // LB - EN
/* googletag.defineSlot('/61175202/GC-EN-Public-BB-300x250', [300, 250], 'gpt-ad-LB-EN-fallback-300x250-1').addService(googletag.pubads()); */
googletag.defineSlot('/61175202/GC-EN-Public-BB-300x250', [300, 250], 'gpt-ad-BB-300x250-1').addService(googletag.pubads()); // Big Box EN
googletag.defineSlot('/61175202/GC-EN-Public-LB-728x90', [728, 90], 'gpt-ad-LB-EN-728x90-2').addService(googletag.pubads()); // LB - EN
/* googletag.defineSlot('/61175202/GC-EN-Public-BB-300x250', [300, 250], 'gpt-ad-LB-EN-fallback-300x250-2').addService(googletag.pubads()); */
googletag.defineSlot('/61175202/GC-EN-Public-BB-300x250', [300, 250], 'gpt-ad-BB-300x250-2').addService(googletag.pubads()); // Big Box EN
googletag.pubads().enableSingleRequest();
googletag.enableServices(); });
</script>
Even though the page is only supposed to have 1 BB and one LB. The one that is commented out using /* */ is expected but they are all being duplicated for some reason on the homepage.
-
This reply was modified 4 years, 6 months ago by
rmalcolm.
The code was taken from your homepage.
If i use [ADINSERTER counter=”block”] in the googletag.defineSlot function, it shows up ad 1 and 2 even though I am only calling shortcode once on my wp page.
This is because the theme may call WP hooks (on which the plugin relies) more than once – usually only one call is for the visible content.
When a block is inserted multiple times then the head code is also inserted multiple times. In some cases this may be undesirable. In such cases you can specify value once for the HEAD separator so the head code will be inserted only once.
https://adinserter.pro/documentation/header-and-footer-code
HEAD CODE
[ADINSERTER HEAD="once"]
BODY CODE
Thank you this fixes the issue of duplicates in the header, but for some reason the body still expects there to be a duplicate ad still and it is calling for
googletag.cmd.push(function() { googletag.display(‘gpt-ad-LB-EN-728×90-2’); });
The -2 at the end means it thinks its the second ad still. I did not make our theme and I am not familiar with WP Hooks. Do you know why this might be happening/ a fix for it?
I really appreciate your help on it so far!
Try to set Filter to 2:
https://adinserter.pro/documentation/additional-block-settings#filter
This will insert blocks only for the second hook call which is the one used for the page content.
Are you still having issues?