Documentation ¶
Index ¶
Constants ¶
View Source
const ( StdEndpoint string = "https://www.googleapis.com/analytics/v3/data/ga" // standard endpoint Limit int = 5 // max requests / sec guard )
Base constants
View Source
const ( BaseEndpoint string = "https://www.googleapis.com/analytics/v3/management/accounts/" End string = "unsampledReports" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CleanResponse ¶
type CleanResponse struct { Columns []struct { Name string `json:"name"` CType string `json:"columnType"` DType string `json:"dataType"` } `json:"columnHeaders"` Total map[string]string `json:"totalsForAllResults"` Rows [][]string `json:"rows"` }
Processed GA response
type GAData ¶
type GAData struct { Auth *utils.OauthData Request *GaRequest Response *GaResponse }
GAData is the primary Google Analytics API pull structure
func (*GAData) BatchGet ¶
func (g *GAData) BatchGet(requests []*GaRequest) (responses []*CleanResponse, err error)
BatchGet runs all queries in parellel and returns the results (or times out)
type GaRequest ¶
type GaRequest struct { Id string `json:"ids"` StartDate string `json:"start-date"` EndDate string `json:"end-date"` Metrics string `json:"metrics"` Dimensions string `json:"dimensions"` Filters string `json:"filters"` Segments string `json:"segment"` Sort string `json:"sort"` MaxResults int `json:"max-results"` Attempts int }
GaRequest is the Google Analytics request structure
func (*GaRequest) ToURLValues ¶
ToURLValues converts struct to url.Values struct
type GaResponse ¶
Initial returned response
func (GaResponse) Process ¶
func (rawResponse GaResponse) Process() (data CleanResponse, ok bool)
type UnsampledRequest ¶
type UnsampledRequest struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.