Bug 224884 - PCM: Trigger Event
Summary: PCM: Trigger Event
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit Website (show other bugs)
Version: Safari Technology Preview
Hardware: Mac (Intel) macOS 10.15
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-21 12:18 PDT by Maojie
Modified: 2021-04-28 12:26 PDT (History)
3 users (show)

See Also:


Attachments
storing a click (13.47 KB, image/png)
2021-04-21 12:18 PDT, Maojie
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Maojie 2021-04-21 12:18:50 PDT
Created attachment 426726 [details]
storing a click

Following the blog https://webkit.org/blog/11529/introducing-private-click-measurement-pcm/ to integrate with PCM.

I was able to see [Private Click Measurement] Storing a click in the console, however, nothing happended after that.

I have two websites, the first serves as social.example, the second as shop.example. When I click the link on social.example, it directs me to shop.example and console displays [Private Click Measurement] Storing a click. Then I click the button on shop.example and onClick is sending an HTTP get request to https://social.example/.well-known/private-click-measurement/trigger-attribution/1 or https://social.example/.well-known/private-click-measurement/1(I tested both). No further activity were noticed on console after that.

Below is my steps of testing:
1. click link on pcmprep.com which directs me to https://damaipin.blogspot.com/2021/04/pcm-advertiser.html
2. click button on https://damaipin.blogspot.com/2021/04/pcm-advertiser.html which sends HTTP GET requests to https://www.pcmprep.com/.well-known/private-click-measurement/trigger-attribution/1/

Code snippet for HTTP Get request:

function trigger(){
  const url='https://www.pcmprep.com/.well-known/private-click-measurement/trigger-attribution/1/';
  fetch(url, {mode: 'cors'}).then(res => {
    return res.json();
  }).then(users => {
  	console.log(users);
  }).catch(function(error) {
    console.log('Request failed', error)
  });
}

Thanks
Comment 1 John Wilander 2021-04-21 12:38:04 PDT
Hi! Thanks for filing. The triggering event needs to be a network request to pcmprep.com that redirects to pcmprep.com/.well-known/private-click-measurement/trigger-attribution/. You should not do a direct request to that location. This enables existing pixels firing for pcmprep.com to work and gives the server pcmprep.com a chance to decide whether this is a real conversion or not before telling the browser to register it.
Comment 2 John Wilander 2021-04-21 13:10:13 PDT
(In reply to John Wilander from comment #1)
> Hi! Thanks for filing. The triggering event needs to be a network request to
> pcmprep.com that redirects to
> pcmprep.com/.well-known/private-click-measurement/trigger-attribution/. You
> should not do a direct request to that location. This enables existing
> pixels firing for pcmprep.com to work and gives the server pcmprep.com a
> chance to decide whether this is a real conversion or not before telling the
> browser to register it.

To clarify: "This *redirect* enables existing pixels …"
Comment 3 Radar WebKit Bug Importer 2021-04-28 12:19:17 PDT
<rdar://problem/77278370>
Comment 4 John Wilander 2021-04-28 12:26:04 PDT
No comments from the reporter in a week. Closing as invalid.