WICG / turtledove

TURTLEDOVE
https://wicg.github.io/turtledove/
Other
522 stars 225 forks source link

Cannot get a value from navigator.runAdAuction, looking forward help! #1011

Open Yimilh opened 7 months ago

Yimilh commented 7 months ago

Based on the current experiment with 10% of the display traffic, 62% can use JoinInterestGroup and runAdAuction, but the data retrieved so far is empty. Therefore, we should investigate the data retrieval method to see if there is an error in the way the data is being collected.In the fallowing:

function getAuctionResult() {
    const auctionResultPromise = navigator.runAdAuction(auctionConfig);
}
const actionPromise = getAuctionResult();
var actionApiRes = null;
if (actionPromise) {
    actionApiRes = await actionPromise;
}

Looking forward the answer.

wojciech-bialy-wpm commented 7 months ago

Have You tried debugging it by looking into Console-> Application -> Interest groups ?

You should see IGs being loaded, bidding and then winning (or not). See example here:

Zrzut ekranu 2024-02-4 o 20 12 29

First of all, if no IGs from the eligible buyers are loaded, than auction would not start. If there are IG's, I'd look into seller.js -> scoreAd logic (perhaps incoming bids are not scored correctly?).

The code You've attached looks more-or-less correct, but the issue for example might be in auctionConfig object.

Yimilh commented 7 months ago

@wojciech-bialy-wpm Hi thank you for reply. I have tried debugging it but unfortunately I cannot see the data. Maybe I debugged it in a wrong way. Could you give me some examples of how to debug operations. This following is the auctionConfig:

function getAuctionResult() {
      if (navigator.runAdAuction) {
        const auctionConfig = {
            seller: 'https://cdn.mediago.io',
            decisionLogicUrl: 'https://cdn.mediago.io',
            interestGroupBuyers: ['https://cdn.mediago.io']
        };
        const auctionResultPromise = navigator.runAdAuction(auctionConfig);
        return auctionResultPromise;
    } else {
        return false;
    }
}

As you can see, it's nothing special.So I cannot figure out why it didn't work.Looking for help sincerely!

dmdabbs commented 7 months ago

When I call your method I see this console error:

start.html:1 Attestation check for Protected Audience on https://cdn.mediago.io failed.

If you haven't enrolled with Google for PA then you need to use this chrome flag to force your browser to treat your origin as attested for PA or other APIs.

chrome://flags/#privacy-sandbox-enrollment-overrides

Yimilh commented 7 months ago

@dmdabbs Hi, thank you for reply.This method is running in the iframe working at the ad display in the media web.If you call it directly, here will be error. Besides, I have applied the PA. When I try in my test web,it's working. You can see the log below.But based on the current experiment with 10% of the display traffic, 62% can use JoinInterestGroup and runAdAuction, but the data retrieved so far is empty. image

wojciech-bialy-wpm commented 7 months ago

Hi @Yimilh,

