Mandrill API中点击和打开的单个元数据?

时间:2015-10-26 11:25:06

标签: mandrill

我还是不明白 Mandrill RESTful API 的一部分。在the info function中,应该返回有关发送消息的信息,我们可以接收附加到消息的元数据。但元数据可以与单个点击相关联吗?

E.g。如果我创建一个名为“PersonalID”的新元数据字段,我是否可以为每次单击获得 PersonalId 的值,这样我就能理解我自己的应用程序中的哪些人确切地点击了链接,而不仅仅是他们的IP地址?

说这是我在调用info方法时得到的回复。

{
    "ts": 1365190000,
    "_id": "abc123abc123abc123abc123",
    "sender": "sender@example.com",
    "template": "example-template",
    "subject": "example subject",
    "email": "recipient.email@example.com",
    "tags": [
        "password-reset"
    ],
    "opens": 42,
    "opens_detail": [
        {
            "ts": 1365190001,
            "ip": "55.55.55.55",
            "location": "Georgia, US",
            "ua": "Linux/Ubuntu/Chrome/Chrome 28.0.1500.53"
        }
    ],
    "clicks": 42,
    "clicks_detail": [
        {
            "ts": 1365190001,
            "url": "http://www.example.com",
            "ip": "55.55.55.55",
            "location": "Georgia, US",
            "ua": "Linux/Ubuntu/Chrome/Chrome 28.0.1500.53"
        }
    ],
    "state": "sent",
    "metadata": {
        "user_id": "123",
        "website": "www.example.com"
    },
    "smtp_events": [
        {
            "ts": 1365190001,
            "type": "sent",
            "diag": "250 OK"
        }
    ]
}

对我来说,模糊的部分是,在上面的回复中,我们有一系列的打开和点击,但最后,只有两个与之关联的元数据值(user_idwebsite)整个回应。那么我们如何知道这个user_id连接到哪个点击记录?

1 个答案:

答案 0 :(得分:1)

据我所知,user_id与点击或打开无关。它是消息本身的一个属性。使用自定义元数据,您可以为每个收件人发送的每封邮件定义唯一的用户ID。请查看此链接https://mandrill.zendesk.com/hc/en-us/articles/205582417-Using-Custom-Message-Metadata以获取更多信息。

所以即使用户没有点击或打开电子邮件,您也可以从info api调用中返回user_id。

HTH,