Ad Inserter – WordPress Ads Management with AdSense Header Integration

説明

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

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

Ad Inserter can insert ads where other plugins fail.
It’s all about the settings.

Endorsed by WordPress users

Average Rating: 5 out of 5 stars

Perfect plugin to insert anything anywhere on your WordPress website

Check Ad Inserter reviews

Endorsed by Google

Google lists Ad Inserter plugin as possible solution to place AdSense ad code into your WordPress site.

If you’re new to AdSense, one of your first tasks is to connect your site to AdSense. This requires you to copy the code on your AdSense homepage and paste it into the HTML of your page, between the <head> and </head> tags.

Check How to insert ad code in your WordPress site. Advanced users can enable AdSense integration: get AdSense ad codes from the plugin settings page – no need to copy ad codes from the AdSense admin pages and paste them to code blocks. List ad units, preview AdSense ads and get ad codes where you need them.

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.

Check WordPress Integration Guide for Native Shopping Ads. Ad Inserter supports also advanced contextual ads: check settings for contextual Native Shopping Ads that show items related to the post content (using post tags).

Features

  • 16 code (ad) blocks
  • AdSense integration
  • Syntax highlighting editor
  • Code preview with visual CSS editor
  • Automatically inserts ads on 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 on page
  • Insert above header (after <body> tag)
  • Insert in footer (before </body> tag)
  • Insert at relative positions 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 (do_action () WP function)
  • Clearance options to avoid insertion near images or headers
  • Insertion exceptions for posts and pages
  • Insert header (<head> section) 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
  • Code generator for banners and placeholders
  • Visual advert editor
  • 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 ads (different ad code) 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
  • Use post title, tags or categories to create contextual ads
  • PHP code processing
  • Ad labels
  • 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
  • Easy copying and pasting code blocks or settings using internal clipboard
  • Simple troubleshooting with many debugging functions
  • Function to visualize inserted code blocks
  • Function to visualize available insertion positions
  • Function to visualize HTML tags
  • You name it 🙂

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

  • 64 code (ad) blocks
  • Geolocation using Webnet77 or MaxMind databases (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)
  • External tracking via Google Analytics or Piwik
  • A/B testing
  • Sticky ad positions with optional close button
  • Sticky sidebar ads (stick to the screen or to the content)
  • Sticky ad trigger (page scroll in % or px, HTML element visible)
  • Sticky ad animations (fade, slide, turn, flip, zoom)
  • 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

Run a WordPress related blog? Interested in reviewing Ad Inserter Pro? Introduce yourself.

Ad Inserter WordPress plugin is an 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.

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:

  • for ad management and ad injection
  • to insert AdSense or Media.net ads
  • to insert affiliate ads (CJ Affiliate by Conversant, ClickBank, ShareASale, Rakuten LinkShare, etc.)
  • to insert ads between paragraphs
  • to insert ads between posts
  • to insert ads between comments
  • to insert ads on custom posts
  • 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 (MailChimp, AWeber, GetResponse, etc.)

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
  • To rename block click on the name
  • If you are using AdSense check available tools and code generator for AdSense code
  • Paste ad code into the code window or use code generator to generate code for banners, AdSense or any other HTML advert
  • 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 Common Settings page. Please make sure you have also read Installation page. For more detailed instructions please read Ad Inserter documentation page.

