← All projectsProject / Traffic data & filtering

Advertising traffic segmentation and export service

A traffic-analysis pipeline that combines advertising reports, IP context and completeness-aware filtering.

PythonClickHouseDuckDBFastAPICeleryPostgreSQLGeoIP2Angular
Project overview

What the service does

A traffic-analysis application for advertising operations. Users either upload a file of IP addresses or select a date range from imported advertising reports, then filter by geography, IP range, click or impression counts, or deposit counts. The result is a downloadable segment; one workflow can also upload a list to the configured advertising service.

Large advertising reports are hard to inspect manually. Operations need reproducible criteria for identifying IP addresses and ranges, and a way to turn those decisions into usable exports.

Who uses it

Traffic analysts and advertising operations teams who review large reports and prepare repeatable IP or audience segments.

Input
  • An uploaded CSV/ZIP/GZIP file or a selected reporting period.
  • Geography, IP/CIDR, click/impression and deposit filters.
  • Imported daily advertising reports for report-based queries.
Output
  • A CSV file containing the selected IP segment.
  • Task progress and errors visible in the interface.
  • For a configured workflow, a list upload to an external advertising service.
System requirements
  • Daily external reports must be loaded into analytical storage.
  • Filters depend on data completeness for the requested interval.
  • IP and geographic context support traffic interpretation.
  • Results can be downloaded or optionally sent to an external blacklist.
01 / How the service works

IP file or report → traffic filters → selected segment

Process mapSolid line: normal flow · dashed line: retry or return
Process map: iplookupA process map showing the sequence of work, decisions and alternate routes.
INPUTUpload IP fileCSV, ZIP or GZIP input
STEPNormalize addressesPrepare IP values and ranges
SERVICEApply file filtersGeoIP and set/range operations
RESULTDownload segmentCSV result for the operator
INPUTChoose report datesImported advertising data
SERVICELoad and prepare reportsDaily import into analytical storage
DECISIONAll dates present?Missing days stop an incomplete lookup
SERVICERun traffic filtersIP, user-agent, click/impression counts or deposits
RESULTDownload or send listCSV, with optional configured upload
RESULTShow missing datesAsk for a complete reporting interval
  1. INPUTUpload IP file

    CSV, ZIP or GZIP input

    ContinueNormalize addresses
  2. STEPNormalize addresses

    Prepare IP values and ranges

    ContinueApply file filters
  3. SERVICEApply file filters

    GeoIP and set/range operations

    ContinueDownload segment
  4. RESULTDownload segment

    CSV result for the operator

  5. INPUTChoose report dates

    Imported advertising data

    ContinueLoad and prepare reports
  6. SERVICELoad and prepare reports

    Daily import into analytical storage

    ContinueAll dates present?
  7. DECISIONAll dates present?

    Missing days stop an incomplete lookup

    completeRun traffic filters
    missing datesShow missing dates
  8. SERVICERun traffic filters

    IP, user-agent, click/impression counts or deposits

    ContinueDownload or send list
  9. RESULTDownload or send list

    CSV, with optional configured upload

  10. RESULTShow missing dates

    Ask for a complete reporting interval

Arrows show the direction of work; labeled branches show decisions, errors and retries.
02 / System architecture

Main components and their roles

File upload OR report API

Choose a source

Upload an IP file or select a period of external advertising reports.

How it works

These are alternative input paths. CSV/ZIP/GZIP uploads feed file processing; Celery download/ETL chains supply the report branch.

Normalization / staging

Prepare the input

Each source is prepared for its own filtering method.

How it works

The file path normalizes IPv4 and mapped IPv6 addresses. The report path loads rows into ClickHouse staging tables and updates the relevant date partitions.

Metadata / coverage

Check readiness

Task state tracks the input; report-based filters also check date coverage.

How it works

PostgreSQL stores task/file metadata. Missing-date detection applies to analytical report lookups, not as a mandatory step for every file upload.

GeoIP OR analytical SQL

Apply segment rules

The selected workflow produces a segment using geography, event counts or address ranges.

How it works

For an uploaded file, GeoIP2 adds location data and the service applies IP/range filters. For advertising reports, ClickHouse filters by IP, user-agent, clicks, impressions, deposits or CIDR.

JSONB task progress

Inspect progress

The interface shows execution progress, output state and errors.

How it works

PostgreSQL stores each task state and file metadata; the interface uses them to show progress and the result of a filter.

CSV / optional upload

Export the result

The result becomes a downloadable list or an optional platform blacklist update.

How it works

The service creates a CSV file; a configured workflow can also send the selected list to the advertising platform.

03 / Implementation details

Engineering decisions

01

Separate operational and analytical data

PostgreSQL stores application state while ClickHouse serves report-scale analytical access.

02

Gate incomplete intervals

Data availability becomes a condition for running a meaningful filter.

03

Close the operational loop

A filter produces an export that operators can apply in their advertising workflow.

Software development for business

Have a project in mind?

Tell me what the application should do, how the team works today and which requirements or deadlines matter.