__utm.gif --- how to redirect request?

Hi All,
Simple question, I think.

Our error log is flooded with file not found requests for __utm.gif.
This
is part of google analytics and for some reason, the requested pages
(some)
are trying to load it locally.

I have yet to figure this problem out in terms of the “why” but for now,
I
want to remove it from my error log.

2 options:

  1. Put a copy of the file in our root directory which will quiet down
    the
    error log or
  2. Redirect requests to the file via nginx configuration file, something
    like this:

location /__utm.gif {
[ redirect to: http://www.google-analytics.com/__utm.gif]
}

What would be the correct format for above?

Also, has anyone encountered this issue before?

Thanks

These requests could be from crawlers. A couple ways to tell: (1) are
the requests from just a few IPs, or from lots of different IPs? And
(2) do the requests contain all the query string parameters that are
sent to Google Analytics?

I run several sites, all of which use Google Analytics, but I’ve never
seen this particular request in the logs. I have seen some others of
unused assets that crawlers found in various JavaScript or CSS files.
Some crawlers seem to scrape all referenced files for something that
looks like a URL and then attempt to access it. I even get requests
for “http://tel:/18002345678” from mobile site pages where I have
links like 1-800-234-5678. The crawler
doesn’t understand, but makes the request anyway.

I would definitely figure out why this is happening first, but to
answer your question, this should do what you need:

location ^~ /__utm.gif {
redirect ^ http://http://www.google-analytics.com$request_uri;
}

You’ll want to pass the $request_uri, otherwise the request to Google
Analytics will be meaningless (because it won’t contain any tracking
data).

By the way, if the traffic is over SSL, be sure to redirect here
instead, so as not to cause a security warning in some browsers:

redirect  ^  https://ssl.google-analytics.com$request_uri;

Also note that I haven’t tested these, but I don’t see why they
wouldn’t work. However, that being said, I don’t know how well
browsers respect redirects for image requests.

Thank you so much for the detailed response as well as suggested nginx
configuration, I will try it.

There’s no question that this is a problem with something somewhere and
I
will need to figure out what. Right now I don’t have the bandwidth and
b/c
its clogging up the error log file, I want to clear that up and move on.

I don’t think that its happening due to crawlers as the pages that are
coming up in the log file (referring page) are many and there is no
pattern. I’ve checked many of the referring IP addresses and they are
valid
users of our service.

Hi,

My suggestion:

location = /__utm.gif {
return 404;
}

or

location = /__utm.gif {
log_not_found off;
}

On Fri, Sep 11, 2009 at 9:35 AM, Ilan B. [email protected]
wrote:

users of our service.

answer your question, this should do what you need:
instead, so as not to cause a security warning in some browsers:

Simple question, I think.
the

Regards,

On Thu, Sep 10, 2009 at 07:27:39PM -0500, Nick P. wrote:

for “http://tel:/18002345678” from mobile site pages where I have
links like 1-800-234-5678. The crawler
doesn’t understand, but makes the request anyway.

I would definitely figure out why this is happening first, but to
answer your question, this should do what you need:

location ^~ /__utm.gif {
redirect ^ http://http://www.google-analytics.com$request_uri;
}

Small correction:

  • location ^~ /__utm.gif {
  • redirect  ^  http://http://www.google-analytics.com$request_uri;
    
  • location = /__utm.gif {
  • redirect  ^  http://www.google-analytics.com$request_uri?;

On Fri, Sep 11, 2009 at 01:16:02PM +0800, Joshua Z. wrote:

Hi Igor,

Typo? I guess it should be ‘rewrite’ instead of ‘redirect’. :smiley:

Yes, of course. The complete configuartion is:

location = /__utm.gif {
rewrite ^ http://www.google-analytics.com$request_uri?;
}

Hi Igor,

Typo? I guess it should be ‘rewrite’ instead of ‘redirect’. :smiley:

2009/9/11 Igor S. [email protected]:

Some crawlers seem to scrape all referenced files for something that
}
Analytics will be meaningless (because it won’t contain any tracking

  1. Put a copy of the file in our root directory which will quiet down the

    Igor S.
    http://sysoev.ru/en/

Cheers,

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs