With all of its quirks and robust functionality, Android as an operating system has come quite a long way from the place it was even just a few years ago. Part of this shines through with the system's 'heads-up notifications' feature which gives users a preview of any incoming notifications for apps that alert users, which Google debuted in Android 5.0 Lollipop. With the rise of Marshmallow Google has decided to keep peeking notifications around and there's nothing wrong with that, unless you don't want every single app showing a preview when those alerts pop up. Thankfully with Android 6.0 Marshmallow one of the big changes and focus points for Google was giving users more control over the system in certain aspects, and in regards to notifications users will now have control over which apps specifically can post these preview panels at the top of the display, something which first showed up during the Android M developer preview.
Users wishing for a little bit more privacy depending on the apps they have installed can turn off peeking heads-up notifications for certain apps they don't want displayed on their screen while leaving others free and clear to show previews as they choose. To get started, navigate to the settings menu where the options to enable and disable these will be located. From here, you'll need to find the "sound and notifications" menu which should be under the device category. Once inside sound and notifications scroll to find and select the menu for app notifications, this is where the list of apps will be that have access to show you heads-up alerts.
Once inside let the list populate and simply select the apps you want to disable the peeking notifications for. Inside your apps once you've narrowed down what you want to manage, you should see options for "block all" which will disable all notifications from that app, "treat as priority" which only displays notifications when the user has set the do not disturb mode to Priority, and finally there should be the option for "allow peeking." If you disable this toggle then you can have notifications show up in your status bar but they won't display as a heads-up preview anymore, thus giving you a little more privacy. Of course, you could always opt to disable them for every app as well if you simply don't care for the heads-up alerts in the first place. The choice is yours.