Ad Inserter – WordPress Ads Management

설명

Ad management plugin with many advanced advertising features. Supports all kinds of WordPress ads including Google AdSense, contextual Amazon Native Shopping Ads and rotating banners.

Ad Inserter is more than just ad manager plugin. It provides many advanced options to insert any Javascript, CSS, HTML, PHP or advert code anywhere on the page.

Features

  • 16 code (ad) blocks
  • Syntax highlighting editor
  • Code preview with visual CSS editor
  • Automatically inserts ads in posts and pages
  • Insert before or after post
  • Insert before or after content
  • Insert before or after paragraph
  • Insert before or after random paragraph
  • Insert before or after multiple paragraphs
  • Insert before or after comments
  • Insert before or after excerpt
  • Insert before or after any HTML element in post
  • Insert at relative position in posts
  • Insert between posts on blog pages (in-feed AdSense ads)
  • Insert between excerpts on blog pages
  • Insert between comments
  • Insert at custom hook positions (e.g. using Genesis Theme Framework Hook Guide)
  • Clearance options to avoid insertion near images or headers
  • Insertion exceptions for posts and pages
  • Insert header and footer code
  • Insert raw HTTP response header lines
  • Insert Google Analytics, Piwik or any other web analytics code
  • Insert HTML, CSS, Javascript or PHP code
  • Manual insertion: widgets, shortcodes, PHP function call
  • Sticky (fixed) widgets (sticky sidebar – the sidebar does not move when the page is scrolled)
  • Custom block alignments and styles
  • Insert (different) ads on AMP pages
  • Custom CSS class name for wrapping divs to avoid ad blockers
  • Use shortcodes from other plugins
  • Use custom fields as defined in posts
  • PHP code processing
  • Ad rotation (server-side and client-side – works with caching)
  • Ad blocking detection – popup message, page redirection
  • Desktop/mobile device detection (server-side and client-side – works with caching)
  • Black/White-list categories, tags, taxonomies, post IDs, urls, url query parameters, cookies, referers
  • Simple troubleshooting with many debugging functions
  • Function to visualize inserted code blocks
  • Function to visualize available insertion positions
  • Function to visualize HTML tags

And Ad Inserter Pro – all-in-one WordPress ad management plugin has even more advanced features:

  • 64 code (ad) blocks
  • GEO targeting (works also with caching)
  • Black/White-list IP addresses or countries (works also with caching)
  • Ad impression and click tracking (works also with <iframe> Javascript ads like Google AdSense)
  • A/B testing
  • Sticky ad positions (left, top, right, bottom)
  • Scheduling with fallback option
  • Ad blocking detection – ad replacement, content protection
  • Ad blocking statistics
  • Multisite options to limit settings on the sites
  • Post/page exception management
  • more custom viewports for client-side desktop/mobile device detection
  • more custom hooks for custom theme insertions
  • Export and import of settings
  • Support via email

Ad Inserter WordPress plugin is and advanced advertising manager – it has many features and options to automate ad insertion and to optimally monetize your website on desktop, tablet and phone displays. It provides many simple ways to insert any Javascript, HTML, PHP or advert code anywhere on the page. For best ad placement and to use optimal advertising positions please read the user manual to get the most of the plugin.

Endorsed by Amazon

Amazon suggests to use Ad Inserter to add Native Shopping Ads to WordPress posts. Native Shopping Ads provide highly relevant and dynamic product recommendations in a stylishly designed and responsive ad unit that can be placed at the end of your content or within your content to create a more compelling visitor experience and shopping opportunity.

Ad Inserter Ad Manager – One Plugin – Many Functions

Ad Inserter is not just another plugin for WordPress ads. Do you enjoy finding the right plugin to solve a particular problem on your site? For example:

  • ad management and ad injection
  • to insert ads between paragraphs
  • to insert ads between posts
  • to insert ads between comments
  • to insert ads on AMP pages
  • to insert different ads for mobile devices
  • to insert ads at custom action hooks (e.g. using Genesis Theme Framework Hook Guide)
  • to hide ads on specific pages
  • for ad rotation
  • for PHP code widgets
  • for sticky (fixed) widgets
  • for widget logic
  • to restrict widgets
  • to detect ad blocking
  • to insert PHP or HTML code into posts
  • to insert header, footer or tracking code
  • to insert PHP, HTML, CSS, shortcodes
  • to insert Google analytics code
  • to insert various opt-in forms

Maintaining several plugins (often from different vendors) is not easy. And each plugin is slowing down the speed of your website.

Speed Up Your WordPress: Replace them all with free Ad Inserter!

Quick Start

Few very important things you need to know in order to insert code and display some ad:

  • Code block is any code (for example Google AdSense ad) that has to be inserted (and displayed) at some position. Each code block can be configured to insert code at almost any position supported by WordPress
  • Enable and use at least one insertion option (Automatic insertion, Widget, Shortcode, PHP function call)
  • Enable insertion on at least one WordPress page type (Posts, Static pages, Homepage, Category pages, Search Pages, Archive pages)
  • For Posts and Static pages leave default BLANK selection value after the checkbox unless you really know what are you doing (using individual exceptions)
  • If you don’t see inserted code block, turn on debugging functions: Label inserted blocks, Show available positions for automatic insertion (Ad Inserter menu item in the WordPress toolbar on the top of every post/page)
  • If you are using AdSense you may get blank (empty) ad blocks. This might be because there is some error in the code (wrong IDs), your Google AdSense account is not fully approved yet, your website was not accepted or your Google AdSense account is banned. In such case you can try other ad networks for contextual ads. Check Ads Not Displayed for more information.

Few typical settings are described on the FAQ page. Please make sure you have also read Installation page. For more detailed instructions please read Ad Inserter documentation page.

Please support plugin development

If you are using Ad Inserter and you like it, then please write about it and spread the word on the review page.

Positive reviews are a great way to show your appreciation for my work. Besides being an incredible boost to my morale, they are also a great incentive to fix any bug found in the software and to add new features for better monetization of your website.

Support the advancement of this plugin:

스크린샷

  • Settings for one code block (Before post). Up to 16 blocks can be configured (up to 64 in Ad Inserter Pro)
  • Code preview with visual CSS editor
  • Code preview with visual CSS editor - highlighted code
  • Post / Page Ad Inserter Exceptions
  • Some Ad Inserter Pro features: IP address and country lists, Scheduling between dates with fallback
  • Ad Inserter settings
  • Visualization of HTML tags in post
  • Visualization of positions for automatic insertion in post
  • Visualization of inserted block in post
  • Alignment Left, Default - Default means default (usually left) aligned ad block with thin margin around
  • Alignment Right - Right aligned ad block with thin margin around
  • Alignment Center - Center aligned ad block with thin margin around
  • Alignment No Wrapping - Default (usually left) aligned ad block with no margin around
  • Alignment Custom CSS - Ad block with custom CSS (no margin around). You can use it for special effects (border, background, padding, margin, floating, etc.)
  • Alignment Float Left - Left aligned ad block with thin margin around wrapped with text on the right
  • Alignment Float Right - Right aligned ad block with thin margin around wrapped with text on the left
  • Complete settings for one code block (Before Paragraph)

