Sub topic 12
Exporting Coverage Data and Cleaning It for Analysis
This chapter assumes you can write a basic Boolean search, have run one in a monitoring platform such as Meltwater or Cision, and can read a CSV file in a spreadsheet. You do not need to be a programmer. The Python examples are short and use only the standard library.
Why export at all
Platform dashboards are good for quick checks. They are weaker when you need to do the following:
- Combine coverage from several searches or several platforms.
- Remove duplicates by your own rules.
- Calculate a metric the dashboard does not offer.
- Keep a record that does not change when the platform re-indexes or recalculates its numbers.
An export gives you a file of rows, where each row is one piece of coverage. Once you have that file, your job is to make it trustworthy before you calculate anything from it. Every figure in your report, such as share of voice or net sentiment, is only as good as the rows beneath it.
What an export contains
Column names differ between platforms and between report types. Most exports include some version of these fields:
| Field | What it holds | Common problem |
|---|---|---|
| Date | Publication date or time | Mixed formats, time zones |
| Outlet | Publication, channel or account | Same outlet spelled several ways |
| URL | Link to the item | Tracking parameters, duplicates |
| Headline or snippet | Title and text excerpt | Truncated, or missing for broadcast |
| Media type | Online, print, broadcast, social, podcast | Different types use different reach rules |
| Sentiment | Positive, neutral or negative | Automated label may be wrong |
| Reach | Estimated audience | Estimates, not measured readers |
| Matched keyword | The term that triggered the match | Shows false positives |
Always read your platform's export documentation. Field names, limits on rows per export, and the way reach is estimated are platform-specific.
Planning the export
Decisions made before you click "export" save cleaning time later.
- Fix the date range. Use full days and note the time zone setting of the account. A report for "March" should start at 00:00 on 1 March and end at 23:59 on 31 March in the same zone.
- Export the search, not the whole account. One saved search per export keeps rows traceable to a query.
- Include a label for the source search. If the platform does not add a column, add one yourself (for example
search_name) before merging files. - Record the export date and query text. Platforms re-score and re-index. Saving the query and date lets you explain why a later export differs.
- Check for row limits. If the export stops at a fixed number of rows, split it by date range. A silently truncated file will understate volume.
The cleaning workflow
The order of the steps matters. Remove duplicates before you count anything, and standardize names before you group anything.
Step 1: Check structure and row count
Open the file and confirm the headers, the date range, and the number of rows. Compare the row count with the total shown in the platform for the same search and dates. A small difference can be normal. A large one means a truncated or filtered export.
Watch for encoding problems. Accented characters turning into strange symbols usually mean the file was opened with the wrong encoding. In a spreadsheet, import the CSV and choose UTF-8 instead of double-clicking it.
Step 2: Remove duplicates
Duplicates come from three sources:
- Exact repeats. The same URL appears twice because two saved searches matched it, or two exports overlapped.
- Syndication. A wire story is republished by many outlets with different URLs and nearly identical text.
- Near-identical versions. The same article appears with and without tracking parameters, such as
?utm_source=newsletter, or withhttpandhttpsvariants.
Exact repeats are easy. Normalize the URL first, then drop repeats. The script below strips tracking parameters and the trailing slash, then keeps the first row for each URL. It then calculates net sentiment, defined here as positive minus negative articles, divided by unique articles.
import csv
import io
from urllib.parse import urlsplit, urlunsplit, parse_qsl, urlencode
raw = """url,brand,sentiment
https://example.com/a?utm_source=news,Acme,positive
https://example.com/a/,Acme,positive
https://example.com/b,Acme,negative
https://example.com/c,Acme,neutral
https://example.com/d,Acme,positive
"""
TRACKING = {"utm_source", "utm_medium", "utm_campaign", "utm_term", "utm_content"}
def normalize(url):
parts = urlsplit(url.strip())
query = [(k, v) for k, v in parse_qsl(parts.query) if k not in TRACKING]
path = parts.path.rstrip("/")
return urlunsplit((parts.scheme.lower(), parts.netloc.lower(), path, urlencode(query), ""))
seen = set()
unique_rows = []
for row in csv.DictReader(io.StringIO(raw)):
key = normalize(row["url"])
if key in seen:
continue
seen.add(key)
unique_rows.append(row)
positive = sum(1 for r in unique_rows if r["sentiment"] == "positive")
negative = sum(1 for r in unique_rows if r["sentiment"] == "negative")
net_sentiment = (positive - negative) / len(unique_rows)
print(f"{len(unique_rows)} unique articles, net sentiment {net_sentiment:+.0%}")Run on this sample, the script removes one row and prints 4 unique articles, net sentiment +25%. Without the URL normalization, the first two rows would count as separate articles.
Syndication needs a judgment call. You can keep one row per story and note how many outlets carried it, or keep all rows because each outlet reached a different audience. Pick one rule, write it down, and apply it to every period and every competitor. Changing the rule between reports makes trends meaningless.
Step 3: Standardize outlets, brands and dates
Group-by calculations fail quietly when labels differ. "Daily Ledger", "The Daily Ledger" and "daily ledger " (with a trailing space) become three outlets. The same applies to brand names.
- Trim whitespace and fix capitalization.
- Build a small mapping table of variants to one standard name.
- Convert all dates to one format, such as
YYYY-MM-DD, and one time zone.
Keep the mapping table as a file you reuse. It grows over time and makes each monthly clean faster.
Step 4: Remove false positives
Your Boolean query will still let some irrelevant items through. Look at the matched keyword column and sort by it, then scan the headlines. If many rows about "Acme Street" appear, add a NOT term to the saved search for the future. For the current file, remove those rows and note how many you removed.
Here is a generic query that groups brand variants, requires an event word, and excludes known false positives. Exact operators, especially proximity operators, differ by platform.
("Acme Corp" OR "Acme Corporation" OR AcmeApp)
AND (launch OR recall OR outage OR lawsuit)
NOT ("Acme Street" OR "Acme Awards")Do not delete rows from your only copy. Add a column such as exclude_reason and filter on it. This keeps an audit trail, so you can show a colleague exactly what you removed and why.
Step 5: Spot check a sample
Pick 20 to 30 rows at random and read them. Check that each is relevant, that the brand is correct, and that the sentiment label is reasonable. If more than a few are wrong, your rules need work before you trust any totals. Automated sentiment in particular is often wrong on sarcasm, mixed stories and industry jargon, so manual checks matter most here.
Calculating from clean data
With clean rows, share of voice is each brand's mentions divided by total mentions for all brands in the comparison. This script reads a small export and prints it.
import csv
import io
from collections import Counter
raw = """date,outlet,brand,sentiment,reach
2026-03-02,Daily Ledger,Acme,positive,120000
2026-03-02,City Wire,Acme,neutral,45000
2026-03-03,Tech Post,Globex,negative,80000
2026-03-03,Daily Ledger,Globex,neutral,120000
2026-03-04,Tech Post,Acme,positive,80000
"""
rows = list(csv.DictReader(io.StringIO(raw)))
mentions = Counter(r["brand"] for r in rows)
total = sum(mentions.values())
for brand, count in mentions.most_common():
print(f"{brand}: {count} mentions, {count / total:.0%} share of voice")This prints Acme: 3 mentions, 60% share of voice and Globex: 2 mentions, 40% share of voice.
Common errors
- Summing reach across duplicates. Reach is an estimate of potential audience. Adding it across syndicated copies inflates the total, and adding it across outlets double-counts people who read several. Present it as potential audience, not as people reached.
- Trusting the first export. Platforms can add late-arriving items or re-score sentiment. Re-run the export if the report matters.
- Mixing date zones. Items near midnight can slip into the wrong day or month.
- Cleaning by hand without notes. If you cannot repeat the steps next month, the trend line will break.
- Ignoring licensing. Exported articles and data may be covered by licence terms that limit sharing the full text. Share summaries, links and figures unless your licence says otherwise.
A repeatable checklist
- Record query, date range, time zone and export date.
- Compare row count with the platform total.
- Normalize URLs and remove exact duplicates.
- Apply your syndication rule.
- Standardize outlet and brand names with the mapping table.
- Flag false positives with a reason column.
- Spot check 20 to 30 rows.
- Save the cleaned file and a short change log.
Exercise
An export of 1,000 rows contains 140 rows that share a normalized URL with another row, and 60 rows about "Acme Street". After removing exact duplicates and the false positives, how many rows remain, assuming no overlap between the two groups? Then explain why you should still add a NOT term to the saved search.
Show answer
If the 140 rows are duplicates of rows you keep, you remove them, and 1,000 - 140 = 860. Each URL group keeps one row, so the number removed is the number of extra copies, which the question treats as 140. Removing the 60 false positives leaves 800 rows. Adding NOT ("Acme Street") to the saved search stops those items arriving in future exports, so you do not repeat the manual removal each period and your totals stay consistent.
Exercise
You report that Acme has 3 of 5 mentions and therefore 60% share of voice, but a colleague points out that Globex's query was never cleaned. Name one way this could bias the result and one fix.
Show answer
Globex's uncleaned export probably contains false positives and duplicates, which inflates its mentions and understates Acme's share (or the reverse if Acme is the uncleaned one). The fix is to apply the same cleaning rules, including URL deduplication, the same syndication rule and false-positive removal, to every brand before calculating share of voice.