跟踪电子邮件是否已被打开
我在这个应用程序中使用 Rails 2 和 ActionMailer,但这是有关电子邮件的一般问题。
当我们发送电子邮件时,我将与该电子邮件对应的记录保存在数据库表中。我想跟踪人们是否阅读了电子邮件,并且想知道最好的方法。在最初的谷歌搜索中,我似乎陷入了垃圾邮件发送者和电子邮件客户端之间持续不断的战斗!
我的第一个想法是使用“已读收据”标头,但我知道很多客户不支持这一点,因此不可靠。之后,我读到了在邮件中包含图像并检测正在加载的图像的策略。我想我可以在图像 URL 中添加一个带有电子邮件记录 id 的参数,这样当我收到对该图像的请求时,我可以查看它是否有(例如)email_id 参数,如果有,则标记相应的电子邮件就像已经读过一样。
但是,后来我想起许多客户都明智地采用了这种策略,并专门询问邮件的查看者是否想要显示图像。显然他们可能会说不。
我是否认为我无法在邮件中提取其他资源(例如样式表)?因为如果我可以将它们拉进来,我就可以做同样的技巧,但是使用样式表而不是图像。
感谢您的任何建议,最大
I'm using rails 2 for this app, with ActionMailer, but this is a general question about emails.
When we send out emails, i save a record corresponding to the email in a database table. I'd like to keep track of whether people have read the emails, and am wondering the best way to do it. On initial googling, it seems like i've stumbled into an ongoing battle between spammers and email clients!
My first thought was to use the "read receipt" header, but i know that this isn't supported by a lot of clients and is therefore unreliable. After that, i read of the tactic of including an image in the mail, and of detecting that image being loaded. I was thinking that i could put a parameter with the email record's id in the image url, so that when i get a request for that image i can see if it has a (for example) email_id param and if so, mark the corresponding email as having been read.
But, then i remembered that many clients are wise to this tactic and specifically ask the viewer of the mail if they want to display images. Obviously they might say no.
Am i right in thinking that i can't pull in other resources, such as stylesheets, in my mail? Because if i can pull them in, i could do that same trick but with the stylesheet rather than an image.
Grateful for any advice, max
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
外部托管的样式表通常以与图像相同的方式处理。如果 HTML 格式的电子邮件适用的话,客户端不会在不提示用户的情况下下载它们。
需要考虑的一件事 - 您想要确定电子邮件是否已阅读,而不一定是刚刚收到,对吧?设置电子邮件的格式,使其在不查看图像的情况下无法轻松阅读,并在顶部添加“在浏览器中查看”链接。跟踪图像和页面格式的视图,我认为您将有一个相当可靠的方法来测量实际阅读量。
Externally-hosted stylesheets are generally treated the same way as images. The client will not download them without prompting the user, if that works at all with HTML-formatted emails.
One thing to consider- you're looking to determine whether the email was read, not necessarily just received, right? Format your email so that it can't be easily read without viewing the images, and include a "view in browser" link at the top. Track image and page-format views and I think you'll have a fairly reliable way to measure actual reads.
虽然有点晚了,但我们也遇到了类似的问题。
我们正在跟踪电子邮件中包含的指向我们网站的链接。我们和您一样,通过为每封发送的电子邮件创建一个数据库记录来实现这一点。我们为每封电子邮件生成了一个唯一的哈希密钥,并将其作为参数包含在电子邮件中的所有链接中。
然后,我们只需使用一个 before_filter 来查找参数,并使用唯一的哈希来识别正确的电子邮件记录,并根据正确的电子邮件记录记录这一事实。
我们使用唯一的哈希键(而不是数据库的主键),这样它更安全/可靠。
显然,这种方法只能帮助我们跟踪我们的电子邮件产生的点击量(而不是它们是否已被阅读),但它仍然很有用,因为我们可以看到我们的哪些用户点击了哪些链接。
Bit late on this, but we've got a similar problem.
We're tracking the links to our site that are included within the email. We're doing this by, like you, having a DB record per email sent out. We've generated a unique hash key per email and are including that as a parameter on all the links included in the email.
We simply then have a before_filter that looks for the parameter and records the fact against the correct email record by using the unique hash to identify the correct one.
We use a unique hash key (rather than the DB's primary key) just so it is a little bit more secure / reliable.
Obviously this method only helps us track the clicks our emails have generated (and not if they've been read) but it is still useful as we can see which of ours users has clicked on which links.
我们在这方面也遇到了重大问题。
我们有任务周门户,用户可以在其中创建任务(例如粉刷我的房子),然后我们邀请油漆工为任务创建者提供粉刷他的房子的价格。
为此,我们有一个非常先进的电子邮件系统,该系统会发送邀请,如果他们接受邀请,我们会向他们发送任务创建者的联系信息。
我们需要能够跟踪电子邮件是否被打开,然后一旦打开,我们就知道该公司获得了联系信息,现在我们可以向任务创建者发送另一封电子邮件,告诉他们可以联系他们由那家公司。
问题是跟踪电子邮件是否被打开根本不可靠。有不同的系统可以实现此目的,例如 msgtag(不支持广泛的邮件客户端,如 yahoo 和其他主要客户端),我们的电子邮件 API 客户端(弹性电子邮件)甚至提供一些 API 回调函数来告诉我们每封电子邮件是否被打开或反弹或其他什么。但话又说回来,它并不可靠。为了跟踪它是否打开,弹性电子邮件仅包含一个 1x1 像素图像并跟踪它是否打开。因此,如果人们不点击“在这封电子邮件中显示图像”,则不会将其跟踪为打开状态。
所以基本上我们有两个选择。
将内容的重要部分打印在图像上,他们必须查看这些信息才能获取我们想要跟踪的信息(在本例中为联系信息)
只需在电子邮件中添加一个链接“单击此处获取联系信息”,然后跟踪是否单击了该链接。
因此总而言之,“跟踪如果打开”是完全无用且不可靠的,除非您可以完全控制收件人正在使用哪些电子邮件客户端以及他们如何使用它们(例如他们是否都是您的员工或其他人)。
We are having major problems with this as well.
We have task wek portal, where users create tasks (like paint my house) and then we invite painters to give the task creator an price on painting his house.
For that we had a very advanced email system, that sends an invitation and if they accept the invitation we send them the contact info of the task creator.
We need to be able to track if the email was opened, and then once it's opened, we know that the company got the contact info, and we can now send another email to the task creator, telling them that they can expect to be contacted by that company.
The problem is that tracking if the email was opened is not reliable at all. There are different systems for this like msgtag (which does not support a wide range of mail clients like yahoo and other major clients) and our email API client (elastic email) even offer some API call back functions to tell us if each email was opened or bounced or whatever. But again, it's not reliable. To track if it's open, elastic email just includes a 1x1 px image and track if it's opened. So if people don't click "show images in this email" it's not tracked as opened.
So basically we are down to two options.
Have vital portions of the content printed on images, that they have to view to get the info we want to track if they got (in this case contact info)
Just have a link in the email "click here to get the contact info" and then track if that is clicked.
So in conclusion, the "track if opened" is totally useless and unreliable, unless you can fully control which email clients your recipients are using and how they are using them (like if they are all your employees or something).