설치

Using The WordPress Dashboard

  1. Go to WordPress Plugins menu, click Add New button
  2. Search for ad inserter
  3. Click ‘Install Now’
  4. Activate Ad Inserter on the Plugin dashboard

Uploading plugin file

  1. Go to WordPress Plugins menu, click Add New button
  2. Click Upload Plugin
  3. Select ad-inserter.zip from your computer
  4. Click ‘Install Now’
  5. Activate Ad Inserter in the Plugin dashboard

Using FTP

  1. Download ad-inserter.zip
  2. Extract ad-inserter directory to your computer
  3. Upload ad-inserter directory to the /wp-content/plugins/ directory
  4. Activate Ad Inserter in the Plugin dashboard

Ad Inserter Pro Installation

If you are using free Ad Inserter then first uninstall it. The Pro version will automatically import existing settings from the free version.
After you receive the email with download link for the Ad Inserter Pro plugin, download it, go to WordPress Plugins, Add New, Upload Plugin, Choose file, click on Install Now,
activate it and then click “Enter License Key” and enter license key you got in the email.

Uploading plugin file

  1. Go to WordPress Plugins menu, click Add New button
  2. Click Upload Plugin
  3. Select ad-inserter-pro.zip from your computer
  4. Click ‘Install Now’
  5. Activate Ad Inserter Pro in the Plugin dashboard
  6. Click “Enter License Key” or go to plugin Settings / tab * and enter license key you got in the email

Using FTP

  1. Download ad-inserter-pro.zip
  2. Extract ad-inserter-pro directory to your computer
  3. Upload ad-inserter-pro directory to the /wp-content/plugins/ directory
  4. Activate Ad Inserter Pro in the Plugin dashboard

Uninstall

If you deactivate and delete Ad Inserter, the settings will stay in the database. To completely remove the plugin and settings do the following:

  1. Go to Ad Inserter general settings (tab *) and click on Reset All Settings
  2. Go to Ad Inserter general settings (tab *) and click on Clear All Statistics Data
  3. Deactivate Ad Inserter
  4. Delete Ad Inserter plugin

Quick Start

Few very important things you need to know in order to insert code and display some ad:

  • Code block is any code (for example AdSense ad) that has to be inserted (and displayed) at some position. Each code block can be configured to insert code at almost any position supported by WordPress
  • Enable and use at least one insertion option (Automatic insertion, Widget, Shortcode, PHP function call)
  • Enable insertion on at least one WordPress page type (Posts, Static pages, Homepage, Category pages, Search Pages, Archive pages)
  • For Posts and static pages select default value On all Posts / On all Static pages unless you really know what are you doing
  • If you don’t see inserted code block turn on debugging functions: Label inserted blocks, Show available positions for automatic insertion (Ad Inserter menu item in the WordPress toolbar on the top of every post/page)

Few examples for automatic insertion are described on the Common settings page. Please make sure you have also read WARNINGS on the bottom of this page and instructions for Debugging.

Settings

Each code block has a name and settings which are divided into sections. Some settings depend also on automatic insertion used. To rename code block click on the block name.
Check Simple editor to switch to simple editor for mobile devices. If you have PHP code (surrounded with PHP tags <?php
?>
) in code block, you need to check Process PHP to enable PHP processing.
When you are finished with settings you need to save them by clicking on the button Save Settings.

Each code block has 4 insertion options:

  • Automatic Insertion
  • Widget
  • Shortcode
  • PHP function call

Normally for each code block you use only one insertion option.
Of course, you can use all 4 options simultaneously taking into account that all insertion options use the same block settings (with some exceptions mentioned below).

To insert code block and display ad at some position you need to enable and use at least one insertion option.

Automatic Insertion Options:

  • Insert Before Post (before post or posts on blog pages, previously named Before Title)
  • Insert Before Content (before post or static page text)
  • Insert Before Paragraph (on posts, static pages and blog pages)
  • Insert After Paragraph (on posts, static pages and blog pages)
  • Insert After Content (after post or static page text)
  • Insert After Post (after post or posts on blog pages)
  • Insert Before Excerpt (on blog pages)
  • Insert After Excerpt (on blog pages)
  • Insert Between Posts (on blog pages)
  • Insert Before Comments (on posts)
  • Insert Between Comments (on posts)
  • Insert After Comments (on posts)
  • Insert into HTML Footer (before </body> tag)
  • Insert at custom hook positions (define them on the tab * / tab Hooks)

For single posts or static pages insertion position Before Post usually means position above the post/page title, for blog pages Before Post position means position above all the posts on the blog page.

For single posts or static pages insertion position After Post means position below the post/page after all the content, for blog pages After Post position means position below all the posts on the blog page.

Please use Show positions function to see available positions for automatic insertion (Ad Inserter menu item in the WordPress toolbar on the top of every post/page).

Block Alignment and Style:

  • No Wrapping (leaves ad code as it is, otherwise it is wrapped by a div)
  • Custom CSS (You can enter custom CSS code for wrapping div)
  • Default (simple div with thin margin)
  • Align Left
  • Align Right
  • Center
  • Float Left (ad on left with wrapped text on right)
  • Float Right (ad on right with wrapped text on left)

[ Preview ]

Ad Inserter has a very useful function that can help you to check if the ad code is working and to see how it will look like when it will be inserted. Click on the Preview button to open Preview window.
WARNING: Some adblockers may block code on the Ad Inserter preview window. If you see warning PAGE BLOCKED or you don’t see your code and the widow elements are distorted, make sure you have disabled ad blockers.
On the top of the window there is visual CSS editor and four buttons and below there is CSS code of the wrapping div (which can be edited manually) and ‘Block Alignment and Style’ selection.

Below the settings there is a preview of the saved code between two dummy paragraphs. Here you can test various block alignments, visually edit margin and padding values of the wrapping div or write CSS code directly
and watch live preview. Highlight button highlights background, wrapping div margin and code area, while Reset button restores all the values to those of the current block.
You can resize the window (and refresh the page to reload ads) to check display with different screen widths. Once you are satisfied with alignment click on the Use button and the settings will be copied to the active block.

Please note that the code displayed here is the code that is saved for this block, while block name, alignment and style are taken from the current block settings (may not be saved).
No Wrapping style inserts the code as it is so margin and padding can’t be set. However, you can use own HTML code for the block.

Please note that Preview window uses also Header and Footer code.

Check screenshots for explanation on alignment.

CACHING

