问题描述
根据 Mailchimp 文档,可以获取打开活动电子邮件的成员的时间戳和电子邮件地址。
https://mailchimp.com/developer/marketing/api/open-reports/list-campaign-open-details/
members:一组对象,每个对象代表一个打开活动电子邮件的列表成员。每个成员对象将包含有关单个成员的总打开次数以及每个打开事件的时间戳的信息。
{
"campaign_id": "string","list_id": "string","list_is_active": true,"contact_status": "string","email_id": "string","email_address": "string","merge_fields": {
"property1": null,"property2": null
},"vip": true,"opens_count": 0,"opens": [
{
"timestamp": "2019-08-24T14:15:22Z"
}
],"_links": [
{
"rel": "string","href": "string","method": "GET","targetSchema": "string","schema": "string"
}
]
}
但是,似乎不存在等效的调用点击。检索点击信息的 API 端点不一致,没有此信息。 (见下文)。
等等...我如何获得点击的成员的时间戳和电子邮件地址?
https://mailchimp.com/developer/marketing/api/link-clickers/list-clicked-link-subscribers/
成员: 一组对象,每个对象代表在活动中单击特定链接的成员。
{
"email_id": "string","clicks": 0,"campaign_id": "string","url_id": "string","schema": "string"
}
]
}
解决方法
第二个 API 调用没有时间戳字段,因此您将无法获取该数据
var query =
from r in context.Reports
from i in r.Incidents
where r.StartTime >= startTime && r.EndTime <= endTime
group i by new { r.Location } into g
select new
{
g.Key.Location,IncidentsCount = g.Count()
};
很遗憾,您只能获取某人打开电子邮件的时间戳,而不能获取单击电子邮件中的链接的时间戳