in reply to Re^3: 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

If you want to ignore searches that come from Google, why not simply do so?

I don't think you understand the issue or problem when you make such a statement.
I've a feeling you do not know what Google AdSense is.

Google AdSense is a Google advertising program that enables website publishers of all sizes to display targeted ads alongside their online content and earn money.

The purpose of me using Google AdSense in my website is to generate revenues from the Google Ads placed on the site.

My problem:

When I place Google AdSense code in my website, it will cause my script to make double entries of the search terms entered in the search form.

Just curious if any of you have experienced this problem. If you have, how do you fix it?
  • Comment on Re^4: Google AdSense Code cause double entries of search terms in the log table

Replies are listed 'Best First'.
Re^5: Google AdSense Code cause double entries of search terms in the log table
by Anonymous Monk on Dec 21, 2010 at 17:42 UTC

    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...

      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