Insert Any Code Anywhere on the Page

  • Automatic insertion using standard WP hooks (the_content, the_excerpt, loop_start, loop_end, the_post,…)
  • Automatic insertion using custom WP hooks provided by themes (e.g. using Genesis Theme Framework Hooks)
  • Server-side or client-side (javascript) insertion before or after any HTML element on page (using selectors #id, .class)
  • Manual insertion with shortcodes
  • Insertion with widgets
  • Insertion by placing PHP function calls or custom hooks in your theme files

Ad Inserter is the only WordPress plugin that can insert any code anywhere on the page. If standard insertions before/after post, content or paragraph fail you can use advanced insertion before/after arbitrary HTML element.
If you can create a CSS slector for it (#id, .class) then you can insert before or after that element. By default this approach uses client-side insertion using Javascript to insert code block after the page loads.
However, if you enable Output buffering (tab * / tab General) you can select also Server-side insertion which will insert code block the same way as other insertions when the plugin is called and the page is created.
Please note that Output buffering may not work with all themes – in such case you can still use client-side insertion.

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 content). 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 plugin settings
  • Visualization of HTML tags in post
  • Visualization of positions for automatic insertion in post
  • Visualization of inserted block in post
  • Automatic insertion, Alignment and Style settings
  • Rotation code editor and banner code generator
  • Settings for automatic insertion before/after paragraphs
  • Settings for custom hooks
  • Settings automatic insertion at custom hook positions
  • Settings ad blocking detection
  • AdSense code generator
  • 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.

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 (Pro only)
  3. Deactivate Ad Inserter
  4. Delete Ad Inserter plugin

Please Note

Ad Inserter inserts only the code you configure (blocks 1 – 16, Header, Footer). The code you see is the code that will be inserted (+ some internal scripts for plugin features).
When you deactivate Ad Inserter it can’t insert anything as WordPress doesn’t call it. Please check page source code before you make any conclusion.
Of course, if you configure code block with some javacript ad code, then this code may generate ads. But please, don’t blame the plugin for this.
You can also use Ad Inserter to insert code for AdSense Auto ads on each page (usually in the header). However, the exact placement of ads will be done by the ad code, not Ad Inserter!
https://adinserter.pro/adsense-ads#auto-ads

The easiest way to check Ad Inserter code blocks is to use Label blocks debugging function:
https://adinserter.pro/documentation#debugging

When you deactivate Ad Inserter it can’t insert anything – WordPress doesn’t call it. If you still see some ads that were inserted by Ad Inserter, make sure you have cleared all the caches.
If you still see those ads after you have disabled Ad Inserter and cleared all the caches, then the ads were not inserted by Ad Inserter.

Online Documentation

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.

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 (Pro only)
  3. Deactivate Ad Inserter
  4. Delete Ad Inserter plugin

Please Note

Ad Inserter inserts only the code you configure (blocks 1 – 16, Header, Footer). The code you see is the code that will be inserted (+ some internal scripts for plugin features).
When you deactivate Ad Inserter it can’t insert anything as WordPress doesn’t call it. Please check page source code before you make any conclusion.
Of course, if you configure code block with some javacript ad code, then this code may generate ads. But please, don’t blame the plugin for this.
You can also use Ad Inserter to insert code for AdSense Auto ads on each page (usually in the header). However, the exact placement of ads will be done by the ad code, not Ad Inserter!
https://adinserter.pro/adsense-ads#auto-ads

The easiest way to check Ad Inserter code blocks is to use Label blocks debugging function:
https://adinserter.pro/documentation#debugging

When you deactivate Ad Inserter it can’t insert anything – WordPress doesn’t call it. If you still see some ads that were inserted by Ad Inserter, make sure you have cleared all the caches.
If you still see those ads after you have disabled Ad Inserter and cleared all the caches, then the ads were not inserted by Ad Inserter.

Online Documentation

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 code window
  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.
Does Ad Inserter insert any internal ads?

No revenue sharing and no such thing as “internal ads” or “our ads” on your website. Period. What you configure is what will be inserted (+ some internal scripts for plugin features).
Ad Inserter is free, open source plugin and inserts only the code you configure (blocks 1 – 16, Header, Footer). The code you see is the code that will be inserted. Please check page source code before you make any conclusion.
Of course, if you configure code block with some javacript ad code, then this code may generate ads. But please, don’t blame the plugin for this.
You can also use Ad Inserter to insert code for AdSense Auto ads on each page (usually in the header). However, the exact placement of ads will be done by the ad code, not Ad Inserter!
https://adinserter.pro/adsense-ads#auto-ads

The easiest way to check Ad Inserter code blocks is to use Label blocks debugging function:
https://adinserter.pro/documentation#debugging

I have installed code for AdSense ads and I see ads placed at random positions.

You are probably using code for AdSense Auto ads.

AdSense Auto ads (known also as Page Level Ads) is a code that you insert on every page once and it will automatically display AdSense ads on positions chosen by the code.
Auto ads use Google’s machine learning to pick the best placements on your pages to show ads. You only need to add one piece of code to all your pages, and let Google take care of the rest.

Auto ads may not be suitable for some WordPress themes or layouts. In such cases it is easier to place ads at wanted locations by using normal AdSense code and specifying exact locations where the code should be inserted.

I have installed code for AdSense ads but the ad blocks are blank.

Blank AdSense ad block means that the code is inserted properly only the ad code doesn’t display anything. Typical reasons for this are the following:

  • After the ad code is inserted Google needs some time (hours) to check the pages before it starts to serve ads.
  • AdSense account is not fully approved yet – if your account is new you need to wait until Google checks ad codes on your website and and confirms your account. Usually this takes few days.
  • Your website or page is not approved yet – you need to wait until Google web crawlers check your pages.
  • Your website or page was not approved for AdSense ads
  • Your AdSense account is banned
  • No ads available for your website
  • Errors in ad code – check or regenerate ad code
  • You are using ad blocker

See AdSense ads not displayed for details. 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 add some title or label (e.g. Advertisements) above the ad?

If this is a sidebar widget then you can simply name the widget.

For each code block you can also show a label above each ad. Default text (or HTML code) for ad labels can be set on the general plugin settings tab (tab * / tab General / Ad label.
To enable ad label above the ad go to code block for this ad, click on the Misc button and then on the Display tab check Ad label.

If you configured only text for ad label then the following code will be added above ad code: <div class="code-block-label">AD_LABEL_TEXT</div> (code-block is the block class name used, AD_LABEL_TEXT is the text for Ad Label).
You can then style the label using CSS for class .code-block-label (the best place for this code is Header section). If HTML code is configured for ad label then this code will be used (instead of the div code above).

In case you need a different label for some ad you can simply add label HTML code above the ad code. For example:

<h3>Advertisements</h3>

AD_CODE
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 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/*

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. Either use rotation code generator and define shares in percents or create code using ROTATE separator with attribute share where you define percentage of the rotation share:

[ADINSERTER ROTATE share="75"]
ad_code_1
[ADINSERTER ROTATE share="25"]
ad_code_2

If you omit one share value it will be automatically calculated:

ad_code_1
[ADINSERTER ROTATE share="25"]
ad_code_2
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>

評価

Fullfilled my Requirements

I use to get Page level violation and I use to keep ads in sidebar and header. With this plugin, I can easily manage where to show ads and where not to show ads

Just what I needed

Thanks for the help Igor. Brilliant plugin and does the job! Quick responses to any questions. Really impressed.

Definitely Recommended

There are frequent updates and improvements. Extremely easy to set up. Infinitely more convenient than having to deal with individual ad codes on the site itself.

564件のレビューをすべて表示

貢献者と開発者

Ad Inserter – WordPress Ads Management with AdSense Header Integration はオープンソースソフトウェアです。以下の人々がこのプラグインに貢献しています。

貢献者

変更履歴

2.3.8

  • Added support rotation option shares
  • Added support for sticky ad settings and animations (Pro only)
  • Few minor bug fixes, cosmetic changes and code improvements

2.3.7

  • Added support for ad labels
  • Blocked search indexing while debugging
  • Close button setting moved to tab Display (Pro only)
  • Few minor bug fixes, cosmetic changes and code improvements

2.3.6

  • Added widget for debugging tools
  • Fix for AdSense ad overlays not displayed with some themes
  • Few minor bug fixes, cosmetic changes and code improvements

2.3.5

  • Added display of header and footer code in Label blocks debugging function
  • Added AdSense ad overlays in Label blocks debugging function (experimental)
  • Fixed bug for removed square brackets in HTML element selectors
  • Fixed preview of AdSense ad units
  • Few minor bug fixes

2.3.4

  • Added support for author:author-username items in taxonomy list
  • Fixed errors when downgrading from Pro
  • Few minor bug fixes

2.3.3

  • Added list editors
  • Added Label blocks debugging function for AdSense Auto ads

2.3.2

  • Added AdSense code generator for ad sizes using CSS media queries
  • Fix for slow updates caused by changed user agent (Pro only, credits Olivier Langlois)
  • Fix for client-side insertion of non-English characters before/after HTML element

2.3.1

  • Added support for server-side insertion before/after any HTML element
  • Few minor bug fixes

2.3.0

  • Added support for client-side insertion before/after any HTML element
  • Inplemented AdSense integration
  • Added option to define close button position
  • Fix for code generator import and code preview error with non ASCII characters
  • Fix for post/page exceptions and page types not processed in the header
  • Fix for close button in preview window
  • Fix for errors when rearranging blocks
  • Fix for errors when importing code
  • Few minor bug fixes, cosmetic changes and code improvements

2.2.16

  • Fix for error when saving settings on multisite installation

2.2.15

  • Fix for responsive AMP ads using center alignment

2.2.14

  • Added code generator for placeholders
  • Added option to disable caching (works with WP Super Cache, W3 Total Cache and WP Rocket)
  • Added options to configure classes for wrapping div
  • Added support for external tracking via Google Analytics and Piwik (Pro only)
  • Added support for MaxMind geolocation databases (Pro only)
  • Added option for close button on sticky ads (Pro only)
  • Fix for no paragraph counting inside nested elements
  • Few minor bug fixes, cosmetic changes and code improvements

2.2.13

  • Added option to disable inline alignment styles for code blocks (using alignment classes)
  • Fix for custom CSS codes with single quotation marks

2.2.12

  • Fix for code block styles when block class name was not set

2.2.11

  • Code block styles moved to classes
  • Code block list moved to the sidebar
  • Added preview buttons in code block list
  • Fix for ad blocking detection when using https (Pro only)
  • Few minor bug fixes, cosmetic changes and code improvements

2.2.10

  • Fix for rotation editor code import/export
  • Fix for errors when using old |rotate| separator
  • Few minor bug fixes, cosmetic changes and code improvements

Earlier versions

For the changelog of earlier versions, please refer to the separate changelog.txt file.