Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateWidget ¶
CreateWidget parses the Analytics Reporting API V4 response and returns a termui tablee. It will only add X maxRows if passed. If 0 is passed for maxRows it will add all the rows.
func PrintResponse ¶
func PrintResponse(resp *ga.GetReportsResponse, maxRows int) error
PrintResponse parses and prints the Analytics Reporting API V4 response in the form of a tabwriter table. It will only print X maxRows if passed. If 0 is passed for maxRows it will print all the rows.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client holds the information for a Google Analytics reporting client.
func New ¶
New takes a keyfile for auththentication and returns a new Google Analytics Reporting Client struct. Your credentials should be obtained from the Google Developer Console (https://console.developers.google.com). Navigate to your project, then see the "Credentials" page under "APIs & Auth". To create a service account client, click "Create new Client ID", select "Service Account", and click "Create Client ID". A JSON key file will then be downloaded to your computer.
func (*Client) GetProfileName ¶
GetProfileName returns the name of a Google Analytics profile.
func (*Client) GetRealtimeActiveUsers ¶
GetRealtimeActiveUsers queries the Analytics Realtime Reporting API V3 using the Analytics Reporting API V3 service object. It returns the Analytics Realtime Reporting API V3 response for how many active users are currently on the site.