Fix: Recommended For You Popup Ads in Browser

Fix: Recommended For You Popup Ads in Browser

A few weeks ago my wife mentioned that she was always getting “Recommended for You” popup ads displayed in her browser whenever she visited a web site. The popup was an ad that would appear in the lower-right corner of her browser window. At first I thought it was related to the site she was visiting until I saw the popup appear on multiple sites. I wasn’t quite sure what was happening so I decided to do a little research.

Unlimited data backup with BackBlaze

Fix: Recommended For You Popup Ads in Browser

The Recommended For You Issue

After performing a few tests I determined that there was indeed a problem on her laptop. While visiting a site an ad, with an iPhone or simple rectangle background, would appear in the lower-right corner of the Web browser window. While the ads didn’t appear to impact the laptop, they became annoying after a while.

The ads would appear on many different websites using multiple browsers. She uses Internet Explorer on Windows 7, so I originally thought it was limited to that browser. I was wrong. I launched Google’s Chrome Web browser and noticed that the ads appeared within that Web browser as well.

Next, I logged in with my own separate account and started to noticed the popup ads appear in my browser window as well. After seeing this I determined that it was a system-wide issue, and not related to a specific Web browser or user account.

The Fix

I first started to look at the actual HTML source code of the pages that displayed the popup ads using a Firefox plugin called “Firebug.” This plugin allowed me to go right to the lines of HTML code that displayed the popup ads.

The code indicated that the Javascript file being executed was ga.js from This web site is owned by Google, and redirects you to the actual Google Analytics home page, so I was confused at why this file would caused the problem.

I then thought about what could be the root cause, and it would need to be on the local system. I then thought about the “hosts” file, which allows someone to point a domain to a specific IP address.

I opened the hosts file, located in “C:\Windows\system32\drivers\etc”, into notepad to take a look at what was written in the file. I didn’t see anything out of the ordinary, but then I scrolled down and found the problem. The hosts file on the laptop was as follows: localhost
::1 localhost
(200 blank lines)

The line “(200 blank lines)” was exactly that – 200 blank lines that pushed the last 6 entries below the viewing area of the file. What the last lines do is point popular website metrics and ad sites to another IP address. This IP address would then use it’s own copy of common Javascript files to display the “Recommended for You” popup ads.

To solve the problem I deleted the last 6 entries, as well as the 200 blank lines, and then saved the new hosts file. Of course, on Windows 7 I needed to log in as an administrator and change the permissions to allow me to write to the file first.

Once the change was made, the “Recommended for You” popup ads no longer appear in the Web browser. Now I just need to figure out how that file was modified.

Get free email updates! Sign up for new post notifications.

8 Responses to “Fix: Recommended For You Popup Ads in Browser”

  1. David Geller says:

    I edited as you said ETC: HOSTS
    Only had 2 lines and no extra:

    Copyright (c) 1993-2006 Microsoft Corp.
    # This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
    # This file contains the mappings of IP addresses to host names. Each
    # entry should be kept on an individual line. The IP address should
    # be placed in the first column followed by the corresponding host name.
    # The IP address and the host name should be separated by at least one
    # space.
    # Additionally, comments (such as these) may be inserted on individual
    # lines or following the machine name denoted by a ‘#’ symbol.
    # For example:
    # # source server
    # # x client host localhost
    ::1 localhost

    Any suggestion? I get an IPhone ad to teh right



  2. Christian says:

    i just checked that file by copy pasting the file you said. then i tried to scroll down and i couldnt there was no extra spaces at all i couldnt even go down the thing by using the down dpad after clicking in so nothing was there and i still have the ads

  3. Jesse Brauning says:

    I think that main question is how the file was modified, since to write something in the hosts file required administrator rights.

  4. shenoyjoseph says:

    wow it was best way to avoid popup ads in spam sites without using any plugins in the browser.

  5. Lakshmi Balu says:

    That one real great analysis on the pop ups. These ads annoy the people to heights. This code of having 200 blank lines was so interesting that I did’nt know the solution would be cured so fast!

  6. Ankur says:

    I have a doubt?
    Even if someone use a plugin, if google is giving ads, then shouldn’t adblock block it.

Leave a Reply

Your email address will not be published. Required fields are marked *