You can build this logic by using custom HTML, JavaScript, and user tags within your Customer Journey.
1. Add the checkbox to your HTML
Include a standard checkbox element in your Rich Media template code. Give it a clear ID so your script can find it.
2. Set a tag with JavaScript
Add an event listener to the button that closes your message. When a user clicks it, the script checks if they selected the checkbox. If they did, it sends a tag to the Pushwoosh SDK. The SDK provides the pushwoosh object automatically, so you do not need to import anything else.
document.getElementById('close-button').addEventListener('click', function() {
if (document.getElementById('no-show-checkbox').checked) {
pushwoosh.sendTags({ 'dismissed_popup': true });
}
pushwoosh.closeInApp();
});
3. Use segments to filter users
To stop the message from appearing again, you must exclude users who have the tag you created.
- For Event-based journeys: Place a Segment split immediately after the trigger event. Configure it to only let users through if
dismissed_popupdoes not equaltrue. - For Audience-based journeys: Edit the segment used in your Audience entry node. Add a filter to exclude any device where the
dismissed_popuptag is set totrue.
Comments
0 comments
Please sign in to leave a comment.