-
Notifications
You must be signed in to change notification settings - Fork 439
Description
Hi awesome peeps,
I am trying to implement topics api but because of the unclear documents and some fancy words, the implementation for a developer became really hard and confusing I guess!
basically i want to test the topics api, i followed these steps please correct my implementation if i am doing something wrong
- I have deployed a observer application(https://topics-api-oofp.vercel.app) having a script and a normal html page that basically "access" document.browsingTopics() and returns the topics array. this page keeps checking the topics returned by every one second. Now for devs i found out i need to enable some flags to access this api, hence i ran this command to open a fresh chrome session after killing all the chrome sessions.
here is the command
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome \
--user-data-dir="/tmp/chrome-test-new" \
--enable-features=BrowsingTopics,BrowsingTopicsParameters:time_period_per_epoch/15s/max_epoch_introduction_delay/3s,PrivacySandboxAdsAPIsOverride,PrivacySandboxSettings3,OverridePrivacySandboxSettingsLocalTesting
Now, the first thing i got is a attestation error, the page was not even able to access the topics api even after deploying to vercel and in https format, still i figured out from the chrome://flags/ if inside the Privacy Sandbox Enrollment Overrides i write the url of the site, the attestation error is now gone. Remember the topics array is still empty.
-
I deployed two more websites named https://i-love-pets-cats.vercel.app and https://dogs-dogs-dogs-dogs.vercel.app these apps have a html page inside the page there is script that calls the main topics-api-oofp page
like this <script src="https://topics-api-oofp.vercel.app/" defer></script> -
When i visit these sites, nothing happens as still inside the main topics-api-oofp application, still there are no topics returned, then i noticed, when i visit these cats and dogs websites , obviously from a different chrome session started from same flags enabled, these website are not coming into my Topics State epoch, that is when i visit other sites they are coming inside the topics state epoch , but not these two , I even tried adding these sites to the Privacy Sandbox Enrollment Overrides but still nothing happened.
I am overall very very confused with the exact implementation for the topics api, if someone can help me please help me.
My all github repos are public you guys can access all codebase of 3 projects
main app- (https://github.com/viralkansarav/topics-api)
dogs- (https://github.com/viralkansarav/topics-api-dog)
cats - (https://github.com/viralkansarav/topics-api-cat)
Thanks.