statistics

package
v0.0.0-...-f32fcc8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2019 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//最大事件跨度30
	GetAPISummaryUrl = "https://api.weixin.qq.com/datacube/getinterfacesummary?access_token=%s"
	//最大事件跨度1
	GetApISummaryHourUrl = "https://api.weixin.qq.com/datacube/getinterfacesummaryhour?access_token=%s"
)
View Source
const (
	GetUpStreamMsg          = "https://api.weixin.qq.com/datacube/getupstreammsg?access_token=%s"
	GetUpStreamMsgHour      = "https://api.weixin.qq.com/datacube/getupstreammsghour?access_token=%s"
	GetUpStreamMsgWeek      = "https://api.weixin.qq.com/datacube/getupstreammsgweek?access_token=%s"
	GetUpStreamMsgMonth     = "https://api.weixin.qq.com/datacube/getupstreammsgmonth?access_token=%s"
	GetUpStreamMsgDist      = "https://api.weixin.qq.com/datacube/getupstreammsgdist?access_token=%s"
	GetUpStreamMsgDistWeek  = "https://api.weixin.qq.com/datacube/getupstreammsgdistweek?access_token=%s"
	GetUpStreamMsgDistMonth = "https://api.weixin.qq.com/datacube/getupstreammsgdistmonth?access_token=%s"
)
View Source
const (
	//获取某天所有被阅读过的文章(仅包括群发的文章)在当天的阅读次数等数据
	GetNewSummaryUrl = "https://api.weixin.qq.com/datacube/getarticlesummary?access_token=%s" //时间跨度1天
	//获取某天群发的文章,从群发日起到接口调用日(但最多统计发表日后7天数据),每天的到当天的总等数据。
	GetNewsTotalUrl     = "https://api.weixin.qq.com/datacube/getarticletotal?access_token=%s"  //时间跨度1天
	GetUserReadUrl      = "https://api.weixin.qq.com/datacube/getuserread?access_token=%s"      //时间跨度3天
	GetUserReadHourUrl  = "https://api.weixin.qq.com/datacube/getuserreadhour?access_token=%s"  //时间跨度1天
	GetUserShareUrl     = "https://api.weixin.qq.com/datacube/getusershare?access_token=%s"     //时间跨度7天
	GetUserShareHourUrl = "https://api.weixin.qq.com/datacube/getusersharehour?access_token=%s" //时间跨度1天
)
View Source
const (
	GetUserSummaryUrl  = "https://api.weixin.qq.com/datacube/getusersummary?access_token=%s"   //最大事件跨度7天
	GetUserCumulateUrl = "	https://api.weixin.qq.com/datacube/getusercumulate?access_token=%s" //最大事件跨度7天
)

最大时间跨度是指一次接口调用时最大可获取数据的时间范围,如最大时间跨度为7是指最多一次性获取7天的数据

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiSummary

type ApiSummary struct {
	Date          string `json:"ref_date"`        //数据日期
	Hour          int    `json:"ref_hour"`        //数据的小时
	CallBackCount int    `json:"callback_count"`  //通过服务器配置地址获得消息后,被动回复用户消息的次数
	FailCount     int    `json:"fail_count"`      //上述动作的失败次数
	TotalTimeCost int    `json:"total_time_cost"` //总耗时,除以callback_count即为平均耗时
	MaxTimeCost   int    `json:"max_time_cost"`   //最大耗时
}

func GetApiSummaryHourly

func GetApiSummaryHourly(accessToken, beginDate, endDate string) ([]*ApiSummary, error)

func GetApiSummarydaily

func GetApiSummarydaily(accessToken, beginDate, endDate string) ([]*ApiSummary, error)

type MsgDistInfo

type MsgDistInfo struct {
	Date          string `json:"ref_date"`
	CountInterval int    `json:"count_interval"`
	MsgUser       int    `json:"msg_user"`
}

func GetMsgSummaryDisDaily

func GetMsgSummaryDisDaily(accessToken, beginDate, endDate string) ([]*MsgDistInfo, error)

func GetMsgSummaryDisMonthly

