[ic] Removing session ID from the URL

Paul Vinciguerra pvinci at vinciguerra.com
Thu Jan 13 09:25:46 EST 2005


On Wed, 12 Jan 2005 10:56:25 -0800, Grant wrote
> > > To put AdSense Ads on one of your pages you copy some javascript that
> > > Google gives you on to your page. This will send the url that is in
> > > the address bar of your browser to Google to determine what ads to
> > > show. Google will then match the URL (from your browser address bar)
> > > with what it's spider had previously found. The URL passed to Google
> > > has a sessionid in it. The URL that the spider found previously does
> > > not. Because they do not match Google will not show real ads.
> > >
> > > I've not done it but my solution would be to modify the javascript you
> > > put on your page to filter out sessionids before you pass it to
> > > Google... this should fix the problem in my opinion.
> > >
> > 
> > Aha. Thanks for the elucidation -- it should be an easy fix
> > to do that:
> > 
> >         url = url.replace(/\?.*/, '');
> > 
> > assuming that you don't have any CGI params in your AdSense URLs.
> 
> Sorry, I should have done a better job explaining.
> 
> I know nothing about javascript, but Google doesn't seem to pass the
> URL in a variable.  It's as simple as this:
> 
> <script type="text/javascript"
> src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
> 
> Even if it were passed in a variable, modifying the code would 
> violate Google's Terms of Service, and from what I've read they're 
> very strict about it.
> 
> As for the Robot* directives, it sounds like it's still a good idea 
> to use them, even with mv_no_session in place.  I'm still trying to come
> up with data on what percentage of users reject session cookies these
> days.
> 
> - Grant
> 
> > Mike Heins
> _______________________________________________
> interchange-users mailing list
> interchange-users at icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users

My approach was as follows:

In Apache:

    RewriteRule ^$  /cgi-bin/catalag/index.html?mv_tmp_session=1            
[PT,L]
    RewriteRule ^/$ /cgi-bin/catalog/index.html?mv_tmp_session=1            
[PT,L]
    RewriteRule ^/index\.html$ /cgi-bin/catalog/index.html?mv_tmp_session=1 
[PT,L]

Works like a charm for me.

Paul


More information about the interchange-users mailing list