If you need to delete multiple cookies at once, you can use JavaScript to loop through an array of cookie names and delete them one by one. Here's an example function that you can use to delete multiple cookies:
function deleteCookies(cookieNames) {
for (var i = 0; i < cookieNames.length; i++) {
document.cookie = cookieNames[i] + '=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/;';
}
}
This function takes an array of cookie names as a parameter, and then loops through the array, deleting each cookie using the document.cookie property.
To use this function, you can pass in an array of the cookie names that you want to delete, like this:
var cookiesToDelete = ['s_cc', 's_sq', 's_ppn'];
deleteCookies(cookiesToDelete);
You can call this function whenever the user changes their consent preferences and opts out of non-essential cookies. You can also modify this function to check the user's current consent settings before deleting any cookies, to ensure that you only delete cookies when necessary.
Note that if you're using Launch, you can also use the "Clear Cookie" action in the Adobe Analytics extension to delete cookies, instead of writing your own JavaScript function. However, this action only allows you to delete one cookie at a time, so it may not be the best solution for deleting multiple cookies.