aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/cli/internal/client/analytics.go
blob: 71381f03353950c01663d98e9b4b939aad90a5bb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package client

import (
	"encoding/json"
)

// RecordAnalyticsEvents is a specific method for POSTing events to Vercel
func (c *APIClient) RecordAnalyticsEvents(events []map[string]interface{}) error {
	body, err := json.Marshal(events)
	if err != nil {
		return err

	}

	// We don't care about the response here
	if _, err := c.JSONPost("/v8/artifacts/events", body); err != nil {
		return err
	}

	return nil
}