CDPGuidesSupport
SDKsIngest

Go SDK (ingest)

Quickly integrate the Ours Privacy Go SDK using go get. Send test requests from the Track Events API reference.

This is a quick start guide for integrating the Ours Privacy Go SDK (golang) into your server-side applications.

Installation

Install the SDK via go get:

go get github.com/with-ours/ingest-sdk-go

For more details, visit the Go package repository | Github Repo.

Usage

Initialize the SDK and send events with just a few lines of code:

package main

import (
    "context"
    oursprivacy "github.com/with-ours/ingest-sdk-go"
)

func main() {
    client := oursprivacy.NewClient()

    ctx := context.Background()

    // Track an event
    _, err := client.Track.Event(ctx, oursprivacy.TrackEventParams{
        Token: "your-api-key",
        Event: "Purchase",
        UserID: "user123",
    })
    if err != nil {
        // handle error
    }
}

Explore the API

Want to see what the SDK can do? Send test requests from the Track Events API reference.

How is this guide?

On this page