Welcome to Android Central! I wonder if it's some adware causing a popup that isn't quite accessing the ad it wants to show. If you did a factory reset but then reinstalled all of your apps, you may just have reinstalled the app with the adware.
Try installing something like Lookout's Ad-Network Scanner & Detector
. If it doesn't find anything, you could try booting into Safe Mode, which temporarily disables all 3rd party apps. If the problem goes away, then you know that something you installed is causing the problem. You may have to uninstall apps one by one until the problem goes away.
What device do you have? Booting into Safe Mode is generally the same for all devices:
1. While the device is on, press and hold the Power button until you see the Power dialog box.
2. Press and hold "Power Off' until you see a prompt for Safe Mode.
3. Tap OK, and wait for the device to reboot.
4. To get out of Safe Mode, just reboot normally.