WICG / turtledove

TURTLEDOVE
https://wicg.github.io/turtledove/
Other
513 stars 216 forks source link

Success Token Status with TrialNotAllowed #383

Open Elena6918 opened 1 year ago

Elena6918 commented 1 year ago

Hello, I'm using a domain ending with co.uk and follow every step in the documentation. I passed the check of document.featurePolicy.allowsFeature('join-ad-interest-group') and the token status is "success" in the application tab. However, I got an "undefined" error with console.log(await navigator.joinAdInterestGroup(interestGroup, kSecsPerDay)); In the application tab, it says TrialNotAllowed. Why is this happening and how can I solve it?

JensenPaul commented 1 year ago

Are you first using feature detection (e.g. if ("joinAdInterestGroup" in navigator)) to determine if the user is part of the origin trial? This page is helpful for troubleshooting origin trial issues.

Elena6918 commented 1 year ago

Yes, I used the feature detection outlined in the guide

'joinAdInterestGroup' in navigator && 
document.featurePolicy.allowsFeature('join-ad-interest-group') &&
document.featurePolicy.allowsFeature('run-ad-auction') ?
console.log('navigator.joinAdInterestGroup() is supported on this page') :
console.log('navigator.joinAdInterestGroup() is not supported on this page');

and I got "navigator.joinAdInterestGroup() is supported on this page" in the console. On the troubleshooting page, I believe it says TrialNotAllowed should return false in 'joinAdInterestGroup' in navigator but that's not the case for me.

The join-ad-interest-group is also present in the permission policy allowed feature in the browser.

JensenPaul commented 1 year ago

Do you know which piece of that statement is triggering the "undefined" error? If you are trying to test FLEDGE locally I would flip chrome://flags/#privacy-sandbox-ads-apis and not worry about origin trial tokens.

Elena6918 commented 1 year ago

Yes, it’s the “console.log(await navigator.joinAdInterestGroup(interestGroup , kSecsPerDay));” statement that triggers this undefined error. I’m testing on my public domain.

On Wed, Oct 19, 2022 at 3:59 PM Paul Jensen @.***> wrote:

Do you know which piece of that statement is triggering the "undefined" error? If you are trying to test FLEDGE locally I would flip chrome://flags/#privacy-sandbox-ads-apis and not worry about origin trial tokens.

— Reply to this email directly, view it on GitHub https://github.com/WICG/turtledove/issues/383#issuecomment-1284507085, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIQC76LOLHD4XRU2CFR7N4TWEBHKBANCNFSM6AAAAAARIUD7RQ . You are receiving this because you authored the thread.Message ID: @.***>

JensenPaul commented 1 year ago

Do you know which piece of that statement is triggering the "undefined" error? e.g. is it "interestGroup", "kSecsPerDay", "navigator.joinAdInterestGroup(interestGroup, kSecsPerDay)" etc Can you try using chrome://flags/#privacy-sandbox-ads-apis instead of the origin trial token?

Elena6918 commented 1 year ago

I believe it's the "navigator.joinAdInterestGroup(interestGroup, kSecsPerDay)". I've already enabled the API using chrome://flags/#privacy-sandbox-ads-apis from the beginning as well.

Another weird thing is that when I test it with my domain on the glitch.me, the application tab also says "TrialNotAllowed" with Valid Token but everything functions properly.