-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathanalytics_service.go
69 lines (62 loc) · 2.97 KB
/
analytics_service.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package yext
const analyticsPath = "analytics/reports"
type AnalyticsService struct {
client *Client
}
type AnalyticsFilters struct {
StartDate *string `json:"startDate"`
EndDate *string `json:"endDate"`
LocationIds *[]string `json:"locationIds"`
FolderId *int `json:"folderId"`
Countries *[]string `json:"countries"`
LocationLabels *[]string `json:"locationLabels"`
Platforms *[]string `json:"platforms"`
GoogleActionType *[]string `json:"googleActionType"`
CustomerActionType *[]string `json:"customerActionType"`
GoogleQueryType *[]string `json:"googleQueryType"`
Hours *[]int `json:"hours"`
Ratings *[]int `json:"ratings"`
FrequentWords *[]string `json:"frequentWords"`
Partners *[]int `json:"partners"`
ReviewLabels *[]int `json:"reviewLabels"`
PageTypes *[]string `json:"pageTypes"`
ListingsLiveType *string `json:"listingsLiveType"`
PublisherSuggestionType *[]string `json:"publisherSuggestionType"`
QueryTemplate *[]string `json:"queryTemplate"`
SearchEngine *[]string `json:"searchEngine"`
Keyword *[]string `json:"keyword"`
Competitor *[]string `json:"competitor"`
MatchPosition *[]string `json:"matchPosition"`
SearchResultType *[]string `json:"searchResultType"`
MatchType *[]string `json:"matchType"`
MinSearchFrequency *int `json:"minSearchFrequency"`
MaxSearchFrequency *int `json:"maxSearchFrequency"`
SearchTerm *string `json:"searchTerm"`
SearchType *string `json:"searchType"`
FoursquareCheckinType *string `json:"foursquareCheckinType"`
FoursquareCheckinAge *string `json:"foursquareCheckinAge"`
FoursquareCheckinGender *string `json:"foursquareCheckinGender"`
FoursquareCheckinTimeOfDay *string `json:"foursquareCheckinTimeOfDay"`
InstagramContentType *string `json:"instagramContentType"`
Age *[]string `json:"age"`
Gender *string `json:"gender"`
FacebookImpressionType *[]string `json:"facebookImpressionType"`
FacebookStoryType *[]string `json:"facebookStoryType"`
}
type AnalyticsReportRequest struct {
Metrics []string `json:"metrics"`
Dimensions []string `json:"dimensions"`
Filters *AnalyticsFilters `json:"filters"`
}
type AnalyticsReportResponse struct {
Data []*AnalyticsData `json:"data"`
Id int `json:"id"`
}
func (a *AnalyticsService) Create(req *AnalyticsReportRequest) (*AnalyticsReportResponse, *Response, error) {
arr := &AnalyticsReportResponse{}
r, err := a.client.DoRequestJSON("POST", analyticsPath, req, arr)
if err != nil {
return nil, r, err
}
return arr, r, nil
}