Keep in mind that just installing a caching plugin does not necessarily make your site faster. Doing a bit of optimization will get you a lot of speed increase without caching plugins.
To further combat slowness you may want to re-evaluate the performance of your hosting package. Maybe you’ve outgrown it. In that case, upgrade to a better hosting solution.

Caching on the frontend side (what visitors see) in some cases does speed up page loading but may also cause some unwanted behavior.
When you are using caching and visitor visits some page, WordPress creates that page, Ad Inseter is called to do the job, the created page is sent to the visitor and it is also saved for quicker serving later.
The next time the page is visited the visitor gets cached (saved) page. Because of this some Ad Inserter functions can not work because Ad Inserter is not called when the page is cached:

  • Server-side block rotation with [ADINSERTER ROTATE] (or old separator |rotate|)
  • User check
  • Server-side device detection
  • Referer check
  • Server-side GEO targeting (country detection, Pro only)
  • Server-side IP address detection (Pro only)
  • Debugging functions

When you need the functions listed above you have to switch off caching (if possible only on selected pages where needed).

However, Ad Inserter also supports some of the functions above even when caching is enabled:

  • Client-side ad rotation with [ADINSERTER ROTATE] (or old separator |rotate|)
  • Client-side device detection
  • Client-side GEO targeting (country detection, Pro only)
  • Client-side IP address detection (Pro only)

All you have to do is to set enable and use client-side functions (executed in the visitor’s browser). But you have to be careful as some adverts might not work properly or can’t be used this way and you might violate their Terms of Service.

PLEASE NOTE: If you are using W3 Total Cache for caching then you can still use server-side ad rotation, IP address and country detection even when the pages are cached as Ad Inserter supports special features of this caching plugin.

W3 Total Cache

If you are using W3 Total Cache for caching then you can still use server-side ad rotation, IP address and country detection even when the pages are cached as Ad Inserter supports special features of this caching plugin.
To enable this mode go to Ad Inserter plugin settings tab * / tab General and set Dynamic blocks to Server-side with W3 Total Cache and configure W3 Total Cache for dynamic content.

When Dynamic blocks is set to Server-side with W3 Total Cache and you are using ad rotation, IP address or country detection, Ad Inserter inserts short PHP code with special tags in place of code block. When W3 Total Cache plugin loads cached page it executes this code before it serves the pages. So the page is stills served from the cache but the Ad Inserter blocks are dynamically created just before the page is served. Therefore, pages are served from the cache and the Ad Inserter code is still generated on the server-side.

Configure W3 Total Cache

How to fully set up W3 Total Cache is beyond the scope of this page. Check the W3 Total Cache manuals or contact its developer for help with that if you need it.

  • In General Settings set the Page Caching to Disk: Basic.
  • In Page Cache under Advanced enable Late Initialization.
  • If you use the Minify option add mfunc to the ignored comment stem field.

You need to flush the cache after making these changes.

Please note also the following:

  • Mixing static cached and dynamic content is a tricky thing to do and often causes all kinds of issues. Ad Inserter follows the guidelines from W3 Total Cache on this. If it doesn’t work it’s very likely you didn’t configure W3 Total Cache correctly. Alternatively, you can decide to use client-side option for dynamic blocks – your adverts will show up just fine and rotation and GEO targeting will still work.
  • In order to use dynamic content with W3 Total Cache, W3TC_DYNAMIC_SECURITY PHP constant needs to be defined. Usually it is located in the wp-confing.php file. This is a security string used when generating PHP code for dynamic content. If this constant is not defined, Ad Inserter will define and use it.
  • Do not use debugging functions when caching is activated.
  • When you make changes in settings of the W3 Total Cache purge all caches before you check page.
  • After you activate W3 Total Cache plugin go to General Settings and Save all settings.

Ad rotation

To use client-side rotation you have to enable it first. Go to Ad Inserter plugin settings tab * / tab General and set Dynamic blocks to Client-side.

Configure blocks normally and separate different versions with [ADINSERTER ROTATE] shortcode. When the page will be created and Ad Inserter called, it will generate hidden code for all block versions. When the page will be loaded in the browser, one randomly chosen version of the code will be displayed. For example, to rotate 3 images:

<img style='height: 400px;' src="http://malsup.github.io/images/p1.jpg">
[ADINSERTER ROTATE]
<img style='height: 400px;' src="http://malsup.github.io/images/p2.jpg">
[ADINSERTER ROTATE]
<img style='height: 400px;' src="http://malsup.github.io/images/p3.jpg">

Please note the following:

  • Client-side rotation works fine with banners, text ads and many ad networks including Amazon Associates. However, it should not be used with some ad networks including AdSense (hiding ad units is not allowed) because of the method used for client-side rotation: all options are present on the page but are hidden until the page is loaded and one option is made visible. Please check Terms of Service for your ad network.
  • Ad Inserter reserves space for code block based on the height of the first block version. If all the versions have the same height then you won’t notice anything. However, if block versions have different heights then it makes sense to define fixed block height with Custom CSS to avoid content jumping when block option with different or initially unknown height is displayed. If the first option is some Javascript based ad (e.g. Amazon widget) you should wrap it with a div and define height, for example <div style="height: 300px;"> ... </div>
  • Since the code (block option) is displayed only when the page is loaded, you may notice a very short delay (few 100 ms) before the code (or ad) is displayed.
  • Client-side rotation uses div elements to wrap the code(s). This is not important unless you use No wrapping style.

WARNING: If you are using caching, the inserted code may not appear immediately on the page. Make sure you disable caching when you are testing or debugging.
Some caching plugins like WP Super Cache and W3 Total Cache have an option to disable caching for known (logged in) users.

DEBUGGING

Ad Inserter has many debugging functions that can help you to diagnose the problem when you don’t see your ads at expected positions.

  • Code preview: click on the Preview button 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 code. If you don’t see the ad displayed here it is very likely that the code is not working properly.
  • Debugger Widget: Place Debugger widget in some widget area to see 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.
  • Debugger Shortcode: Place shortcode [adinserter block=”0″] or [adinserter name=”Debugger”] into post or static page to see basic WordPress page and Ad Inserter data

Each post/page has a WordPress toolbar on the top. Ad Inserter menu (visible only to administrators and can be hidden) item has the following debugging functions:

  • Label Blocks: Each inserted block is labeled with a thin red border and red bar with block number, name and counters. Blocks that use client-side detection and are hidden are shown with blue bar and viewport name – resize the browser to check display for other devices (or screen widths). If you see only red bar then this means that the block with your code is inserted but the code doesn’t display anything.
  • Show Positions: Enable this function to show available positions for automatic insertion. Displayed positions are based on the theme layout and configured paragraph counting. You can choose between all paragraph tag lists (or counting parameters) used for blocks configured for Before or After paragraph. If you click on the Show Positions menu item you’ll see default paragraph positions for p tags.
  • Show HTML tags: Enable this function to see HTML tags used in the post. Use this function to determine post structure in order to configure paragraph counting.
  • Disable insertion: 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.
  • Log Processing: 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

