Sub topic 4
Collecting Data from Platforms and Tools
Assume you know the basics of reach, impressions, and engagement, and can use a spreadsheet. This chapter focuses on collecting monthly data that can be compared reliably across platforms and reporting periods.
Start with a data plan
Before opening an analytics dashboard, list the decisions the report must support. Then choose only the data needed for those decisions. A data plan prevents a report from becoming a collection of unrelated numbers.
Record these details for every metric:
- Platform and account
- Metric name and definition
- Date range and time zone
- Organic, paid, or combined scope
- Source, such as a platform export or analytics tool
- Export date
- Any filters or exclusions
Use complete calendar periods. For example, define May as May 1 at 00:00 through May 31 at 23:59 in the business's reporting time zone. Do not compare a 31-day month with a partial 30-day export.
Choose a collection method
Native platform exports are usually the best starting point. They contain the platform's own definitions and often include daily, post-level, audience, and paid-performance data. APIs, or application programming interfaces, are useful when you need recurring automated imports. Website analytics tools such as GA4 can connect social activity with website visits and conversions.
| Source | Best use | Main risk |
|---|---|---|
| Native platform export | Reach, impressions, interactions, audience | Definitions differ by platform |
| Platform API | Repeated, automated collection | Fields and permissions can change |
| Website analytics tool | Sessions, leads, and purchases | Attribution may not match platform totals |
| Campaign or content tracker | Post names, links, owners, and goals | Manual entry errors |
Keep the original files unchanged. Store them in a raw-data folder with a clear name such as instagram_2026-05_raw.csv. Create a separate cleaned table for calculations. This separation lets you trace a report number back to its source.
Use consistent fields
Create a data dictionary before collecting data. A data dictionary is a list that defines each field and its calculation. For example, decide whether “engagements” includes likes, comments, shares, saves, clicks, and video actions. Do not silently change that definition next month.
A useful post-level table might include:
platformpost_idpublished_atcontent_typecampaignreachimpressionslikescommentssharessaveslink_clickspaid_or_organic
Use stable post IDs rather than post titles. Titles can be edited or repeated.
Validate before analysis
Check that:
- Every row belongs to the intended date range.
- Post IDs are unique within the source.
- Numeric fields contain numbers, not formatted text.
- Reach and impressions are not negative.
- Paid and organic rows are not accidentally added together when they overlap.
- The time zone and currency are documented.
- Missing values are distinguished from zero.
A missing value means the platform did not provide a result. Zero means the platform measured the result and found none. Treating both as zero can distort averages.
import csv
from io import StringIO
csv_text = """platform,post_id,reach,impressions
Instagram,ig-101,9000,12000
Instagram,ig-102,0,0
"""
for row in csv.DictReader(StringIO(csv_text)):
reach = int(row["reach"])
impressions = int(row["impressions"])
if reach < 0 or impressions < 0:
raise ValueError(f"Negative metric in {row['post_id']}")
if impressions < reach:
print(f"Check {row['post_id']}: impressions are below reach")Follow the collection flow
Collect platform data first, then collect website conversions and campaign metadata. Reconcile totals where possible, but document differences instead of forcing them to match. Platform clicks and website sessions use different tracking systems and attribution rules.
Exercise
An export contains April 1–May 15, but the report covers April. What should you do?
Show answer
Re-export April 1–30, or filter the data to April and document the method. Do not compare the partial export with a complete month.