As @dmdabbs said, one thing is attestation of the IG buyer (https://cdn.mediago.io/) - this could be tested by adding the domain to privacy-sandbox-enrollment-overrides.

Another is decisionLogicUrl, which in Your case is also https://cdn.mediago.io. This should point to the javascript that implements scoreAd and reportResult methods. I'm getting "acces denied" error here (granted, I'm not on Your intranet ;))

And thirdly, as you do have IGs from Google and Criteo, have You tried adding fledge.us.criteo.com to auctionConfig.interestGroupBuyers? Then at least You should see whether the auction starts (there should be Accesstype: bid for that buyer).

Yimilh commented 7 months ago

hi @wojciech-bialy-wpm , thank you for reply. I didn't add fledge.us.criteo.com to auctionConfig.interestGroupBuyers as you can see up there.It seems that there is nothing wrong running in my code. So it's hard to figure out why I can't get the IGs data return in the current experiment with 10% of the display traffic. I am looking forward to some useful experience desperately. Please do help!

wojciech-bialy-wpm commented 7 months ago

Hi @Yimilh,

It's hard to discern what causes Your auction to not start (and if it starts - what causes it to not return any results). The first thing that comes to mind, is that the PAA auction will not start if there are no eligible Interest Groups for the buyers specified in auctionConfig.interestGroupBuyers

In the config You've quted, the only buyer allowed to bid in the auction is https://cdn.mediago.io interestGroupBuyers: ['https://cdn.mediago.io']

And yet, in Console-> Application -> Interest groups tab, You do not have any interest groups from this buyer (You only have IGs from https://td.doubleclick.net and https://fledge.us.criteo.com). In such case, I'd expect that the PAA auction would not start at all (since the user - You, in this case - has no interest groups that can participate in the auction).

Do You have a test environment that:

In this case, we would at least know that the auction should start, and could move to debugging auction worklets.

Happy to help :)

Yimilh commented 7 months ago

Hi @wojciech-bialy-wpm truly thank you for your reply. (๑′ᴗ‵๑) I get very useful information from you.

the PAA auction will not start if there are no eligible Interest Groups for the buyers specified in auctionConfig.interestGroupBuyers

Which means I should test it: Are there eligible Interest Groups for the buyers specified in auctionConfig.interestGroupBuyers interestGroupBuyers: ['https://cdn.mediago.io']?

I do have a test environment that on one page adds a dummy/test interest group for https://cdn.mediago.io/. BUT I didn't have a different page attempts to execute PAA auction, using the auctionConfig that I've shown, so I will set it and test it.

This job I will start after the Chinese Luna New Year. I do hope this new test can work.Then I will tell the test result.

Thank you for your continuous and sincere assistance~ Thanks♪(・ω・)ノ

wojciech-bialy-wpm commented 7 months ago

HI @Yimilh,

I've went through similar problems setting PAA tests for my company, so I'm glad to be of help :)

Happy Lunar New Year!

Yimilh commented 7 months ago

@wojciech-bialy-wpm hi thank you~ As you mentioned before, how can I test eligible Interest Groups? I think when the buyer begin to bid in the auction, then it can set Interest Groups, right? Is here something relative to decisionLogicUrl? Maybe I should update it?

wojciech-bialy-wpm commented 6 months ago

Hi @Yimilh,

The buyer should set Interest Groups prior to auction. Consider a simplest example of a retargeting campaign:

  1. The user visits https://some-shop.com and browsers for products
  2. As the result of user interaction, some-shop.com creates an Interest Group that contains ads for this user (based, for example, on product categories that the user looked at)
  3. This interest group - containing ads, adComponents (for ads composed of multiple pieces), and bidding logic (that will be responsible for generating bids for PA auction) is now stored in user's browser.
  4. Some time later, user visits https://other-site.com
  5. other-site.com, as seller/publisher, initiates PA auction - indicating which buyers can participate in it, and providing decisionLogic that will be responsible for scoring incoming bids (this is where decisionLogicUrl comes into play)
  6. Let's say that theres only one buyer for this auction - https://some-shop.com
  7. In that case, PA auction will retrieve Interest Group generated in step 2, this interest group will (using bidding logic provided) generate one bid, send it to decision logic of the auction and - assuming that the bid was scored above 0 - will return wining ad as fenced frame config / opaque frame urn.
  8. The publisher, seeing that the result of a PA auction is not empty, will build an iframe that will display the winning ad from the Interest Group

It might help to understand, what is Your company's role in this ecosystem:

If You are a publisher, and need to test Initiating PA auction, I could prepare a simple dummy Interest Group ;)

Yimilh commented 6 months ago

@wojciech-bialy-wpm hi thank you~ I’m sorry for replying so late. My company's role in this ecosystem is a buyer(DSP). As a beginner in fledge. I finally figure out why I cannot get IGs data before, because I set JOIN IN IG at a wrong place. I should init it in the Landing page instead of in the AD display which is running at the publish web. By the way, it's my pleasure to read your example. I believe it will be a great help to me. Looking forward to your reply. :)