WARNING: Make sure caching is disabled while debugging! All debugging functions you enable will be visible only to you!

When browsing other pages on the website debugging settings are temporarily saved (in a cookie). To disable all debugging functions click on the ‘Ad Inserter’ top menu item in the toolbar (or use ai-debug=0)

If you enable Remote debugging you can also allow other people using url parameters to see post/page with debugging data. Remote debugging option is located on the Ad Inserter Settings tab – Debugging tab below.
Remote debugging enables other, non-logged in users by using url parameters to see Debugger widget and code insertion debugging (blocks, positions, tags, processing).
Enable this option (and disable caching) to allow other people to see Debugger widget, labeled blocks and positions in order to help you to diagnose problems. For logged in administrators debugging via url is always enabled.

Please support plugin development

If you are using Ad Inserter and you like it, then please write about it and spread the word on the review page.

Positive reviews are a great way to show your appreciation for my work. Besides being an incredible boost to my morale, they are also a great incentive to fix any bug found in the software and to add new features for better monetization of your website.

Support the advancement of this plugin:

FAQ

Installation Instructions

Using The WordPress Dashboard

  1. Go to WordPress Plugins menu, click Add New button
  2. Search for ad inserter
  3. Click ‘Install Now’
  4. Activate Ad Inserter on the Plugin dashboard

Uploading plugin file

  1. Go to WordPress Plugins menu, click Add New button
  2. Click Upload Plugin
  3. Select ad-inserter.zip from your computer
  4. Click ‘Install Now’
  5. Activate Ad Inserter in the Plugin dashboard

Using FTP

  1. Download ad-inserter.zip
  2. Extract ad-inserter directory to your computer
  3. Upload ad-inserter directory to the /wp-content/plugins/ directory
  4. Activate Ad Inserter in the Plugin dashboard

Ad Inserter Pro Installation

If you are using free Ad Inserter then first uninstall it. The Pro version will automatically import existing settings from the free version.
After you receive the email with download link for the Ad Inserter Pro plugin, download it, go to WordPress Plugins, Add New, Upload Plugin, Choose file, click on Install Now,
activate it and then click “Enter License Key” and enter license key you got in the email.

Uploading plugin file

  1. Go to WordPress Plugins menu, click Add New button
  2. Click Upload Plugin
  3. Select ad-inserter-pro.zip from your computer
  4. Click ‘Install Now’
  5. Activate Ad Inserter Pro in the Plugin dashboard
  6. Click “Enter License Key” or go to plugin Settings / tab * and enter license key you got in the email

Using FTP

  1. Download ad-inserter-pro.zip
  2. Extract ad-inserter-pro directory to your computer
  3. Upload ad-inserter-pro directory to the /wp-content/plugins/ directory
  4. Activate Ad Inserter Pro in the Plugin dashboard

Uninstall

If you deactivate and delete Ad Inserter, the settings will stay in the database. To completely remove the plugin and settings do the following:

  1. Go to Ad Inserter general settings (tab *) and click on Reset All Settings
  2. Go to Ad Inserter general settings (tab *) and click on Clear All Statistics Data
  3. Deactivate Ad Inserter
  4. Delete Ad Inserter plugin

Quick Start

Few very important things you need to know in order to insert code and display some ad:

  • Code block is any code (for example AdSense ad) that has to be inserted (and displayed) at some position. Each code block can be configured to insert code at almost any position supported by WordPress
  • Enable and use at least one insertion option (Automatic insertion, Widget, Shortcode, PHP function call)
  • Enable insertion on at least one WordPress page type (Posts, Static pages, Homepage, Category pages, Search Pages, Archive pages)
  • For Posts and static pages select default value On all Posts / On all Static pages unless you really know what are you doing
  • If you don’t see inserted code block turn on debugging functions: Label inserted blocks, Show available positions for automatic insertion (Ad Inserter menu item in the WordPress toolbar on the top of every post/page)

Few examples for automatic insertion are described on the Common settings page. Please make sure you have also read WARNINGS on the bottom of this page and instructions for Debugging.

Settings

Each code block has a name and settings which are divided into sections. Some settings depend also on automatic insertion used. To rename code block click on the block name.
Check Simple editor to switch to simple editor for mobile devices. If you have PHP code (surrounded with PHP tags <?php
?>
) in code block, you need to check Process PHP to enable PHP processing.
When you are finished with settings you need to save them by clicking on the button Save Settings.

Each code block has 4 insertion options:

  • Automatic Insertion
  • Widget
  • Shortcode
  • PHP function call

Normally for each code block you use only one insertion option.
Of course, you can use all 4 options simultaneously taking into account that all insertion options use the same block settings (with some exceptions mentioned below).

To insert code block and display ad at some position you need to enable and use at least one insertion option.

Automatic Insertion Options:

  • Insert Before Post (before post or posts on blog pages, previously named Before Title)
  • Insert Before Content (before post or static page text)
  • Insert Before Paragraph (on posts, static pages and blog pages)
  • Insert After Paragraph (on posts, static pages and blog pages)
  • Insert After Content (after post or static page text)
  • Insert After Post (after post or posts on blog pages)
  • Insert Before Excerpt (on blog pages)
  • Insert After Excerpt (on blog pages)
  • Insert Between Posts (on blog pages)
  • Insert Before Comments (on posts)
  • Insert Between Comments (on posts)
  • Insert After Comments (on posts)
  • Insert into HTML Footer (before </body> tag)
  • Insert at custom hook positions (define them on the tab * / tab Hooks)

For single posts or static pages insertion position Before Post usually means position above the post/page title, for blog pages Before Post position means position above all the posts on the blog page.

For single posts or static pages insertion position After Post means position below the post/page after all the content, for blog pages After Post position means position below all the posts on the blog page.

Please use Show positions function to see available positions for automatic insertion (Ad Inserter menu item in the WordPress toolbar on the top of every post/page).

Block Alignment and Style:

  • No Wrapping (leaves ad code as it is, otherwise it is wrapped by a div)
  • Custom CSS (You can enter custom CSS code for wrapping div)
  • Default (simple div with thin margin)
  • Align Left
  • Align Right
  • Center
  • Float Left (ad on left with wrapped text on right)
  • Float Right (ad on right with wrapped text on left)

[ Preview ]

Ad Inserter has a very useful function that can help you to check if the ad code is working and to see how it will look like when it will be inserted. Click on the Preview button to open Preview window.
WARNING: Some adblockers may block code on the Ad Inserter preview window. If you see warning PAGE BLOCKED or you don’t see your code and the widow elements are distorted, make sure you have disabled ad blockers.
On the top of the window there is visual CSS editor and four buttons and below there is CSS code of the wrapping div (which can be edited manually) and ‘Block Alignment and Style’ selection.

