Tracking Developer Overview
In this article we look at Bizzkit Tracking from a developer's perspective and provide a tutorial on order tracking using the .NET SDK.
Before getting started
In this concept article you can find an overview of Bizzkit Tracking, including its architecture and event types. If you haven't already, we recommend reading it.
Using the .NET SDK
For easy integration with Microsoft .NET, Bizzkit offers SDK packages. These packages include auto-generated Swagger clients and a factory class to simplify authentication. They automate token renewal and provide type-safe methods for the API endpoints.
All SDK package names start with the prefix Bizzkit.Sdk., and the SDK packages incorporate the following elements:
- A client factory
- A dedicated client
- Options to configure the client factory
Info
Preview versions are identified as Bizzkit.Sdk.[product].Preview, such as Bizzkit.Sdk.Iam.Preview or Bizzkit.Sdk.Pim.Preview.
To access the Bizzkit NuGet packages in your preferred development environment, you need to reference the Bizzkit Partner feed. You can, for example, do this by adding a nuget.config file to your project with the following configuration:
This configuration clears existing package sources and adds the Bizzkit Partner feed alongside the official NuGet source.
Once the feed is configured, you can install the required NuGet package using the following command:
The Event Receiver SDK provides an unauthenticated client — no OAuth token is required. Events are associated with the correct tenant and segment via the instrumentation key included in each request.
Tutorial: Order tracking
This tutorial demonstrates how to submit an OrderCreated event when a customer completes a purchase in the webshop. The order event includes the order total, currency, and individual line items.
Step 1: Capture the order data
When a customer completes checkout, collect the order details from your commerce system:
Step 2: Submit the order event
Using the client created above, submit the OrderCreated event:
Step 3: Verify
The Event Receiver responds with 202 Accepted once the event batch is received. Events are processed asynchronously.
Complete example
Below is the full example combining client creation and order event submission:
Warning
Please keep in mind that all examples provided are for illustrative purposes only. They are not intended to represent best practices and should not be used in production without a thorough code review.
Key considerations
- Batch events — The
TrackedEventBatchModelsupports multiple events in a single request. Batch related events together when possible to reduce HTTP overhead. - Idempotency — Events are processed at-least-once. Design your analytics to be tolerant of duplicate events.
- Instrumentation key security — Treat instrumentation keys as semi-sensitive. They identify your tenant and segment but do not grant access to stored data.