Skip to content

ddev/analytics-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This fork is used to fix an issue in this package see ddev/ddev#4866. It can be deleted once the fix is released in the upstream. See amplitude#56 for the upstream PR.


Build go-doc

Announcement 📣

Amplitude is introducing Go SDK. Compared to plain HTTP V2 API, it provides improved developer experience, helps users instrument data more seamlessly and provides more control over data being instrumented using custom plugins.

To learn more about the new SDK, here are some useful links:

Official Amplitude Go SDK

This is Amplitude's latest and official version of Go SDK.

Installation

Install analytics-go using go get:

go get github.com/amplitude/analytics-go

Usage

package main

import (
	"github.com/amplitude/analytics-go/amplitude"
)

func main() {

	config := amplitude.NewConfig("your-api-key")

	client := amplitude.NewClient(config)

	// Track a basic event
	// One of UserID and DeviceID is required
	client.Track(amplitude.Event{
		EventType: "type-of-event",
		UserID:    "user-id",
	})

	// Flushed queued events and shutdown the client
	client.Shutdown()
}

Need Help?

If you have any issues using our SDK, feel free to create a GitHub issue or submit a request on Amplitude Help.

About

Go Amplitude Analytics SDK

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 100.0%