Below the settings there is a preview of the saved code between two dummy paragraphs. Here you can test various block alignments, visually edit margin and padding values of the wrapping div or write CSS code directly
and watch live preview. Highlight button highlights background, wrapping div margin and code area, while Reset button restores all the values to those of the current block.
You can resize the window (and refresh the page to reload ads) to check display with different screen widths. Once you are satisfied with alignment click on the Use button and the settings will be copied to the active block.

Please note that the code displayed here is the code that is saved for this block, while block name, alignment and style are taken from the current block settings (may not be saved).
No Wrapping style inserts the code as it is so margin and padding can’t be set. However, you can use own HTML code for the block.

Please note that Preview window uses also Header and Footer code.

Check screenshots for explanation on alignment.

CACHING

Keep in mind that just installing a caching plugin does not necessarily make your site faster. Doing a bit of optimization will get you a lot of speed increase without caching plugins.
To further combat slowness you may want to re-evaluate the performance of your hosting package. Maybe you’ve outgrown it. In that case, upgrade to a better hosting solution.

Caching on the frontend side (what visitors see) in some cases does speed up page loading but may also cause some unwanted behavior.
When you are using caching and visitor visits some page, WordPress creates that page, Ad Inseter is called to do the job, the created page is sent to the visitor and it is also saved for quicker serving later.
The next time the page is visited the visitor gets cached (saved) page. Because of this some Ad Inserter functions can not work because Ad Inserter is not called when the page is cached:

  • Server-side block rotation with [ADINSERTER ROTATE] (or old separator |rotate|)
  • User check
  • Server-side device detection
  • Referer check
  • Server-side GEO targeting (country detection, Pro only)
  • Server-side IP address detection (Pro only)
  • Debugging functions

When you need the functions listed above you have to switch off caching (if possible only on selected pages where needed).

However, Ad Inserter also supports some of the functions above even when caching is enabled:

  • Client-side ad rotation with [ADINSERTER ROTATE] (or old separator |rotate|)
  • Client-side device detection
  • Client-side GEO targeting (country detection, Pro only)
  • Client-side IP address detection (Pro only)

All you have to do is to set enable and use client-side functions (executed in the visitor’s browser). But you have to be careful as some adverts might not work properly or can’t be used this way and you might violate their Terms of Service.

PLEASE NOTE: If you are using W3 Total Cache for caching then you can still use server-side ad rotation, IP address and country detection even when the pages are cached as Ad Inserter supports special features of this caching plugin.

W3 Total Cache

If you are using W3 Total Cache for caching then you can still use server-side ad rotation, IP address and country detection even when the pages are cached as Ad Inserter supports special features of this caching plugin.
To enable this mode go to Ad Inserter plugin settings tab * / tab General and set Dynamic blocks to Server-side with W3 Total Cache and configure W3 Total Cache for dynamic content.

When Dynamic blocks is set to Server-side with W3 Total Cache and you are using ad rotation, IP address or country detection, Ad Inserter inserts short PHP code with special tags in place of code block. When W3 Total Cache plugin loads cached page it executes this code before it serves the pages. So the page is stills served from the cache but the Ad Inserter blocks are dynamically created just before the page is served. Therefore, pages are served from the cache and the Ad Inserter code is still generated on the server-side.

Configure W3 Total Cache

How to fully set up W3 Total Cache is beyond the scope of this page. Check the W3 Total Cache manuals or contact its developer for help with that if you need it.

  • In General Settings set the Page Caching to Disk: Basic.
  • In Page Cache under Advanced enable Late Initialization.
  • If you use the Minify option add mfunc to the ignored comment stem field.

You need to flush the cache after making these changes.

Please note also the following:

  • Mixing static cached and dynamic content is a tricky thing to do and often causes all kinds of issues. Ad Inserter follows the guidelines from W3 Total Cache on this. If it doesn’t work it’s very likely you didn’t configure W3 Total Cache correctly. Alternatively, you can decide to use client-side option for dynamic blocks – your adverts will show up just fine and rotation and GEO targeting will still work.
  • In order to use dynamic content with W3 Total Cache, W3TC_DYNAMIC_SECURITY PHP constant needs to be defined. Usually it is located in the wp-confing.php file. This is a security string used when generating PHP code for dynamic content. If this constant is not defined, Ad Inserter will define and use it.
  • Do not use debugging functions when caching is activated.
  • When you make changes in settings of the W3 Total Cache purge all caches before you check page.
  • After you activate W3 Total Cache plugin go to General Settings and Save all settings.

Ad rotation

To use client-side rotation you have to enable it first. Go to Ad Inserter plugin settings tab * / tab General and set Dynamic blocks to Client-side.

Configure blocks normally and separate different versions with [ADINSERTER ROTATE] shortcode. When the page will be created and Ad Inserter called, it will generate hidden code for all block versions. When the page will be loaded in the browser, one randomly chosen version of the code will be displayed. For example, to rotate 3 images:

<img style='height: 400px;' src="http://malsup.github.io/images/p1.jpg">
[ADINSERTER ROTATE]
<img style='height: 400px;' src="http://malsup.github.io/images/p2.jpg">
[ADINSERTER ROTATE]
<img style='height: 400px;' src="http://malsup.github.io/images/p3.jpg">

Please note the following:

  • Client-side rotation works fine with banners, text ads and many ad networks including Amazon Associates. However, it should not be used with some ad networks including AdSense (hiding ad units is not allowed) because of the method used for client-side rotation: all options are present on the page but are hidden until the page is loaded and one option is made visible. Please check Terms of Service for your ad network.
  • Ad Inserter reserves space for code block based on the height of the first block version. If all the versions have the same height then you won’t notice anything. However, if block versions have different heights then it makes sense to define fixed block height with Custom CSS to avoid content jumping when block option with different or initially unknown height is displayed. If the first option is some Javascript based ad (e.g. Amazon widget) you should wrap it with a div and define height, for example <div style="height: 300px;"> ... </div>
  • Since the code (block option) is displayed only when the page is loaded, you may notice a very short delay (few 100 ms) before the code (or ad) is displayed.
  • Client-side rotation uses div elements to wrap the code(s). This is not important unless you use No wrapping style.

WARNING: If you are using caching, the inserted code may not appear immediately on the page. Make sure you disable caching when you are testing or debugging.
Some caching plugins like WP Super Cache and W3 Total Cache have an option to disable caching for known (logged in) users.

DEBUGGING

Ad Inserter has many debugging functions that can help you to diagnose the problem when you don’t see your ads at expected positions.

  • Code preview: click on the Preview button 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 code. If you don’t see the ad displayed here it is very likely that the code is not working properly.
  • Debugger Widget: Place Debugger widget in some widget area to see 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.
  • Debugger Shortcode: Place shortcode [adinserter block=”0″] or [adinserter name=”Debugger”] into post or static page to see basic WordPress page and Ad Inserter data

