in reply to Re^4: Google AdSense Code cause double entries of search terms in the log table
in thread Google AdSense Code causes double entries of search terms in the log table

You did say that the second hit on your site is always from the same IP. So just ignore that IP for your stats.

As far as I see from your description, you've got two separate hits. One from the customer, and a second hit from Google, perhaps to check that the ad hit was legit.

Your script is probably making two entries because it is getting called two times.

This shouldn't be that complicated...

  • Comment on Re^5: Google AdSense Code cause double entries of search terms in the log table

Replies are listed 'Best First'.
Re^6: Google AdSense Code cause double entries of search terms in the log table
by aceofspace (Acolyte) on Dec 22, 2010 at 03:54 UTC
    Here are the issues:

    The second hit came from Google which is a machine. It obviously causes my script to run one more time immediately after a visitor enters a search term in the search form. This may delay the display of Search Result Page, affecting my site performance.

    I'm looking for way to stop Google's Machine activates my script.

    Google's AdSense Code is a JavaScript.

    Any suggestion?
      "google's machine" identifies itself, and has ways of being signaled to not activate your script -- its easy to deny it access
        Yeah, I've thought of designing the script to block Google Machine's IP which is 66.249.71.196 presently.

        But IP, 66.249.71.196 is discovered after the fact. I can design the script to deal with this particular IP.

        What if Google changes its Machine IP in future, or dynamically changes its IP. I'm back to square one.

        Any suggestion for a long term solution?