Ads
Break has two places for Google AdSense units:
- the partner slot at the foot of the live column on the front page
- an in-article slot on posts, between the post head and the post body
Both are off out of the box. Paying members never see either one.
What You Need From AdSense#
Each slot is a separate ad unit in your AdSense account, so you need three values:
| Value | Where to find it in AdSense | Looks like |
|---|---|---|
| Publisher ID | Account → Settings → Account information | ca-pub-1234567890123456 |
| Ad unit ID for the partner slot | Ads → By ad unit → Display ads, after you create the unit | 1234567890 |
| Ad unit ID for the post | Ads → By ad unit → In-article ads, after you create the unit | 0987654321 |
When AdSense shows you the code for a new unit, the ad unit ID is the value of data-ad-slot. Copy the number only, not the whole snippet.
Create the partner slot as a Display unit and the post slot as an In-article unit.
Setup Instructions#
- Go to ⛭ Settings → Design
- Click Customize
- Open the Theme tab
- Paste your publisher ID into Adsense publisher id
- Paste the partner slot's unit ID into Adsense header slot id
- Paste the post unit ID into Adsense in article slot id
- In Disabled features, delete
header-ad,in-article-ad, or both - Click Save
header-ad and in-article-ad are in Disabled features by default. As long as a keyword stays there, its slot shows no ad, whatever else you fill in.
A slot shows an ad only when all three are in place: the publisher ID, its own ad unit ID, and its keyword removed from Disabled features. An ad unit without its ID can never be filled by Google, so the theme does not place one.
The Slots#
| Keyword | Setting | Where it appears |
|---|---|---|
header-ad | Adsense header slot id | The partner slot at the foot of the live column, on the front page |
in-article-ad | Adsense in article slot id | Between the post head (title, authors, date, feature image) and the post body |
Despite its name, Adsense header slot id feeds the partner slot. Break has no banner above the header.
Newsletter issues are ordinary posts in Ghost, so the in-article slot also appears on the web version of every issue. It never appears in the email itself, because Ghost builds emails from its own template.
The House Ad#
When the AdSense unit is not in place, the partner slot shows your own house ad, built from a page with the slug house-ad. That happens when any of these is true:
- Adsense publisher id is empty
- Adsense header slot id is empty
header-adis in Disabled features- the reader is a paying member
The house ad also stands in when AdSense has no ad to serve for the slot.
So you can run the slot without AdSense at all, or keep the house ad for paying members while everyone else sees an ad. See Live Updates for how to build the house-ad page.
Paid Members#
Ads are hidden from paying members in two ways at once:
- The slots are not written into the page for a paid member.
- The AdSense script is not loaded for them, so no ad request is made on their behalf.
Free members and visitors who are not signed in do see ads. There is no setting for this.
Turning Ads Off#
- To remove one slot, add its keyword back to Disabled features, or clear that slot's ad unit ID. The partner slot then shows the house ad again.
- To remove both, list both keywords, or clear Adsense publisher id. Clearing the ID also stops the AdSense script from loading for anyone.
Notes#
- When AdSense has no ad to serve, it marks the unit as unfilled and the theme hides it. In the partner slot the house ad takes its place, if you have a
house-adpage. The in-article slot simply disappears. - Which ad appears in a slot is decided by your AdSense account, not by the theme.
- Google may take a while to start serving on a new site or a new ad unit. If a slot stays empty for everyone, check your AdSense account before changing theme settings.
- The full list of keywords for Disabled features is in Features.