Quick answer
Data validation is checking data against defined rules, such as type, range, format and required fields, before it is stored or used. It shows that data is well formed, not that it is true, and it works best at the source and at intake, before wrong values reach reports.
What is data validation?
Data validation is checking data against defined rules before it is stored or used, so that values of the wrong type, out of range, in the wrong format or missing never reach your reports. IBM describes valid data as data that stays within permitted limits or ranges, follows specified formats and meets the organization's own criteria. In analytics the data is events and their properties, and a rule looks like "purchase value is a number between 0 and 1,000".
Validation shows that data is valid, not that it is true. A purchase recorded as $40 for a $50 order passes every rule. It also differs from cleansing: validation decides whether to accept a value as it arrives, while cleansing fixes what is already stored.
Types of validation checks
| Check | Question it asks | Example rule for an event | JSON Schema keyword |
|---|---|---|---|
| Presence | Is a required field there? | order_id must exist | required |
| Type | Is it the right kind of value? | value is a number, not the text "$40" | type |
| Range | Is it within limits? | value is at least 0 and at most 1,000 | minimum, maximum |
| Allowed values | Is it one of a fixed list? | plan is free, pro or max | enum |
| Format | Does it match a pattern? | order_id looks like ORD-123456 | pattern |
| Length | Is it short enough? | coupon has at most 20 characters | maxLength |
| Uniqueness | Are there duplicates? | A list holds each item once | uniqueItems (arrays only) |
| Consistency | Do fields agree with each other? | refund_amount is not more than value | None: needs a cross-field rule |
The last column is the formal vocabulary the JSON Schema specification uses for the same checks. It is a handy way to write the rules down precisely, whatever tool enforces them.
Where to validate: source, intake or after storage
| Stage | What it catches | Cost of a miss | What happens to a bad row |
|---|---|---|---|
| At the source (tests, review, a written tracking plan before release) | Wrong names and types before they ship | Lowest | The bad code never ships |
| At intake (when events arrive) | Malformed events from any sender | Medium: visible at once, but rows may be lost | Warn, strip a field, reject, or hold for review |
| After storage (quality checks and monitors) | Drift, volume drops, tracking that went stale | Highest: reports have already used wrong numbers | Fix going forward and backfill history |
Earlier is cheaper, but each stage catches things the others cannot, so use more than one.
Worked example: what unvalidated events do to revenue
Sample data: 5,000 purchase events in a week, each worth $40.00 if sent correctly, so true revenue is 5,000 × $40.00 = $200,000. Three kinds of sender are mixed in.
| Group | Events | What was sent | Effect on a revenue sum |
|---|---|---|---|
| Correct | 4,675 | value = 40.00 (number) | Counted: 4,675 × $40 = $187,000 |
| Text value | 300 | value = "$40.00" (text) | Cannot be summed, so adds $0 |
| Cents instead of dollars | 25 | value = 4000 | Counted: 25 × $4,000 = $100,000 |
Reported revenue is $187,000 + $0 + $100,000 = $287,000, which is 43.5% above the true $200,000, and the chart shows no error. Two bugs pull in opposite directions: 300 events (6.0%) vanish from the sum, and 25 events (0.5%) are inflated 100 times.
Now add two intake rules: value must be a number, and at most 1,000. Both groups break a rule, 325 events in all (6.5%).
- With quarantine, 4,675 events are stored and revenue reads $187,000, which is 6.5% low. The data-quality page now lists 325 held events with the reason, so the senders can be fixed.
- With warn only, all 5,000 events are stored and revenue still reads $287,000, but 325 warnings say why.
Validation does not fix the numbers. It turns a silent 43.5% error into a visible 325-event problem. The action you choose is the trade-off: blocking loses the rows, warning keeps them but leaves bad numbers in the reports.
Common mistakes
- Checking format but not meaning. A well-formed value can still be wrong. Validation catches malformed data, so pair it with reconciliation against a source you trust, such as orders in your own database.
- Blocking everything on day one. A rejected event is gone for good. Start with warnings, read what they show, then tighten the rules that proved right.
- Keeping the rules in someone's head. Write each event's name, property types, required fields and an example into a tracking plan so the rule can be reviewed and tested, and see event schema for the shape those rules describe.
- Validating once, at launch. Trackers break after releases. Keep checking volume and missing fields afterwards; data observability covers that.
- Assuming "required" means enforced. Marking a field required in a plan documents the expectation. It enforces nothing unless a rule acts on it.
- Validating only one sender. The browser is just one source. Servers, mobile apps and imports can send the same event with different types, so apply the rule where all of them arrive.
- Reading rejections as low traffic. If rejected events are not counted anywhere, a broken sender looks like a quiet day. Track the number of rejects. Who owns the rules is a question for your data governance.
Data validation in TapCub
Take the purchase example. This is how the same rules look in TapCub.
- Write the rule down. In All-platform analytics › Data › Tracking plan, add the
purchaseevent with its properties:valueas a number and required,currency,order_id. Each row also has an owner, platforms and a status (Proposed, Developing, Accepting, Live, Deprecated). The plan records events you intend to collect, including ones not sent yet. - Watch the first 24 hours. Turn on Live verification (24 h) to add two columns: hits in the last 24 hours and the completeness of required properties. Low completeness is a warning and blocks nothing by itself.
- Enforce at intake. In All-platform analytics › Data › Property dictionary, edit
valueand add a validation rule: expected type, required on events, a regular expression, maximum length, minimum and maximum, or allowed values. Choose what happens on a violation: warn only (event stored, one warning), drop the property (event stored, key removed), block the event (not stored) or quarantine it (not stored, held for review). A rule applies only after you save it. - Review what was caught. All-platform analytics › Data › Data quality has tabs for ingestion warnings, high cardinality, stale detection, quarantine and tiered decay. Quarantine keeps the latest 300 held events. You cannot release them into storage from there, and clearing it discards them, so fix the sender first and then click Clear quarantine.
- Triage unknown names. An event with no definition arrives as unplanned and is still stored. Accept it from All-platform analytics › Data › Event inbox, or set its definition to Blocked to drop that name. TapCub does not check event names against the plan unless you block them.
Editing rules and clearing quarantine need the Analyst role or above.
Sources
- IBM, What is data validation?
- JSON Schema, Validation vocabulary (draft 2020-12): the
type,enum,minimum,maximum,pattern,maxLength,requiredanduniqueItemskeywords.
Was this explanation clear?
We use your answers to fix and expand this page.
Couldn’t send. Please try again in a minute.
Thanks for the feedback. We’ll use it to improve this page.You’ve already sent feedback on this page. Thanks.

Data Engineer
Writes about event design, data quality, and collection workflows, with verifiable implementation methods for reliable analytics.