Each post/page has a WordPress toolbar on the top. Ad Inserter menu (visible only to administrators and can be hidden) item has the following debugging functions:

  • Label Blocks: Each inserted block is labeled with a thin red border and red bar with block number, name and counters. Blocks that use client-side detection and are hidden are shown with blue bar and viewport name – resize the browser to check display for other devices (or screen widths). If you see only red bar then this means that the block with your code is inserted but the code doesn’t display anything.
  • Show Positions: Enable this function to show available positions for automatic insertion. Displayed positions are based on the theme layout and configured paragraph counting. You can choose between all paragraph tag lists (or counting parameters) used for blocks configured for Before or After paragraph. If you click on the Show Positions menu item you’ll see default paragraph positions for p tags.
  • Show HTML tags: Enable this function to see HTML tags used in the post. Use this function to determine post structure in order to configure paragraph counting.
  • Disable insertion: 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.
  • Log Processing: 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

WARNING: Make sure caching is disabled while debugging! All debugging functions you enable will be visible only to you!

When browsing other pages on the website debugging settings are temporarily saved (in a cookie). To disable all debugging functions click on the ‘Ad Inserter’ top menu item in the toolbar (or use ai-debug=0)

If you enable Remote debugging you can also allow other people using url parameters to see post/page with debugging data. Remote debugging option is located on the Ad Inserter Settings tab – Debugging tab below.
Remote debugging enables other, non-logged in users by using url parameters to see Debugger widget and code insertion debugging (blocks, positions, tags, processing).
Enable this option (and disable caching) to allow other people to see Debugger widget, labeled blocks and positions in order to help you to diagnose problems. For logged in administrators debugging via url is always enabled.

Please support plugin development

If you are using Ad Inserter and you like it, then please write about it and spread the word on the review page.

Positive reviews are a great way to show your appreciation for my work. Besides being an incredible boost to my morale, they are also a great incentive to fix any bug found in the software and to add new features for better monetization of your website.

Support the advancement of this plugin:

I have activated Ad Inserter. How can I use it?
  1. After activation, click “Settings / Ad Inserter” to access the settings page
  2. Put ad (or any other HTML/Javascript/PHP) code into the ad box
  3. Set automatic insertion option (for example: Before Post)
  4. Enable at least one page type (for example: Posts, some insertion options don’t work on all page types)
  5. Save settings
  6. Check also common Ad Inserter settings
  7. Check inserted code on the posts
  8. Ads are not showing? Check troubleshooting guide to find out what to check to fix the problem.
I have installed code for AdSense ads but the ad blocks are blank.

If you get blank ads then this might be because there is some error in the code (wrong IDs), your AdSense account is not fully approved yet, your website was not accepted or your AdSense account is banned.
In such case you can try other ad networks for contextual ads. Check Ads Not Displayed for more information.

Settings for widget
  • Nothing needed, just enter the code and save settings – widget is enabled by default
  • Go to Appearance / Widgets, drag Ad Inserter widget to the sidebar or any other widget position, select code block and click on Save
  • Optionally you can enable Sticky widget – this means that this widget (and widgets below) will stay fixed in the sidebar when the page is scrolled – Sticky Sidebar
  • You can also make other widgets sticky even if you don’t use Ad Inserter widgets – drag Ad Inserter widget to the sidebar ABOVE the top widget that needs to be sticky, select Dummy Widget for Block, check Sticky and save widget
  • In general plugin settings (tab *) you can also define Sticky Widget Top Margin to precisely define top position where the first sticky widget will stick

Additional note regarding Sticky WidgetsSticky Sidebars:

There are two modes for sticky widgets (or sticky sidebars) available as Sticky widget mode in general plugin settings (tab *):

  • CSS mode – This mode is the best approach but may not work with all themes. CSS mode works by changing sidebar CSS to position: sticky. This works with most themes but not all. If your widgets and sidebar aren’t sticking as expected you can use JavaScript mode described below.
  • JavaScript mode – This mode should work with practically all themes but may reload ads on page load when sticky sidebar is initialized.
Settings for contextual Amazon Native Shopping Ads
  • Automatic Insertion: After Content
  • On all Posts checked, other page types unchecked

Sign in to Amazon Associates, go to Widgets/Widget Source, choose ad type and set parameters.
For titles and search terms use tags. For example, the code below would display amazon products related to the post tags – check documentation for all possible tags.

<script type="text/javascript">
amzn_assoc_placement = "adunit0";
amzn_assoc_search_bar = "true";
amzn_assoc_tracking_id = "ad-inserter-20";
amzn_assoc_search_bar_position = "top";
amzn_assoc_ad_mode = "search";
amzn_assoc_ad_type = "smart";
amzn_assoc_marketplace = "amazon";
amzn_assoc_region = "US";
amzn_assoc_title = "Search Results from Amazon";
amzn_assoc_default_search_phrase = "[adinserter data='smart-tag']";
amzn_assoc_default_category = "All";
amzn_assoc_linkid = "cf1873f027a57f63cede634cfd444bea";
</script>
<script src="//z-na.amazon-adsystem.com/widgets/onejs?MarketPlace=US"></script>

Use your own tracking id! Please note [adinserter data='smart_tag'] as default search phrase. This makes this widget contextual. It will show products related to the tags for this post.

You can also use custom fields to make the widget contextual. For example, if you define in posts custom field named amazon-keyword you can use [adinserter custom-field='amazon-keyword']' foramzn_assoc_default_search_phrase` variable.

You can also try with [adinserter data='tag']',[adinserter data=’short-title’],[adinserter data=’category’]or[adinserter data=’short-category’]`. For more options check Ad Inserter documentation page.

Settings for …

Check common Ad Inserter settings

I wish to show ads side by side but not in the same block. How do I do this?

Configure block 1 and 2 with ads using:

  • Automatic Insertion: Disabled
  • Block Alignment and Style: No Wrapping
  • Enable shortcode: checked

Configure block 3 with

[adinserter block="1"]
[adinserter block="2"]

Use block 3 to insert ads and make sure all 3 blocks are enabled for the same page types (Posts, Pages, Homepage, etc.).

I use After Content insertion position but the code is inserted after the stuff provided by other plugins. How can I insert directly after post content?

This happens because Ad Inserter processes posts last and therefore “sees” also content added by other plugins.

Try to set Ad Inserter plugin priority to 10 (early processing, Ad Inserter settings – tab * / tab General).

How can I replace deprecated tags {adinserter n} for manual insertion with new ones [adinserter block=”n”] in all posts?

Use Search Regex plugin to replace tags in all posts with few clicks. If you are not familiar with regular expressions simply use search and replace text for each code block. Use Replace to test replacements and when it works as expected use Replace & Save.

How can I add some text or title (e.g. Advertisement) above the ad?