func GetMsgSummaryDisMonthly(accessToken, beginDate, endDate string) ([]*MsgDistInfo, error)

func GetMsgSummaryDisWeekly

func GetMsgSummaryDisWeekly(accessToken, beginDate, endDate string) ([]*MsgDistInfo, error)

type MsgSummary

type MsgSummary struct {
	Date     string `json:"ref_date"`
	Hour     int    `json:"ref_hour"`
	MsgType  string `json:"msg_type"`
	MsgUser  int    `json:"msg_user"`
	MsgCount int    `json:"msg_count"`
}

func GetMsgSummaryDaily

func GetMsgSummaryDaily(accessToken, beginDate, endDate string) ([]*MsgSummary, error)

获取发送消息概况数据

func GetMsgSummaryHourly

func GetMsgSummaryHourly(accessToken, beginDate, endDate string) ([]*MsgSummary, error)

func GetMsgSummaryMonthly

func GetMsgSummaryMonthly(accessToken, beginDate, endDate string) ([]*MsgSummary, error)

func GetMsgSummaryWeekly

func GetMsgSummaryWeekly(accessToken, beginDate, endDate string) ([]*MsgSummary, error)

type NewTotalSummary

type NewTotalSummary struct {
	Date  string `json:"ref_date"`
	MsgID string `json:"msgid"`
	Title string `json:"title"`
}

type NewsRead

type NewsRead struct {
	Date             string `json:"ref_date"`
	Hour             int    `json:"ref_hour"`
	UserSource       int    `json:"user_source"` //在获取图文阅读分时数据时才有该字段,代表用户从哪里进入来阅读该图文。0:会话;1.好友;2.朋友圈;3.腾讯微博;4.历史消息页;5.其他;6.看一看;7.搜一搜
	PageReadUser     int    `json:"int_page_read_user"`
	PageReadCount    int    `json:"int_page_read_count"`
	OriPageReadUser  int    `json:"ori_page_read_user"`
	OriPageReadCount int    `json:"ori_page_read_count"`
	ShareUser        int    `json:"share_user"`
	ShareCount       int    `json:"share_count"`
	AddFavUser       int    `json:"add_to_fav_user"`
	AddFavCount      int    `json:"add_to_fav_count"`
}

func GetNewsReadDaily

func GetNewsReadDaily(accessToken, beginDate, endDate string) ([]*NewsRead, error)

func GetNewsReadHourly

func GetNewsReadHourly(accessToken, beginDate, endDate string) ([]*NewsRead, error)

type NewsShare

type NewsShare struct {
	Date       string `json:"ref_date"`
	Hour       int    `json:"ref_hour"`
	ShareSence string `json:"share_scene"`
	ShareCount string `json:"share_count"`
	ShareUser  string `json:"share_user"`
}

func GetNewsShareDaily

func GetNewsShareDaily(accessToken, beginDate, endDate string) ([]*NewsShare, error)

func GetNewsShareHourly

func GetNewsShareHourly(accessToken, beginDate, endDate string) ([]*NewsShare, error)

type NewsSummary

type NewsSummary struct {
	Date             string `json:"ref_date"`            //数据的日期,需在begin_date和end_date之间
	MsgID            string `json:"msgid"`               //这里的msgid实际上是由msgid(图文消息id,这也就是群发接口调用后返回的msg_data_id)和index(消息次序索引)组成
	Title            string `json:"title"`               //图文消息的标题
	PageReadUser     int    `json:"int_page_read_user"`  //图文页(点击群发图文卡片进入的页面)的阅读人数
	PageReadCount    int    `json:"int_page_read_count"` //图文页的阅读次数
	OriPageReadUser  int    `json:"ori_page_read_user"`  //原文页(点击图文页“阅读原文”进入的页面)的阅读人数,无原文页时此处数据为0
	OriPageReadCount int    `json:"ori_page_read_count"` //原文页的阅读次数
	ShareUser        int    `json:"share_user"`          //分享的人数
	ShareCount       int    `json:"share_count"`         //分享的次数
	AddFavUser       int    `json:"add_to_fav_user"`     //收藏的人数
	AddFavCount      int    `json:"add_to_fav_count"`    //收藏的次数
}

