Sub topic 6
Running a gap report in Ahrefs
This chapter assumes you have read the earlier chapters on choosing competitors and on volume, keyword difficulty (KD), position, and traffic potential. You also need an Ahrefs account that can open Site Explorer. Ahrefs calls its gap report Content Gap. By the end you will be able to set it up, read the result table, and avoid the settings mistakes that make a gap report misleading.
What Content Gap does
Content Gap compares the organic keywords of one or more competitor targets with your own target. It returns keywords where the competitors rank and you do not. This is the "missing" category from the gap-categories chapter.
The report does not show your weak keywords, where you rank but below a competitor. To see those, use a different report or an export merge, both covered below.
Ahrefs builds the report from its stored keyword index. It does not run live searches. The data is a sample of keywords that Ahrefs tracks for the country you pick, and a ranking position is only recorded if the page appears in the top 100 results.
Open the report
- Open Site Explorer and enter your own domain.
- In the left sidebar, find Competitive analysis and choose Content gap. The menu labels have changed between Ahrefs interface versions, so look for the Competitive analysis group if you do not see the exact name.
- The page shows two input areas. The upper area takes competitor targets. The lower area takes your own target, introduced by wording like "But the following target doesn't rank for."
Configure the report step by step
Enter your target and the competitors
Enter your own domain in the lower field. Enter between one and ten competitors in the upper fields. Use the competitors you chose by SERP overlap, not only business rivals. The Competing domains report in Site Explorer lists domains that share keywords with you, which is a good source for candidates.
For each target, Ahrefs lets you choose a mode. The mode decides how much of the site is included:
| Mode | What it covers | Use it when |
|---|---|---|
| Domain | The domain and all its subdomains | You want the whole site, including a blog subdomain |
| Subdomain | One specific subdomain | The competitor's blog or docs live on their own subdomain |
| Path | Everything under a folder, such as `/blog/` | You want one content section only |
| URL | One page | You are studying a single competing page |
The mode must match on both sides. If you compare a competitor's /blog/ path against your whole domain, your side includes pages that have nothing to do with the blog, and the "missing" list shrinks because you rank for keywords in other sections. Compare like with like.
Pick the country
Set the country before anything else. Volume, KD, and position are all country-specific. A keyword that is missing in the US index may be strong in the UK index. Use the country of your target audience and keep it the same across every report you merge later.
Choose how competitors combine
Ahrefs offers a choice between two ways of combining the competitor list:
- At least one of the targets rank for the keyword. This is a union. A keyword appears if any single competitor ranks for it.
- All of the targets rank for the keyword. This is an intersection. A keyword appears only if every competitor ranks for it.
The union gives a long list with many keywords that only one competitor ranks for. The intersection gives a short list of keywords the whole market covers, which is a strong signal that the topic matters. Intersections get empty quickly as you add competitors, so with four or five competitors the union is often more useful.
Set the position filter
Ahrefs lets you restrict the report by where competitors rank, for example only keywords where they are in the top 10 or top 20. Without a limit, a competitor ranking 87th for a phrase counts as "ranking for it." That page is not getting traffic, so the keyword says little about demand you could capture. A top-20 or top-10 limit is a practical default for most reports.
Then run the report. The first time, keep the other filters off so you can see how big the raw list is.
Read the result table
Each row is one keyword. Typical columns:
- Keyword and Volume: the phrase and its estimated monthly searches in the chosen country.
- KD: keyword difficulty on a scale of 0 to 100, based on the backlinks of the pages currently in the top 10.
- Traffic potential (TP): the estimated total monthly search traffic the top page for this keyword gets from all the keywords it ranks for.
- Competitor columns: one column per competitor showing that site's position. An empty cell means the site is not in the top 100.
- Your column: it should be empty for every row, because that is how the report is built.
Traffic potential matters more than volume for judging a topic. A keyword with 200 monthly searches may have a TP of 5,000 if its top page also ranks for many related phrases. Always compare Volume and TP side by side.
The number of competitors ranking is also a signal. A keyword where four of five competitors rank is probably a core topic. A keyword where only one ranks may be a niche page or a lucky ranking.
Use Parent Topic to avoid duplicate pages
Many rows in a gap report are variants of one topic. "best running shoes," "top running shoes," and "running shoes review" may all belong to one page. Ahrefs shows a Parent topic value for each keyword. Sort or group by it, so that one topic becomes one planned page rather than three. The prioritization and content plan chapters build on this.
Sample report walkthrough
Suppose you run a site selling coffee gear at example-coffee.com and compare it with three competitors.
- Country: United States.
- Competitors:
beanbarn.com,grindlab.net,brewcraft.io, all in Domain mode. - Your target:
example-coffee.com, Domain mode. - Combine: at least one target ranks. Position filter: top 20.
- Run. Suppose Ahrefs returns 4,200 keywords.
- Switch to "all targets rank" for comparison. Suppose that gives 85 keywords.
The 85 keywords are your first review list because all three sites cover them. The remaining 4,100 are a second, noisier tier. You do not need to read all of them. The filtering chapter shows how to cut it down.
Export for the script step
Use the Export button to download the table as CSV. Keep the same country, modes, and position filter on every export, or the files will not merge cleanly.
Ahrefs exports are not always plain UTF-8 comma-separated files. Some exports are UTF-16 with tab separators, and others offer a UTF-8 option in the export dialog. If a file opens in pandas as garbled text or as a single column, the encoding or separator is the cause. This loader tries the likely combinations:
import pandas as pd
def read_ahrefs_csv(path):
"""Read an Ahrefs export, trying common encoding and separator pairs."""
attempts = [
{"encoding": "utf-8-sig", "sep": ","},
{"encoding": "utf-16", "sep": "\t"},
{"encoding": "utf-8-sig", "sep": "\t"},
]
for options in attempts:
try:
df = pd.read_csv(path, **options)
except (UnicodeError, pd.errors.ParserError):
continue
if df.shape[1] > 1:
return df
raise ValueError(f"Could not parse {path}")
df = read_ahrefs_csv("content_gap.csv")
print(df.columns.tolist())
print(df.head())Print the column names before you write any merge logic. Headers differ between Ahrefs reports, so rename them to the names your script expects, such as Keyword, Volume, KD, and Position.
Common errors
- Mismatched modes. Comparing a competitor's subfolder with your whole domain hides real gaps. Match the modes.
- Wrong country. Reports from different countries cannot be merged or compared.
- No position limit. Page-three rankings inflate the list with keywords that carry no real traffic.
- Treating the list as a to-do list. A gap shows where competitors rank, not what you should write. Intent and business fit come next.
- Reading volume alone. Check traffic potential and Parent topic before dismissing a low-volume keyword.
- Only checking missing keywords. Content Gap leaves out your weak keywords. Merge exports to find them.
- Sampling bias. Ahrefs does not track every keyword, especially new, long-tail, or low-volume ones. A keyword absent from the report may simply be absent from the index.
Exercises
Exercise
You compare a competitor's /blog/ path against your whole domain in Content Gap, and the "missing" list is much shorter than you expected. What is the likely cause, and how do you fix it?
Show answer
Your side of the comparison includes pages outside your blog, such as product and category pages, which rank for many of the same keywords. Those keywords no longer count as missing. Fix it by using the same mode on both sides, for example setting your target to the path of your own blog folder.
Exercise
A Content Gap report with five competitors set to "all targets rank" returns only 6 keywords. Name two changes that would give you a longer, still useful list.
Show answer
Switch the combination to "at least one of the targets rank," or reduce the number of competitors. Relaxing the position filter, for example from top 10 to top 20, also widens the list. Of these, the union setting is the most common choice for a first review.
Exercise
Why is a keyword with 150 monthly searches and a traffic potential of 4,000 often worth more attention than a keyword with 2,000 searches and a traffic potential of 2,200?
Show answer
Traffic potential estimates the total traffic a top page earns from all the keywords it ranks for. The first keyword belongs to a topic where one page captures far more search traffic than the exact phrase suggests, so a single page can earn much more than its own volume implies.