Ad Inserter has many debugging functions that can help you to diagnose the problem when you don’t see your ads at expected positions. When you are logged in as administrator each post and page has a WordPress admin toolbar on the top with Ad Inserter menu item. If you don’t see it check WordPress Users > Your profile and make sure Show Toolbar when viewing site is checked. Check also Ad Inserter plugin settings (tab ⚙ / Debugging) and make sure Debugging functions in admin toolbar is checked.
Make sure caching is disabled while debugging!
It may happen that your theme does not not support the toolbar or it is not displayed for some other reason. In such case you can use Ad Inserter Debugging Tools widget which has the same menu items. Simply drag Ad Inserter widget into the sidebar and select Debugging Tools. Of course, you still need to be logged in as administrator to see the widget.
Each inserted block is labeled with a thin red border and colored bar with block number, block name (including rotation option name if rotation is used), viewport name if using client-side device detection and counters. If you see only block label then this means that the block with your code is inserted but the code doesn’t display anything.
- Normal block
- Hidden block because of client-side device detection
- Block with AMP separator on AMP page
- Header and footer code, client-side insertion scripts
- Block with ad blocking action
- Ad blocking replacement block, scheduling fallback block
- Block with client-side black or white list check
- AdSense Auto ads
- AdSense ads with no slot size
Each labeled block shows also various counters that can be used for filtering of insertions. Available counters:
- N = Block counter
- C = Content processing (
- X = Excerpt processing (
- B = Before post (
- A = After post (
- W = Widget counter
- P = PHP function call counter
Debugging function Show Positions labels every available position for automatic insertion that is supported by the theme.
All paragraph positions are shown according to the selected paragraph counting settings (Show Positions sub-menu) and show paragraph number and number of paragraph words.
Debugging function Show HTML tags labels most HTML tags that are important to determine parameters for paragraph counting.
Use this function to temporarily disable insertion of code blocks – everything else on the page will look like the code blocks were processed and inserted.
When this function is enabled you will see a bar below the toolbar showing the status of ad blocking detection: whether ad blocking is detected, whether action is enabled, whether action cookie is present and how many page views were already counted (if used). You can click on the bar to delete ad blocking detection cookies. Ad blocking detection needs to be enabled to use this function.
With this function you can simulate and test ad blocking detection without actual ad blocking software. Ad Inserter will behave as there is ad blocking present. Of course, no ads will be blocked, only plugin ad blocking functions will be triggered when the page is loaded. Ad blocking detection needs to be enabled to use this function.
Use this function to log insertion process in order to determine why some code block was not inserted. The log is added as HTML comment at the end of the page – check page source.
Place Processing Log widget into some widget area or sidebar to see insertion process including basic WordPress page and Ad Inserter data (User status, Page Type, Post ID, Url, Referer, etc). With this widget you can also check saved block settings and client-side viewport name. Example of Log Processing debugging function and processing log shown in the widget:
More detailed processing log with detailed debugging info is shown as HTML comment at the bottom of page source.
Click on the Preview button below code editor for each code block to see how the ad or code will look like. On the preview window click on the Highlight button to highlight the code. If you don’t see anything displayed here it is very likely that the code is not working properly. Here you can also adjust alignment and style for code block. Of course, blank AdSense blocks are a common issue – it may happen that AdSense code will not display ads in the preview window.
General debugging information
Make sure caching is disabled while debugging!
All debugging functions you enable will be visible only to you unless you enable Remote debugging and other users use debugging url parameters on your website. Post/page debugging works by adding url parameters to the url (web address). Debugging settings are also stored into cookie. The following url parameters are available:
- Label Blocks:
ai-debug-blocks=0to turn it off)
- Show Positions:
ai-debug-positions=BLOCK_NUMBER, 0 means default counting of paragraphs with
ptags, number means block number to see paragraph counting as configured for the block (use
ai-debug-positions=to turn it off)
- Show HTML tags:
ai-debug-tags=0to turn it off)
- Disable insertion:
ai-debug-no-insertion=0to turn it off)
- Log Processing:
ai-debug-processing=0to turn it off)
- PRO Country test:
ai-debug-country=XX(replace XX with country ISO Alpha-2 code)
- PRO IP address test:
- Ad blocking simulation:
ai-debug-adb=0to turn it off)
- Ad blocking detection status:
ai-debug-adb-status=0to turn it off)
Country test and IP address test work only when you have enabled debugging on some page and debugging cookie is created.
When browsing other pages on the website debugging settings are temporarily saved (for the session). To disable all debugging functions click on the Ad Inserter top menu item in the toolbar (or use url parameter
If you see only block label (bar with block name) then this means that the block with your code is inserted but the code doesn’t display anything.
Global debugging settings are located on plugin settings tab ⚙ / tab Debugging
When you are logged in as administrator each post or page has a WordPress admin toolbar on the top with Ad Inserter menu item. If you don’t see admin toolbar on the top go to WordPress Users > Your profile and make sure Show Toolbar when viewing site is checked. Also make sure Debugging functions in admin toolbar is checked.
Remote debugging enables other people using url parameters to see your pages with debugging data: debugger widget, labeled blocks, positions for automatic insertion, labeled tags and processing log. For logged in administrators debugging is always enabled.
Enable this option to allow other people to see debugging data in order to help you to diagnose issues with Ad Inserter.