Skip to content

Getting started

This guide walks you through submitting your first tracking event using the Bizzkit.Sdk.EventTracking.EventReceiver NuGet package.

Prerequisites

  • A .NET 8+ project
  • An instrumentation key provisioned for your tenant and segment (provided by your Bizzkit environment administrator)

Install the NuGet package

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:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <packageSources>
    <clear />
    <add key="nuget" value="https://api.nuget.org/v3/index.json" />
    <add key="bizzkit-partner" value="https://pkgs.dev.azure.com/bizzkit-platform/7dad82b4-f2ae-4a3a-ab87-3fc791e4ea62/_packaging/bizzkit-partner-feed/nuget/v3/index.json" />
  </packageSources>
  <packageSourceMapping>
    <packageSource key="nuget">
      <package pattern="*" />
    </packageSource>
    <packageSource key="bizzkit-partner">
      <package pattern="Bizzkit*" />
    </packageSource>
  </packageSourceMapping>
</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:

dotnet add package Bizzkit.Sdk.EventTracking.EventReceiver

Track a product click

The following example demonstrates how to track a ProductClicked event when a user clicks on a product in the webshop:

using Bizzkit.Sdk.EventTracking.EventReceiver;

// Create the client factory — no OAuth is required for the Event Receiver
var factory = new EventReceiverClientFactory(
    new EventReceiverConnectionOptions
    {
        BaseUrl = "https://myenv-tracking.bizzkit.biz"
    },
    new HttpClient());

var client = await factory.CreateUnauthenticatedClientAsync();

// Submit a product click event
await client.EventsAsync(new TrackedEventBatchModel
{
    InstrumentationKey = "your-instrumentation-key",
    Events = new[]
    {
        new TrackedEventModel
        {
            EventType = "ProductClicked",
            SessionId = "session-abc-123",
            ProductId = "PROD-001"
        }
    }
});

Replace BaseUrl with the URL of your Bizzkit Tracking Event Receiver and InstrumentationKey with your provisioned key.

Info

The Event Receiver responds with 202 Accepted — events are processed asynchronously.

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.

Supported event types

Event Type Description
ProductClicked A user clicked on a product
ProductAddedToCart A user added a product to their cart
OrderCreated A user completed an order
Search A user performed a search

For a complete tutorial on order tracking, see For Developers.