-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
581 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Package rta RTA策略管理 | ||
package rta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package rta | ||
|
||
import ( | ||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/tools/rta" | ||
) | ||
|
||
// Get 获取可用的RTA策略 | ||
func Get(clt *core.SDKClient, accessToken string, req *rta.GetRequest) ([]rta.RtaInfo, error) { | ||
var resp rta.GetResponse | ||
if err := clt.Get("2/tools/rta/get/", req, &resp, accessToken); err != nil { | ||
return nil, err | ||
} | ||
return resp.Data.List, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package rta | ||
|
||
import ( | ||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/tools/rta" | ||
) | ||
|
||
// GetInfo 获取RTA策略数据 API Response | ||
func GetInfo(clt *core.SDKClient, accessToken string, req *rta.GetInfoRequest) (*rta.GetInfoData, error) { | ||
var resp rta.GetInfoResponse | ||
if err := clt.Get("2/tools/rta/get_info/", req, &resp, accessToken); err != nil { | ||
return nil, err | ||
} | ||
return resp.Data, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package rta | ||
|
||
import ( | ||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/tools/rta" | ||
) | ||
|
||
// ExpGet 获取穿山甲渠道RTA联合实验数据 | ||
// 功能 | ||
// 该接口用于查询穿山甲渠道的RTA联合实验数据 | ||
func RtaExpGet(clt *core.SDKClient, accessToken string, req *rta.RtaExpGetRequest) ([]rta.Report, error) { | ||
var resp rta.RtaExpGetResponse | ||
if err := clt.Get("2/report/rta_exp/get/", req, &resp, accessToken); err != nil { | ||
return nil, err | ||
} | ||
return resp.Data.Data, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package rta | ||
|
||
import ( | ||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/tools/rta" | ||
) | ||
|
||
// RtaExpLocalDailyGet 获取站内媒体RTA联合实验数据分天(t+1) | ||
// 功能 | ||
// 该接口用于查询站内媒体渠道的RTA联合实验数据,支持分天t+1级别数据 | ||
// 注:由于数据更新时间存在波动性,建议在查询当日上午7点后尝试拉取前一天的数据 | ||
func RtaExpLocalDailyGet(clt *core.SDKClient, accessToken string, req *rta.RtaExpLocalDailyGetRequest) ([]rta.Report, error) { | ||
var resp rta.RtaExpLocalDailyGetResponse | ||
if err := clt.Get("v3.0/report/rta_exp_local_daily/get/", req, &resp, accessToken); err != nil { | ||
return nil, err | ||
} | ||
return resp.Data.Data, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package rta | ||
|
||
import ( | ||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/tools/rta" | ||
) | ||
|
||
// RtaExpLocalHourlyGet 获取站内媒体RTA联合实验数据(分时t+5) | ||
// 功能 | ||
// 该接口用于查询站内媒体渠道的RTA联合实验数据,支持分时t+5级别数据 | ||
func RtaExpLocalHourlyGet(clt *core.SDKClient, accessToken string, req *rta.RtaExpLocalHourlyGetRequest) ([]rta.Report, error) { | ||
var resp rta.RtaExpLocalHourlyGetResponse | ||
if err := clt.Get("v3.0/report/rta_exp_local_hourly/get/", req, &resp, accessToken); err != nil { | ||
return nil, err | ||
} | ||
return resp.Data.Data, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package rta | ||
|
||
import ( | ||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/tools/rta" | ||
) | ||
|
||
// ScopeGet 获取RTA策略绑定信息列表 | ||
// 获取RTA策略下的项目(广告组)列表,一个rta策略要么绑定campaign要么绑定project,不可能同时绑定 | ||
func ScopeGet(clt *core.SDKClient, accessToken string, req *rta.ScopeGetRequest) ([]rta.Scope, error) { | ||
var resp rta.ScopeGetResponse | ||
if err := clt.Get("2/tools/rta/scope/get/", req, &resp, accessToken); err != nil { | ||
return nil, err | ||
} | ||
return resp.Data.List, nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package rta | ||
|
||
import ( | ||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/tools/rta" | ||
) | ||
|
||
// SetScope 设置账户下RTA策略生效范围 | ||
// 设置广告账户下某个RTA策略的生效范围,设置一个新的RTA策略时,默认为停用状态,需要继续调用修改RTA策略状态 | ||
func SetScope(clt *core.SDKClient, accessToken string, req *rta.SetScopeRequest) error { | ||
return clt.Post("2/tools/rta/set_scope/", req, nil, accessToken) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package rta | ||
|
||
import ( | ||
"github.com/bububa/oceanengine/marketing-api/core" | ||
"github.com/bububa/oceanengine/marketing-api/model/tools/rta" | ||
) | ||
|
||
// StatusUpdate 批量启停账户下RTA策略 | ||
// 修改RTA策略状态 | ||
func StatusUpdate(clt *core.SDKClient, accessToken string, req *rta.StatusUpdateRequest) error { | ||
return clt.Post("2/tools/rta/status_update/", req, nil, accessToken) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package enum | ||
|
||
// RtaStatus 目标状态 | ||
type RtaStatus string | ||
|
||
const ( | ||
// RtaStatus_ENABLE 启用 | ||
RtaStatus_ENABLE RtaStatus = "ENABLE" | ||
// RtaStatus_DISABLE 停用 | ||
RtaStatus_DISABLE RtaStatus = "DISABLE" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package enum | ||
|
||
// RtaTargetType 生效维度 | ||
type RtaTargetType string | ||
|
||
const ( | ||
// RtaTargetType_ADV 广告账户 | ||
RtaTargetType_ADV RtaTargetType = "ADV" | ||
// RtaTargetType_CAMPAIGN 广告组 | ||
RtaTargetType_CAMPAIGN RtaTargetType = "CAMPAIGN" | ||
// RtaTargetType_PROJECT 项目(体验版) | ||
RtaTargetType_PROJECT RtaTargetType = "PROJECT" | ||
) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Package rta RTA策略管理 | ||
package rta |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package rta | ||
|
||
import ( | ||
"strconv" | ||
|
||
"github.com/bububa/oceanengine/marketing-api/model" | ||
"github.com/bububa/oceanengine/marketing-api/util" | ||
) | ||
|
||
// GetRequest 获取可用的RTA策略 API Request | ||
type GetRequest struct { | ||
// AdvertiserID 广告主ID | ||
AdvertiserID uint64 `json:"advertiser_id,omitempty"` | ||
} | ||
|
||
// Encode implement GetRequest interface | ||
func (r GetRequest) Encode() string { | ||
values := util.GetUrlValues() | ||
values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10)) | ||
ret := values.Encode() | ||
util.PutUrlValues(values) | ||
return ret | ||
} | ||
|
||
// GetResponse 获取可用的RTA策略 API Response | ||
type GetResponse struct { | ||
model.BaseResponse | ||
Data struct { | ||
// List 可用的RTA策略列表 | ||
List []RtaInfo `json:"list,omitempty"` | ||
} `json:"data,omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
package rta | ||
|
||
import ( | ||
"strconv" | ||
|
||
"github.com/bububa/oceanengine/marketing-api/model" | ||
"github.com/bububa/oceanengine/marketing-api/util" | ||
) | ||
|
||
// GetInfoRequest 获取RTA策略数据 API Request | ||
type GetInfoRequest struct { | ||
// AdvertiserID 广告主ID | ||
AdvertiserID uint64 `json:"advertiser_id,omitempty"` | ||
// CampaignID 广告组id,若传入,则拉取的是组维度的RTA策略 | ||
CampaignID uint64 `json:"campaign_id,omitempty"` | ||
} | ||
|
||
// Encode implement GetRequest interface | ||
func (r GetInfoRequest) Encode() string { | ||
values := util.GetUrlValues() | ||
values.Set("advertiser_id", strconv.FormatUint(r.AdvertiserID, 10)) | ||
values.Set("campaign_id", strconv.FormatUint(r.CampaignID, 10)) | ||
ret := values.Encode() | ||
util.PutUrlValues(values) | ||
return ret | ||
} | ||
|
||
// GetInfoResponse 获取RTA策略数据 API Response | ||
type GetInfoResponse struct { | ||
model.BaseResponse | ||
Data *GetInfoData `json:"data,omitempty"` | ||
} | ||
|
||
type GetInfoData struct { | ||
// InterfaceInfo RTA配置数据 | ||
InterfaceInfo *InterfaceInfo `json:"interface_info,omitempty"` | ||
// RtaInfo RTA策略信息 | ||
RtaInfo *RtaInfo `json:"rta_info,omitempty"` | ||
} | ||
|
||
// InterfaceInfo RTA配置数据 | ||
type InterfaceInfo struct { | ||
// Status 接口地址状态 | ||
// 1:生效 0:失效 | ||
Status int `json:"status,omitempty"` | ||
// DeliveryRange 适用流量范围: | ||
// LOCAL_ONLY: 站内 | ||
// UNION_ONLY: 穿山甲 | ||
// UNIVERSAL_DELIVERY: 全部 | ||
DeliveryRange string `json:"delivery_range,omitempty"` | ||
// LocalQPS 站内QPS | ||
LocalQPS int64 `json:"local_qps,omitempty"` | ||
// UnionQPS 穿山甲QPS | ||
UnionQPS int64 `json:"union_qps,omitempty"` | ||
// URL 接口地址 | ||
URL string `json:"url,omitempty"` | ||
} | ||
|
||
// RtaInfo RTA策略信息 | ||
type RtaInfo struct { | ||
// RtaID RTA策略ID | ||
RtaID uint64 `json:"rta_id,omitempty"` | ||
// Remark 备注,即RTA策略描述 | ||
Remark string `json:"remark,omitempty"` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package rta | ||
|
||
import "github.com/bububa/oceanengine/marketing-api/model" | ||
|
||
type Report struct { | ||
// Date 数据统计日期,格式YYYYMMDDHH | ||
Date string `json:"date,omitempty"` | ||
// VID 联合实验组唯一标识 | ||
VID int `json:"vid,omitempty"` | ||
// CusVID 客户自行开分桶实验的唯一标识 | ||
CusVID int `json:"cus_vid,omitempty"` | ||
// Strategy 联合实验策略,请求入参 | ||
Strategy model.Int `json:"strategy,omitempty"` | ||
// Click 展现数据-点击数。当头条用户点击广告素材时,触发点击事件,该事件被认为是一次有效的广告点击 | ||
Click int64 `json:"click,omitempty"` | ||
// Show 展现数据-展示数。广告展示给用户的次数。计算方式:经平台判定有效且被计费的展示次数 | ||
Show int64 `json:"show,omitempty"` | ||
// Convert 转化数据-转化数。将转化数记录在转化事件发生的时间上。建议广告主考核成本时参考“转化数据(计费时间)”例如您的广告在早上8点进行了展示和点击,用户晚上19点发生了激活行为,我们会把激活数披露在晚上19点 | ||
Convert int64 `json:"convert,omitempty"` | ||
// Cost 展现数据-总花费。表示广告在投放期内的预估花费金额 | ||
Cost float64 `json:"cost,omitempty"` | ||
// BidCoef 返回RTA出价系数的区间值 | ||
BidCoef string `json:"bid_coef,omitempty"` | ||
// WinRatio 竞胜率。竞胜率=竞胜数/参竞数,代表广告主参竞请求的胜出比例,范围 0~1 | ||
WinRatio float64 `json:"win_ratio,omitempty"` | ||
} |
Oops, something went wrong.