If this is a sidebar widget then you can simply name the widget. In other cases you can add title HTML code above ad code. For example:

<h3>Advertisement</h3>

AD_CODE

Change the title tag according to the theme style.

I like the plugin. How can I support it?
How can I enable/disable ads on specific posts/pages?

There are two possible approaches.

  • Approach with page/post exceptions – use this one if there are many exceptions (more than two):
  1. Go to Ad Inserter settings page and define default insertion options for post/page.
  2. Enable automatic insertion on posts/pages and choose default insertion: Individually disabled or Individually enabled.
  3. Save settings.
  4. Go to post/page editor and open Ad Inserter Individual Exceptions meta box below.
  5. define insertion exceptions for this post or page.
  6. Save post/page.

Individually disabled means that insertion will be by default enabled on all posts (according to the settings for this code block), but you will be able to disable insertion on individual posts or pages (in post/page editor).

Individually enabled means that insertion will be by default disabled on all posts, but you will be able to enable insertion on individual posts or pages (in post/page editor) – of course, other settings (e.g. lists) for this code block will also apply.

  • Approach with code block settings only – use this one if there are only few exceptions:
  1. Go to Ad Inserter settings page and define default insertion options for post/page.
  2. Enable automatic insertion for Posts/Pages (use default value after checkbox – blank selection means no individual exceptions).
  3. Click on Lists, enter url (or space separated urls) for Urls, e.g. /permalink-url, and white-list or black-list it.

For details check Individual Post/Page Exceptions.

I’m using responsive theme. How can I show or hide some ads on mobile devices?

Select device types (desktop, tablet or phone) for which you need to show ads and enable only client-side device detection.

Which device type detection should I use?

In most cases you should use ONLY client-side detection. All code blocks are generated, however, they are displayed according to settings and browser’s screen width using CSS Media Queries. This works perfectly in responsive designs.

How can I disable ads for direct visitors?

Blacklist # as referer for visitors that enter web address directly into browser (no referer).
Blacklist yourdomain.com as referer for visitors that browse your website yourdomain.com.
To blacklist both enter yourdomain.com, #

How can I disable ads on error 404 page?

This is disabled by default. Uncheck Error 404 Page checkbox (button Misc).

Is there a way to display country flag of the visitor?

Possible if you are using Ad Inserter Pro. In the header put the following code:

<link rel='stylesheet' href='/wp-content/plugins/ad-inserter/css/flags.css' type='text/css' media='all' />

In the code block use the following code for flag

<span class="flag-icon flag-icon-[adinserter data='country-iso2']" style="width: 400px; height: 300px;"></span>

Adjust width and height according to your needs. Please not that [adinserter data='country_iso2'] tag works only server-side – it won’t work on cached pages.
Of course, you can also use static code for flags. For example, for United States:

<span class="flag-icon flag-icon-us" style="width: 400px; height: 300px;"></span>
How can I enable or disable ads on group of similar pages?

If those pages have something in common in the url (page address) then you can block them with url patterns.
Use * to define url pattern to whitelist (enable) or blacklist (disable).

  1. To filter all urls starting with /url-start use /url-start*
  2. To filter all urls that contain url-pattern use *url-pattern*
  3. To filter all urls ending with url-end use *url-end

