Skip to main content

Validation

Data tracked by Objectiv adheres to an open, standardized Taxonomy. This means it's well-structured & self-descriptive, and can be validated at the first step of the pipeline. Objectiv provides several tools to catch errors before data starts flowing in, outlined below.

Build-time validation

Objectiv's tagging & tracking functions are typed and documented.

During instrumentation, you'll get inline documentation for every function, and linting for any validation issues: unknown tagging/tracking calls, missing properties, or wrongly typed properties.

Example inline error in IDE:

IDE validation: property type

Run-time validation

When you run your application, any validation errors are caught by the Objectiv debugger, and displayed in the browser console:

  • Errors: Warnings are thrown for unknown tagging/tracking calls, missing properties, or wrongly typed properties.
  • Uniqueness: If an Event id and its Location Stack are not unique, an Error is thrown. In the browser console, the error can be hovered/clicked to identify the existing and colliding Elements. See Locations - Solving Collisions for an example.

Collector validation

As a final catch-all, Objectiv's Collector validates any incoming Event against the Taxonomy and its properties.

For more background, see the Collector docs.

Logging

When you run your application, you can observe all tracking calls and other tracking events by enabling logging. This will print all tracking events to the chosen logger, e.g. the browser console.

Logging can be enabled in two ways:

  1. When configuring the tracker. For example, to log to the browser console (example in React):
const trackerOptions = { console: console }

makeTracker({
applicationId: 'app-id',
...trackerOptions,
});
  1. At runtime. For example, to enable logging from the browser console:
objectiv.trackers.defaultTracker.console = console;