Skip to content

Customer.io Data Pipelines analytics client for Go

License

Notifications You must be signed in to change notification settings

customerio/cdp-analytics-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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:

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

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 99.8%
  • Makefile 0.2%