Skip to content

About

Customer.io Data Pipelines analytics client for Go

Resources

Stars

3 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

288 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Customer.io Data Pipelines analytics client for Go.

Installation

go get github.com/customerio/cdp-analytics-go

Usage

package main

import (
    "os"

    "github.com/customerio/cdp-analytics-go"
)

func main() {
    client := analytics.New(os.Getenv("WRITE_KEY"))

    // Enqueues a track event that will be sent asynchronously.
    client.Enqueue(analytics.Track{
        UserId: "4",
        Event:  "order_complete",
    })

    // Flushes any queued messages and closes the client.
    client.Close()
}

Other Regions

If you're using a different data center such as our EU region, you can specify an alternate endpoint:

API keys with _eu_ in their prefix (such as sk_eu_... or pk_eu_...) default to the EU endpoint, so they don't need this. Other keys default to DefaultEndpoint.

package main

import (
    "os"

    "github.com/customerio/cdp-analytics-go"
)

func main() {
    client, err := analytics.NewWithConfig(os.Getenv("WRITE_KEY"), analytics.Config{
        Endpoint: "https://cdp-eu.customer.io",
    })
    if err != nil {
        panic(err)
    }

    // ...
}

Documentation

The links below contain more detailed documentation on how to use this library:

About

Customer.io Data Pipelines analytics client for Go

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages