It actually sounds like the trafficshield.xyz ad that you were directed to on Safari from playing a game. Yes, these are scams and it is the game that you were playing that was payed to bring that up. Contact the developer of the game and tell them you will refuse to play it any longer if they continue these fraudulent attempts to scare you into downloading additional software. This has been especially noted on Words with Friends, but also many other games that receive ads from the same Ad Network.
Specifically for Word with Friends, Zynga has acknowledged that it is a problem on their end and they should not be directing you to Safari, and they are working on a solution. In reality it will need to be removed by the Ad Network that prompts that ad.
You have several options until the developer of the game resolves the problem:
- Quit playing the game until resolved
- Purchase their ad-free option
- Contact the developer
- Write a review for the app in the App Store
- Ignore the ad that pops up. Note that if you close Safari with that page on the screen, the next time you open Safari, it will show again, but you simply need to close the tab or navigate to a different page.