https://github.com/ad/ymo
Go package for sending offline conversions to Yandex.Metrika
https://github.com/ad/ymo
Last synced: 7 months ago
JSON representation
Go package for sending offline conversions to Yandex.Metrika
- Host: GitHub
- URL: https://github.com/ad/ymo
- Owner: ad
- License: mit
- Created: 2024-02-24T07:10:02.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-02-24T14:43:10.000Z (over 2 years ago)
- Last Synced: 2025-01-25T20:11:21.654Z (over 1 year ago)
- Language: Go
- Homepage:
- Size: 10.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ymo
[](https://godoc.org/github.com/ad/ymo)
[](https://github.com/ad/ymo/actions/workflows/gotest.yml)
ymo is a Go package for sending offline conversions to Yandex.Metrika. It provides a convenient way to upload offline conversion data to Yandex.Metrika's API.
For detailed documentation and API reference, please visit the [official Yandex.Metrika documentation](https://yandex.ru/dev/metrika/doc/api2/management/offline_conversion/upload.html).
## Installation
To use ymo in your Go project, you need to import it:
### Usage
```go
package main
import (
"fmt"
"github.com/ad/ymo"
)
func main() {
client := ymo.NewYMOClient("1234567", "your ym token", "CLIENT_ID", true)
err := client.SendEvent(
ymo.Event{
ClientId: "your client id",
Target: "GOAD_ID",
DateTime: strconv.FormatInt(time.Now().Unix(), 10),
Price: fmt.Sprintf("%.2f", 999.99),
Currency: "RUB",
},
)
if err != nil {
fmt.Println(err)
}
}
```