Updates to Select URL with Shared Storage API in M132: Saved Queries

165 views
Skip to first unread message

Tara Agyemang

unread,
Nov 19, 2024, 11:05:06 AM11/19/24
to Shared Storage API announcements

Hey all,


We're introducing updates to Select URL with the Shared Storage API in M132 with the support of saved queries. 


What’s changing

selectURL() currently has two per-page-load budgets that restrict the number of calls made to the API on each page-load. We’re introducing the ability to save and reuse queries on a per-page basis. When you use a saved query, the per-page-load budgets are charged the first time a saved query is run, but not for subsequent runs of the saved query during the same page-load.


How to implement saved queries

Starting with the M132 release, you can use the savedQuery property in the options for selectURL() with the name of the query:


await sharedStorage.selectURL("experiment", urls, {

savedQuery: "control_or_experiment",

keepAlive: true

});

 

Use the same savedQuery name for every call to selectURL()to ensure follow-up queries are charged to the same budget.


We’ve updated the URL selection documentation to reflect these changes and provide additional details on budgeting for selectURL().


If you have any questions or comments, reply to this post or open an issue in the Privacy Sandbox Dev Support repository on GitHub.
Reply all
Reply to author
Forward
0 new messages