func GetNewsSummaryDaily

func GetNewsSummaryDaily(accessToken, beginDate, endDate string) ([]*NewsSummary, error)

type NewsSummaryTotal

type NewsSummaryTotal struct {
	StatDate                  string `json:"stat_date"`
	TargetUser                int    `json:"target_user"` //送达人数,一般约等于总粉丝数(需排除黑名单或其他异常情况下无法收到消息的粉丝)
	PageReadUser              int    `json:"int_page_read_user"`
	PageReadCount             int    `json:"int_page_read_count"`
	OriPageReadUser           int    `json:"ori_page_read_user"`
	OriPageReadCount          int    `json:"ori_page_read_count"`
	ShareUser                 int    `json:"share_user"`
	ShareCount                int    `json:"share_count"`
	AddFavUser                int    `json:"add_to_fav_user"`
	AddFavCount               int    `json:"add_to_fav_count"`
	PageFromSessionReadUser   int    `json:"int_page_from_session_read_user"`  //公众号会话阅读人数;
	PageFromSessionReadCount  int    `json:"int_page_from_session_read_count"` //公众号会话阅读次数;
	PageFromHistReadUser      int    `json:"int_page_from_hist_read_user"`     //历史消息页阅读人数;
	PageFromHistReadCount     int    `json:"int_page_from_hist_read_count"`    //历史消息页阅读次数;
	PageFromFeedReadUser      int    `json:"int_page_from_feed_read_user"`     //朋友圈阅读人数;
	PageFromFeedReadCount     int    `json:"int_page_from_feed_read_count"`    //朋友圈阅读次数;
	PageFromFriendsReadUser   int    `json:"int_page_from_friends_read_user"`  //好友转发阅读人数;
	PageFromFriendsReadCount  int    `json:"int_page_from_friends_read_count"` //好友转发阅读次数;
	PageFromOtherReadUser     int    `json:"int_page_from_session_read_user"`  //其他场景阅读人数;
	PageFromOtherReadCount    int    `json:"int_page_from_session_read_count"` //其他场景阅读次数 ;
	FeedShareFromSessionUser  int    `json:"feed_share_from_session_user"`     //看一看来源阅读人数;
	FeedShareFromSessionCount int    `json:"feed_share_from_session_cnt"`      //看一看来源阅读次数;
	FeedShareFromFeedUser     int    `json:"feed_share_from_feed_user"`        //搜一搜来源阅读人数;
	FeedShareFromFeedCount    int    `json:"feed_share_from_feed_cnt"`         //搜一搜来源阅读次数;
	FeedShareFromOtherUser    int    `json:"feed_share_from_other_user"`       //公众号会话转发朋友圈人数
	FeedShareFromOtherCount   int    `json:"feed_share_from_other_cnt"`        //公众号会话转发朋友圈次数
}

func GetNewsTotal

func GetNewsTotal(accessToken, beginDate, endDate string) ([]*NewsSummaryTotal, error)

type UserDailyCumulate

type UserDailyCumulate struct {
	Date         string `json:"ref_date"`
	CumulateUser int    `json:"cumulate_user"`
}

func GetUserCumulate

func GetUserCumulate(accessToken, beginDate, endDate string) ([]*UserDailyCumulate, error)

type UserDailySummary

type UserDailySummary struct {
	Date string `json:"ref_date"` //数据的日期
	// 0代表其他合计 1代表公众号搜索 17代表名片分享 30代表扫描二维码
	// 43代表图文页右上角菜单 51代表支付后关注(在支付完成页) 57代表图文页内公众号名称 75代表公众号文章广告 78代表朋友圈广告
	UserSource int `json:"user_source"` //用户的渠道,数值代表的含义
	NewUser    int `json:"new_user"`    //新增的用户数量
	CancleUser int `json:"cancel_user"` //取消关注的用户数量,new_user减去cancel_user即为净增用户数量
}

func GetUserSummary

func GetUserSummary(accessToken, beginDate, endDate string) ([]*UserDailySummary, error)

获取每日用户变动总结

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL