site/vendor/gopkg.in/segmentio/analytics-go.v3
Cadey Ratio 6b7d6dcc49 add analytics via segment again 2018-08-22 03:17:59 +00:00
..
.gitignore add analytics via segment again 2018-08-22 03:17:59 +00:00
.gitmodules add analytics via segment again 2018-08-22 03:17:59 +00:00
History.md add analytics via segment again 2018-08-22 03:17:59 +00:00
License.md add analytics via segment again 2018-08-22 03:17:59 +00:00
Makefile add analytics via segment again 2018-08-22 03:17:59 +00:00
Readme.md add analytics via segment again 2018-08-22 03:17:59 +00:00
alias.go add analytics via segment again 2018-08-22 03:17:59 +00:00
analytics.go add analytics via segment again 2018-08-22 03:17:59 +00:00
config.go add analytics via segment again 2018-08-22 03:17:59 +00:00
context.go add analytics via segment again 2018-08-22 03:17:59 +00:00
error.go add analytics via segment again 2018-08-22 03:17:59 +00:00
executor.go add analytics via segment again 2018-08-22 03:17:59 +00:00
group.go add analytics via segment again 2018-08-22 03:17:59 +00:00
identify.go add analytics via segment again 2018-08-22 03:17:59 +00:00
integrations.go add analytics via segment again 2018-08-22 03:17:59 +00:00
json.go add analytics via segment again 2018-08-22 03:17:59 +00:00
logger.go add analytics via segment again 2018-08-22 03:17:59 +00:00
message.go add analytics via segment again 2018-08-22 03:17:59 +00:00
page.go add analytics via segment again 2018-08-22 03:17:59 +00:00
properties.go add analytics via segment again 2018-08-22 03:17:59 +00:00
screen.go add analytics via segment again 2018-08-22 03:17:59 +00:00
timeout_15.go add analytics via segment again 2018-08-22 03:17:59 +00:00
timeout_16.go add analytics via segment again 2018-08-22 03:17:59 +00:00
track.go add analytics via segment again 2018-08-22 03:17:59 +00:00
traits.go add analytics via segment again 2018-08-22 03:17:59 +00:00

Readme.md

analytics-go Circle CI go-doc

Segment analytics client for Go.

Installation

The package can be simply installed via go get, we recommend that you use a package version management system like the Go vendor directory or a tool like Godep to avoid issues related to API breaking changes introduced between major versions of the library.

To install it in the GOPATH:

go get https://github.com/segmentio/analytics-go

Documentation

The links bellow should provide all the documentation needed to make the best use of the library and the Segment API:

Usage

package main

import (
    "os"

    "github.com/segmentio/analytics-go"
)

func main() {
    // Instantiates a client to use send messages to the segment API.
    client := analytics.New(os.Getenv("SEGMENT_WRITE_KEY"))

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

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

License

The library is released under the MIT license.