For AI agents: a Markdown version of this page is at https://docs.snowplow.io/release-notes/manage-tracking-from-a-repository.md. The index of all documentation pages is at https://docs.snowplow.io/llms.txt.
Manage tracking as code with Snowplow CLI 0.4.0 and Snowtype 0.20.0
You can keep your tracking plans in your application's repository and generate the tracking code from the same files. A change to an event specification and the code that sends it go through one pull request.
Declare event specification versions with Snowplow CLI 0.4.0
Console gives every event specification a version number. Snowplow CLI 0.4.0 lets a tracking plan file declare that version, and checks that each change raises it exactly as Console does. The version in your files, and in the code Snowtype generates from them, is the version Console assigns.
Snowplow CLI 0.4.0 adds these options:
dp validate offline --base-ref <branch>compares your files with the point where your branch started. It needs no credentials, so it runs locally and on every pull request.--fixwrites the expected version into your files.dp validate,dp sync, anddp releasecheck the versions against Console, and refuse to publish when one doesn't match.
See Declare event specification versions.
Generate code from your repository with Snowtype 0.20.0
Snowtype 0.20.0 generates tracking code from the tracking plan files in your repository. When it reads only your repository, it needs no Console credentials. See Local tracking plans.
The new snowtype check command reports whether the generated code matches your tracking definitions, without writing anything. Run it in CI to fail a pull request that changes a tracking plan without regenerating the code. See check.
Follow a tutorial for the whole flow
Manage tracking as code with Snowtype and Snowplow CLI replaces the "Manage data structures with Git" tutorial. It sets up one repository for a web app, checks every pull request with GitHub Actions, publishes changes merged to develop to your development environment, and promotes them to production from main.