All URIs are relative to https://up.go-adserver.com
| Method | HTTP request | Description |
|---|---|---|
| ApiV1PublisherStatsGet | Get /api/v1/publisher/stats | Publisher earnings (sites / adzones). |
StatsResponse ApiV1PublisherStatsGet(ctx).From(from).To(to).Interval(interval).Viewtype(viewtype).GroupBy(groupBy).Metrics(metrics).FilterWebsite(filterWebsite).FilterAdzoneId(filterAdzoneId).FilterCountry(filterCountry).FilterDevice(filterDevice).FilterAdType(filterAdType).FilterSellingType(filterSellingType).FilterTagId(filterTagId).FilterAdzoneType(filterAdzoneType).FilterAdDomain(filterAdDomain).FilterBots(filterBots).Min(min).Max(max).Format(format).Page(page).PerPage(perPage).Sort(sort).Execute()
Publisher earnings (sites / adzones).
package main
import (
"context"
"fmt"
"os"
"time"
openapiclient "github.com/goadserver/goadserver-go"
)
func main() {
from := time.Now() // string | ISO date — inclusive start. Defaults to 7 days ago. (optional)
to := time.Now() // string | ISO date — inclusive end. Defaults to today. Max range 92 days. (optional)
interval := "interval_example" // string | (optional) (default to "sum")
viewtype := "viewtype_example" // string | The panel's name for `interval` (\"Display By\"). Used only when `interval` is absent. (optional)
groupBy := []string{"GroupBy_example"} // []string | Dimensions to aggregate by, in priority order. Multi-pick up to 8. High-cardinality dims (`subid`, `clickid`, `sid*`, `domain`) explode row count — pair with `from`/`to`/pagination. Each grouped dimension comes back as an `{id, name}` object, except `country`, `domain` and `subid`, which are plain strings. `ad_type` is the campaign ad type (name from the tenant's ad-type list); `ad_domain` is the ad-serving domain the impression was served from (`{id, name}` with the domain as name). On the free-text dims that do return an object (`clickid`, `sid1`–`sid5`) the `id` is always 0 and `name` carries the value. (optional)
metrics := []string{"Metrics_example"} // []string | Metrics to return. Multi-pick — leave empty for all. Unknown names are ignored. `bot_views` / `bot_clicks` (views / clicks the ad server flagged as bot traffic, a subset of `views` / `clicks`) only where Bot Info is enabled, `costs` and `cost_per_conv_a` … `cost_per_conv_e` only on admanager tenants — see above. (optional)
filterWebsite := int32(56) // int32 | Site ID — look up via `GET /api/v1/sites`. (optional)
filterAdzoneId := "12345,12346" // string | Adspace ID, or comma-separated list. Look up via `GET /api/v1/adspaces`. (optional)
filterCountry := "US" // string | ISO-3166 alpha-2 country code (e.g. `US`, `DE`, `BR`). (optional)
filterDevice := int32(56) // int32 | Device type: | ID | Device | |----|--------| | 1 | Computer | | 2 | Tablet | | 3 | Phone | | 4 | Console | | 5 | Wearable | | 6 | TV | (optional)
filterAdType := int32(56) // int32 | Ad-type ID. Available types are tenant-specific (banner, popunder, native, video, push, …); the dropdown shows the types active on your system. (optional)
filterSellingType := int32(56) // int32 | Campaign selling type: | ID | Selling type | |----|--------------| | 1 | RON (CPC) | | 2 | Flatrate | | 3 | CPM | | 4 | RTB | | 5 | SmartZone | (optional)
filterTagId := "filterTagId_example" // string | Tag ID, or comma-separated list. Resolves to the bound adzones. (optional)
filterAdzoneType := "2,11" // string | Adzone type id(s), comma-separated (the `id` of `GET /api/v1/lookups/adspace-types`). (optional)
filterAdDomain := "14" // string | Ad-serving domain id(s), comma-separated — the `id` returned for `group_by=ad_domain`. (optional)
filterBots := int32(56) // int32 | `1` = only traffic flagged as bots, `2` = exclude it. Ignored unless Bot Info is enabled for the account (see above). (optional)
min := map[string]float32{"key": map[string]float32{"key": float32(123)}} // map[string]float32 | Keep only rows whose metric is at least this value, as `min[<metric>]=<number>` — e.g. `min[cost_per_conv_a]=10`. Pair with `max[<metric>]` for a range (both ends inclusive). Any metric `metrics` accepts for this caller can be bounded, whether or not it is returned; several metrics combine with AND. A row with no value for the metric is dropped. Money in main currency units, `ctr` in percent. Same as the comparisons (`>10`, `<200`, `10-200`) in the panel's statistics details column search. With a bound set, up to 10,000 grouped rows (in `sort` order) are tested and the survivors paginated; `total_rows` counts the survivors, `totals` stay over the whole selection, and `range_scan_truncated: true` says more rows existed than were tested. Unknown metric, non-number or min > max → 422. (optional)
max := map[string]float32{"key": map[string]float32{"key": float32(123)}} // map[string]float32 | Keep only rows whose metric is at most this value, as `max[<metric>]=<number>`. See `min`. (optional)
format := "format_example" // string | (optional) (default to "json")
page := int32(56) // int32 | (optional) (default to 1)
perPage := int32(56) // int32 | (optional) (default to 100)
sort := "sort_example" // string | Field name. Prefix with `-` for descending (e.g. `-views`). (optional)
configuration := openapiclient.NewConfiguration()
apiClient := openapiclient.NewAPIClient(configuration)
resp, r, err := apiClient.StatsPublisherAPI.ApiV1PublisherStatsGet(context.Background()).From(from).To(to).Interval(interval).Viewtype(viewtype).GroupBy(groupBy).Metrics(metrics).FilterWebsite(filterWebsite).FilterAdzoneId(filterAdzoneId).FilterCountry(filterCountry).FilterDevice(filterDevice).FilterAdType(filterAdType).FilterSellingType(filterSellingType).FilterTagId(filterTagId).FilterAdzoneType(filterAdzoneType).FilterAdDomain(filterAdDomain).FilterBots(filterBots).Min(min).Max(max).Format(format).Page(page).PerPage(perPage).Sort(sort).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "Error when calling `StatsPublisherAPI.ApiV1PublisherStatsGet``: %v\n", err)
fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
}
// response from `ApiV1PublisherStatsGet`: StatsResponse
fmt.Fprintf(os.Stdout, "Response from `StatsPublisherAPI.ApiV1PublisherStatsGet`: %v\n", resp)
}Other parameters are passed through a pointer to a apiApiV1PublisherStatsGetRequest struct via the builder pattern
| Name | Type | Description | Notes |
|---|---|---|---|
| from | string | ISO date — inclusive start. Defaults to 7 days ago. | |
| to | string | ISO date — inclusive end. Defaults to today. Max range 92 days. | |
| interval | string | [default to "sum"] | |
| viewtype | string | The panel's name for `interval` ("Display By"). Used only when `interval` is absent. | |
| groupBy | []string | Dimensions to aggregate by, in priority order. Multi-pick up to 8. High-cardinality dims (`subid`, `clickid`, `sid*`, `domain`) explode row count — pair with `from`/`to`/pagination. Each grouped dimension comes back as an `{id, name}` object, except `country`, `domain` and `subid`, which are plain strings. `ad_type` is the campaign ad type (name from the tenant's ad-type list); `ad_domain` is the ad-serving domain the impression was served from (`{id, name}` with the domain as name). On the free-text dims that do return an object (`clickid`, `sid1`–`sid5`) the `id` is always 0 and `name` carries the value. | |
| metrics | []string | Metrics to return. Multi-pick — leave empty for all. Unknown names are ignored. `bot_views` / `bot_clicks` (views / clicks the ad server flagged as bot traffic, a subset of `views` / `clicks`) only where Bot Info is enabled, `costs` and `cost_per_conv_a` … `cost_per_conv_e` only on admanager tenants — see above. | |
| filterWebsite | int32 | Site ID — look up via `GET /api/v1/sites`. | |
| filterAdzoneId | string | Adspace ID, or comma-separated list. Look up via `GET /api/v1/adspaces`. | |
| filterCountry | string | ISO-3166 alpha-2 country code (e.g. `US`, `DE`, `BR`). | |
| filterDevice | int32 | Device type: | ID |
| filterAdType | int32 | Ad-type ID. Available types are tenant-specific (banner, popunder, native, video, push, …); the dropdown shows the types active on your system. | |
| filterSellingType | int32 | Campaign selling type: | ID |
| filterTagId | string | Tag ID, or comma-separated list. Resolves to the bound adzones. | |
| filterAdzoneType | string | Adzone type id(s), comma-separated (the `id` of `GET /api/v1/lookups/adspace-types`). | |
| filterAdDomain | string | Ad-serving domain id(s), comma-separated — the `id` returned for `group_by=ad_domain`. | |
| filterBots | int32 | `1` = only traffic flagged as bots, `2` = exclude it. Ignored unless Bot Info is enabled for the account (see above). | |
| min | map[string]map[string]float32 | Keep only rows whose metric is at least this value, as `min[<metric>]=<number>` — e.g. `min[cost_per_conv_a]=10`. Pair with `max[<metric>]` for a range (both ends inclusive). Any metric `metrics` accepts for this caller can be bounded, whether or not it is returned; several metrics combine with AND. A row with no value for the metric is dropped. Money in main currency units, `ctr` in percent. Same as the comparisons (`>10`, `<200`, `10-200`) in the panel's statistics details column search. With a bound set, up to 10,000 grouped rows (in `sort` order) are tested and the survivors paginated; `total_rows` counts the survivors, `totals` stay over the whole selection, and `range_scan_truncated: true` says more rows existed than were tested. Unknown metric, non-number or min > max → 422. | |
| max | map[string]map[string]float32 | Keep only rows whose metric is at most this value, as `max[<metric>]=<number>`. See `min`. | |
| format | string | [default to "json"] | |
| page | int32 | [default to 1] | |
| perPage | int32 | [default to 100] | |
| sort | string | Field name. Prefix with `-` for descending (e.g. `-views`). |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]