简体   繁体   English

如何从 SendGrid 获取每个 email 的所有分析?

[英]How to get all analytics from SendGrid for each email?

I would like to get all analytical data from SendGrid for each email using "unique args".我想使用“唯一参数”从 SendGrid 获取每个 email 的所有分析数据。

Currently to be able to do this, i would need to:目前能够做到这一点,我需要:

  1. call SendGrid API to get all emails with "unique arguments"调用 SendGrid API 以获取所有带有“唯一参数”的电子邮件
  2. from response get email ID从响应中获取 email ID
  3. call SendGrid again based on email ID to get all "events" (clicks, opens, subscribes, unsubscribes, bounces, blocks,.. etc.)根据 email ID 再次调用 SendGrid 以获取所有“事件”(点击、打开、订阅、取消订阅、退回、阻止等)

With this approach i would make twice as much requests as needed to.使用这种方法,我会根据需要提出两倍的请求。

Does anyone know a way to skip step 2 and 3, and get all "events" data from just one call?有谁知道跳过第 2 步和第 3 步并仅通过一次调用获取所有“事件”数据的方法?

You can use Event Webhooks from SendGrid .您可以使用 SendGrid 中的 Event SendGrid Events are generated when the email is processed by SendGrid and email service providers.当 email 被 SendGrid 和 email 服务提供者处理时产生事件。 There are 2 types of events - delivery and engagement events.有两种类型的事件 - 交付和参与事件。

Delivery events indicate the status of email delivery to the recipient.传递事件指示 email 传递给收件人的状态。 Engagement events indicate how the recipient is interacting with the email.参与事件指示收件人如何与 email 进行交互。

 {
    "email": "example@test.com",
    "timestamp": 1513299569,
    "smtp-id": "<14c5d75ce93.dfd.64b469@ismtpd-555>",
    "event": "processed",
    "category": "cat facts",
    "sg_event_id": "sg_event_id",
    "sg_message_id": "sg_message_id"
  },
  {
    "email": "example@test.com",
    "timestamp": 1513299569,
    "smtp-id": "<14c5d75ce93.dfd.64b469@ismtpd-555>",
    "event": "deferred",
    "ip": "168.1.1.1",
    "category": "cat facts",
    "sg_event_id": "sg_event_id",
    "sg_message_id": "sg_message_id",
    "response": "400 try again later",
    "attempt": "5"
  },
  {
    "email": "example@test.com",
    "timestamp": 1513299569,
    "smtp-id": "<14c5d75ce93.dfd.64b469@ismtpd-555>",
    "event": "delivered",
    "ip": "168.1.1.1",
    "category": "cat facts",
    "sg_event_id": "sg_event_id",
    "sg_message_id": "sg_message_id",
    "response": "250 OK"
  },
  {
    "email": "example@test.com",
    "timestamp": 1513299569,
    "smtp-id": "<14c5d75ce93.dfd.64b469@ismtpd-555>",
    "event": "open",
    "category": "cat facts",
    "sg_event_id": "sg_event_id",
    "sg_message_id": "sg_message_id",
    "useragent": "Mozilla/4.0 (compatible; MSIE 6.1; Windows XP; .NET CLR 1.1.4322; .NET CLR 2.0.50727)",
    "ip": "255.255.255.255"
  },

Delivery events include processed, dropped, delivered, deferred, and bounce.交付事件包括已处理、丢弃、已交付、延迟和退回。

Engagement events include open, click, spam report, unsubscribe, group unsubscribe, and group resubscribe.参与事件包括打开、点击、垃圾邮件报告、取消订阅、群组取消订阅和群组重新订阅。

I recommend you to check the link for more details.我建议您 查看链接以获取更多详细信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 通过 api 从 sendgrid 获取所有联系人 - Get all contacts from sendgrid via api 如何从 google Analytics Api 获取记录的每个事件的数据? - how to get from google Analytics Api data for each event recorded? 如何使用“Unique Args”从 SendGrid 获取所有分析数据还是有其他方法? - How to get all analytical data from SendGrid using "Unique Args" or is there another way? 创建了 sendgrid email 模板,如何从 Java 调用它 - Created sendgrid email template, how to call it from Java 如何从 Nodejs 发送带有 html 内容的 SENDGRID email? - How to send SENDGRID email with html contents from Nodejs? 如何在查询 sendgrid email 活动时对 msg_id 或 from_email 或 to_email 使用 LIKE 运算符? - How to use LIKE operator for msg_id or from_email or to_email in query for sendgrid email activity? SendGrid 动态模板 - 在 handlebars 中获取收件人 email - SendGrid Dynamic Templates - get recipient email in handlebars PHPMailer 使用 Sendgrid,自定义每个 email 但只发送一个 email - PHPMailer using Sendgrid, customizing each email but sending just one email SendGrid - 如何在通过 SendGrid 发送邮件时验证 email 送达 - SendGrid - How to validate email delivery when mail is send via SendGrid 如何使用 Sendgrid API 添加 Email 的内联图像 - How to Add Inline Image for Email with Sendgrid API
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM