To follow GDPR and cookie consent rules, you must stop the SDK from starting when the page loads. Using setCommunicationEnabled(false) does not work for this because the init method creates a Hardware ID (HWID) and sends a setup request to the servers as soon as it runs.
Remove the Pushwoosh.push(['init', {...}]); line from your main script. Put the initialization code inside a function that runs only when a user gives consent or clicks a button to subscribe.
// Run this function after the user clicks 'Accept' or 'Subscribe'
function startPushwoosh() {
var Pushwoosh = window.Pushwoosh || [];
Pushwoosh.push(['init', {
logLevel: 'info',
applicationCode: 'YOUR_APP_CODE',
defaultNotificationTitle: 'Your Title'
}]);
}
// Trigger the function using your consent manager event
// window.addEventListener('consent-received', startPushwoosh);
Comments
0 comments
Please sign in to leave a comment.