Chapter 6. How-to Guides

Insert Ads Inside Articles

The In-Article Injector places an In-article ad after every few paragraphs of each article, so you don't have to edit your articles. It only acts on single article pages, not on blogs or lists.

  1. In AdSense, create an In-article ads ad unit and copy its data-ad-slot number.

  2. Create a new CLS Ad Slot module. On the Slot Configuration tab, set Ad Unit Type to In-article Ad Unit and enter the Ad Slot ID.

  3. On the Layout tab, set the minimum heights. In-article ads adapt to the width of your text, and are often taller on phones than on desktops. Measure them as described in the section called “Find the Right Height for a Responsive Slot”.

  4. On the Module tab, type clsadslot-in-article into Position and press Enter. This position isn't in your template; the injector looks for modules there.

  5. On the Menu Assignment tab, choose the pages where articles should get ads. Then click Save & Close.

  6. Enable the Content - CLS Ad In-Article Injector plugin. The Status panel on the dashboard now shows a warning with a link to it; see the section called “Read the Status Panel”.

  7. To change how often an ad appears, open the plugin and set Paragraph intervals. The default, 6, places an ad after every sixth paragraph.

Articles shorter than the interval get no ad. An ad is never placed before the first paragraphs, so your opening, which is often the part that matters most for Largest Contentful Paint, is never pushed down.

Tip

To show different ads in turn, publish several In-article modules in the clsadslot-in-article position. The injector uses them one after another, starting again from the first when it runs out.

Note

Only modules set to In-article Ad Unit are used. Any other CLS Ad Slot module in this position is ignored.