For example, to exclude ads on pages that have /shop/ in url (page address) blacklist the following url: */shop/*

WARNING: Separate urls with SPACES.

How can I put an ad in the middle of the post regardless of the number of paragraphs?

Use Before paragraph automatic insertion and put 0.5 as paragraph number. Value between 0 and 1 means relative position in post or page (e.g. 0.3 means paragraph 30% from top or bottom)

How can I put an ad before the second paragraph and one in the middle of post with single ad block?

Use Before paragraph automatic insertion and put 2, 0.5 as paragraph number. You can specify multiple paragraphs as comma separated paragraph numbers (or relative postions).

I’d like to rotate my ad codes based on percentage, for example show one ad 75% of the time and another one 25% of the time. Is that possible?

Yes, simply create block with 4 ads separated with [ADINSERTER ROTATE]: 3 times ad1 and 1 time ad2.

How can I show different ads to different visitors according to a url query parameter?

Use Url parameters List to black/white-list certain url parameters. Leave url parameter list empty and set it to Black list to show ads for all url.
You can specify either parameters or parameters with values. For example for url http://example.com?data=2&customer-id=22&device=0 you can define url parameters ‘data, customer-id=22‘ to insert ad only for urls where there is data parameter and customer-id parameter with value 22.
Separate parameters with comma.

How can I use PHP code for code block?

Enter PHP code surrounded by PHP tags and check Process PHP.
Example:

<div style="width: 100%;">
Some HTML/Javascript code
</div>
<?php echo "PHP code by Ad Inserter"; ?>
How can I insert post category name into my ad code?
  1. Use [adinserter data='category'] in the ad. This will be replaced with the post category name.
  2. You can also use
  • [adinserter data='title'] – Title of the post
  • [adinserter data='short-title'] – Short title (first 3 words) of the post title
  • [adinserter data='category'] – Category of the post (or short title if there is no category)
  • [adinserter data='short-category'] – First words before “,” or “and” of the category of the post (or short title if there is no category)
  • [adinserter data='tag'] – The first tag or general tag (button Misc / tab General) if the post has no tags (works only inside posts)
  • [adinserter data='smart-tag'] – Smart selection of post tag in the following order:
    • If there is no tag then the category is used;
    • If there is a two-word tag then it is used;
    • If the first tag is a substring of the second (or vice versa) then the first tag is not taken into account
    • If the first and second tags are single words then both words are used
    • First three words of the first tag
    • General tag (button Misc / tab General)
  • [adinserter data='search-query'] – Search engine query that brought visitor to your website (supports Google, Yahoo, Bing and Ask search engines), [adinserter data=’smart_tag} is used when there is no search query. You need to disable caching to use this tag. Please note that most search queries are now encrypted.
  • [adinserter data='author'] – Post author username (works only inside posts)
  • [adinserter data='author-name'] Post author name (works only inside posts)
  • [adinserter custom-field='CUSTOM_FIELD_NAME'] – Custom fields as defined in posts

For all options check Ad Inserter documentation page.

How can I rotate few versions of the same ad?

Enter them into the ad box and separate them with [ADINSERTER ROTATE]. Ad Inserter will insert them randomly.
Example:

ad_code_1
[ADINSERTER ROTATE]
ad_code_2
[ADINSERTER ROTATE]
ad_code_3
What settings should I use for ads on AMP pages?

Normally the code will not be inserted on AMP pages. There are two settings that can be used to insert code on AMP pages:

  1. AMP pages checkbox in Misc / Insertion section – If checked it enables insertion also on AMP pages. Use this approach only if you need to insert the same code on normal and AMP pages. To insert different codes on AMP pages use [ADINSERTER AMP] separator as described below.
  2. Separate the codes with [ADINSERTER AMP] separator – the code above the separator will be inserted on normal pages, the code below the separator will be inserted on AMP pages. This separator can be used also for Header and Footer code.

The following AMP plugins have been tested with Ad Inserter:
* AMP for WP – Accelerated Mobile Pages (free)
* AMP (free)
* WP AMP Ninja (free)
* WP AMP – Accelerated Mobile Pages for WordPress (paid – you need to uncheck Remove third-party the_content hooks for better compatibility)

For details check settings for ads on AMP pages.

How can place ads below Read More tag?

Configure ad block with the following options:

  • Automatic Insertion: After Paragraph
  • Paragraph Number: 1
  • Count only paragraphs that CONTAIN: <span id="more-

Check source code of your website for proper “read more” tag.

How can I insert code block directly into template php file?

Enable PHP function adinserter for code block and call adinserter function with code block number as parameter.
Example for block 3:

<?php if (function_exists ('adinserter')) echo adinserter (3); ?>

This would generate code as defined for the code block number 3. Before you modifu theme files it makes sense to create a child theme first.

Center alignment does not work for some ads!

Some ads can not be centered using the standard approach so some different CSS code is needed to put them in the middle.

In Preview window you can try alternative CSS code for centering the ad. Double-click on the icon for Center alignment and the code will toggle. The current code version is displayed next to Alignment and Style selection.

How can I rotate between different alignments so I can test an ad aligned to the right against an ad aligned to the left?

Set Block Alignment and Style to “No Wrapping” and create manual wrapping around both ads separated with [ADINSERTER ROTATE]:

<div style="float: left; margin: 0 8px 8px 0;">
AD CODE LEFT
</div>

[ADINSERTER ROTATE]

<div style="float: right; margin: 0 0 8px 8px;">
AD CODE RIGHT
</div>

후기

I can’t believe it’s Free!

Great Plugin. I have used several adsense plugins over the past few years and this one is hands down the best one with the most flexibility. Keep up the great work!

Read all 276 reviews

Contributors & Developers

“Ad Inserter – WordPress Ads Management” is open source software. The following people have contributed to this plugin.

Contributors

변경이력

2.2.5

  • Fix for issue with Ajax requests

2.2.4

  • Added support to insert raw HTTP response header lines
  • Added support to check for individual exceptions for shortcodes
  • Added support to trigger ad blocking detection action only on individual pages
  • Added support for automatic insertion position Footer
  • Added support for custom hooks
  • Url parameter list now checks url parameters ($_GET) and cookies ($_COOKIE)
  • Fix for |count| separator not processed

2.2.3

  • Added support to insert custom fields via shortcode [adinserter custom-field=’CUSTOM_FIELD_NAME’]
  • Added support for user:USERNAME and user-role:USER_ROLE taxonomy list items
  • Added support for post-type:POST_TYPE taxonomy list items
  • Added support for JavaScript based sticky widgets
  • Added support for ad blocking statistics (Pro only)
  • Added support for WP AMP and WP AMP Ninja plugins
  • Post/Page Word Count moved to Misc section (now works also on widgets)
  • Few minor bug fixes, cosmetic changes and code improvements

2.2.2

  • Fix for mobile admin layout
  • Few other minor bug fixes

2.2.1

  • Fix for header/footer scripts on AMP pages

2.2.0

  • Added support for ad blocking detection (experimental)
  • Added support for [ADINSERTER AMP] shortcode to separate code for AMP pages
  • Added support for [ADINSERTER ROTATE] and [ADINSERTER COUNT] shortcodes
  • Added syntax highlighting for shortcodes and separators
  • Added option to define minimum number of words in paragraphs above
  • Added support for %N filter item to filter every N-th insertion
  • Added filter support when inserting for all paragraphs
  • Added style clear: both; to Default, Left, Right and Center alignments
  • Bug fix for errors when loading tracking charts (Pro only)
  • Many minor bug fixes, cosmetic changes and code improvements

2.1.14

  • Fix for error when using older PHP versions (prior to 5.5)

2.1.13

  • Fix for Fatal error: Can’t use method return value in write context

2.1.12

  • Added option to define tags inside which paragraphs are not counted
  • Added max insertions check when inserting for all paragraphs
  • Added support for inverted filter
  • Increased nonce lifespan to 48 hours when using tracking (Pro only)
  • Fixed wrong urls in debug menu when behind proxy
  • Few other bug fixes, cosmetic changes and code improvements

2.1.11

  • Improved support for sticky widgets (works with most themes)
  • Added support for ad counting (|count| separator)
  • Added support to black/white-list arbitrary taxonomies (taxonomy, term or taxonomy:term)
  • Added support for automatic insertion before, between and after comments
  • Added processing of shortcodes in the header and footer code
  • Debugging function Show positions shows also page type
  • Fixed page type detection when Post page was set to static page and it was not homepage
  • Few minor bug fixes, cosmetic changes and code improvements

2.1.10

  • Fix for shifted sidebars in some themes

2.1.9

  • Added support for sticky widgets
  • Added support to insert code after images (Automatic Insertion: After Paragraph, Paragraphs with tags: img)
  • Impression and click tracking (beta, Pro only)
  • Few minor bug fixes, cosmetic changes and code improvements

2.1.8

  • Fixed error when using server-side device detection

2.1.7

  • Fixed error when using PHP 5.4 or earlier

2.1.6

  • Added support for insertion before/after multiple paragraphs
  • Added initial support for impression and click tracking (Pro only)
  • Few bug fixes and cosmetic changes

2.1.5

  • Added support to avoid insertion inside <figure> and <li> elements (image captions, lists)
  • Added support for exceptions for custom post types
  • Few minor bug fixes and code improvements

2.1.4

  • Paragraph counting restored to standard functions
  • Added option to select paragraph counting functions with multibyte support (unicode characters)
  • Fixed bug for wrong paragraph counting in posts with blockquote sections in some cases
  • Fixed bug for wrong measuring of plugin processing time in some cases
  • Fixed bug for “Empty delimiter” warning

2.1.3

  • Added support for counting paragraphs with multibyte (unicode) characters
  • Fixed bug for class name not saved
  • Few minor bug fixes and cosmetic changes

2.1.2

  • Fixed bug for disabled settings page on multisite blogs

2.1.1

  • Changes for compatibility with PHP 7.1
  • Automatic rename of old pro plugin slug (Pro only)
  • Added support for additional Pro features (Pro only)
  • Few bug fixes and cosmetic changes

2.1.0

  • Added support to insert ads in Ajax requests (e.g. in infinite scroll)
  • Added support to not include block classes when class name is empty
  • Added sticky positions (Pro only)
  • Bug fix for minimum user role not taken into account for exceptions list
  • Bug fix for IP database update cron event (Pro only)