When you'll see the popup, hit recent. You'll see the name of the app that's pushing these ads.
And these type of popups are the result of you giving an app the permission to appear on top. Goto setting>Apps then click on the 3 dots at the top of the right corner. Then goto special access, then click on "Apps that can appear on top". Look for the apps that might push these ads and disable it(just that permission).
If you've figured out the culprit app via the recent menu, then just disable that permission for that app. Better yet, just delete the app.
Edit: oops! I posted on the wrong forum. Just wait for the right person to help you out. Till then, you can also try what I said. It should do the trick.