privacycg / private-click-measurement

Private Click Measurement
https://privacycg.github.io/private-click-measurement/
196 stars 8 forks source link

Tracking clicks in emails #63

Open kdeqc opened 3 years ago

kdeqc commented 3 years ago

Clicks in emails are often tracked using a redirect click tracker because email clients have diverse capabilities (being web apps, mobile apps, stand-alone clients, etc). Not only are the clients diverse, but email also supports both html and plain-text messages.

If PCM tries to replace the redirect click tracking in this scenario, it's only going to capture a portion of the clicks, as is. So. there likely needs to be something where the click can optionally be registered from the landing page as well - which probably means that information about the email will need to be able to be passed to the landing page in the URL too. Another consideration is that when the conversion happens, the report of it shouldn't really go back to the email client, but probably the company that sent the email. In this scenario, the email client is similar to the ad server in a standard online ad delivery. The "source_site" would also make more sense as the source of the emails than the email client.

johnwilander commented 3 years ago

Thanks for filing, Kristen! I think this is a very interesting use case, closely related to regular web-to-web click measurement.

This may be a case where we can only safely send the attribution report to the click destination website since it'll be very hard to guarantee that any report URL extracted from the source email could not be set up per-user or per user bucket. In the case of direct email marketing, this makes sense. It would also work for affiliate marketing but the sender of the email, perhaps a news letter or a review service, would not get the report and would have to rely on the advertiser for data.

johnwilander commented 3 years ago

I've been thinking about this some more.

First, we need to acknowledge that there are plaintext emails and HTML emails. Plaintext emails can have raw links in them that the email client detects and makes clickable but such links don't have an anchor tag and thus no direct integration point with PCM. HTML email would more directly be able to plug in to PCM.

Second, we have both web email clients and native emails clients like Outlook, Apple Mail, and apps from for example FastMail, Hey, and Google. On the web, integration should be fairly easy, bar support for iframes (https://github.com/privacycg/private-click-measurement/issues/7) but native clients would have to pass on the click metadata along side the call to open the URL.

Third, I see at least four potential ways to deliver the PCM metadata in email:

  1. The regular PCM format with link attributes. Only works for HTML email as mentioned above.
  2. A custom email header. This needs to have a way to tie certain metadata to specific links in the case of multiple links in the email. It also requires mail client adoption.
  3. Some kind of embedding in the link itself. This would get it dangerously close to link decoration tracking and break down for web browsers that don't process the data and just forward it to the server. I think this is a no-go.
  4. Some kind of special link that would never go to a server until after it's been processed. Such links would only work in web browsers that support the feature which risks breaking links in emails – a clear no-go.

Finally, we probably want to make sure that link clicks from email can't be spoofed by other apps and websites opening links. I.e. the way in which this would be supported should be restricted to email.

kdeqc commented 3 years ago

Hi John! With the Mail news this week, I wanted to reach back out on this. It'd be very useful to get PCM into Mail, and I'm just wondering if it would help if I brought the request up with the Mail folks at Apple, or would that just be adding noise? Just let me know how I can best help. Thx!