Chapter 5. Tutorial: Place Your First Ad
From an ad unit in AdSense to a stable, lazily loaded ad on your page, and proof that it doesn't move anything.
In this tutorial you place one responsive Display ad in a module position of your template, then check that it loads without shifting the page. It takes about fifteen minutes. Every other kind of ad works the same way, with small differences covered in Chapter 6, How-to Guides.
Before you begin, enter your Ad Client ID as described in the section called “Enter Your Ad Client ID”.
Step 1: Create an Ad Unit in AdSense
-
In AdSense, go to → and choose Display ads.
-
Give the unit a name you will recognize, such as
Sidebar. Leave the shape set to Responsive and click . -
AdSense shows you a piece of code. Don't paste it into your site. Find the line that contains
data-ad-slotand copy the number between the quotation marks. This is your Ad Slot ID.data-ad-slot="1234567890"
Note
You don't need the rest of the code. CLS Ad Slot writes it for you, with the space reservation and lazy loading built in.
On This Page