Forum Moderators: open

Message Too Old, No Replies

avoiding submit.x and submit.y

optimizing product search URLs

         

jcmoon

10:32 pm on Jan 10, 2008 (gmt 0)

10+ Year Member



In optimizing my product-search URLs, I've run into a riddle.

If someone uses our product search boxes (with graphic Submit buttons), then the URL ends up having submit.x=#&submit.y=# in it, where the # is generally the location of their click on the graphic. If they hit Enter, then these equal 0.

In these instances, these fields are not useful to me, and merely add junk to what would otherwise be useful URLs.

How can I continue to use graphic submit buttons, and have the searchbox contents appear in the URL, but not have the submit.x and submit.y fields?

phranque

3:44 am on Jan 11, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



you could probably use the click event to trigger some javascript to scrub the x,y from the submit when unnecessary.

daveVk

6:42 am on Jan 11, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You probably have some javascript adding the 'submit.x' stuff, search your javascript and html page source for 'submit.x' for starters.

phranque

7:08 am on Jan 11, 2008 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



according to the w3c description of graphical submit button behaviour [w3.org]:
When a pointing device is used to click on the image, the form is submitted and the click coordinates passed to the server. The x value is measured in pixels from the left of the image, and the y value in pixels from the top of the image. The submitted data includes name.x=x-value and name.y=y-value where "name" is the value of the name attribute, and x-value and y-value are the x and y coordinate values, respectively.

penders

10:10 am on Jan 11, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



As phranque states, this behaviour is by design. A slight problem, however, is that IE and FF both return slightly different variations back to the server.
[webmasterworld.com...]

you could probably use the click event to trigger some javascript to scrub the x,y from the submit when unnecessary.

If you have a type="image" submit button I'm not sure that it's going to be possible to 'scrub' the x,y from the response? If, however, you had a normal IMG with an onclick event that called the forms .submit() method then that may work. BUT you are then relying on JavaScript to be able to submit your form.

IMHO I would simply ignore these extra parameters since I guess you aren't checking for 'submit' in your search script?

jcmoon

3:15 pm on Jan 11, 2008 (gmt 0)

10+ Year Member



Yes, I was under the impression the submit.x and submit.y items were by design ... they're supposed to happen. I hadn't considered using onClick and JavaScript to submit - that's a possibility, though I'd prefer the simplicity of a form that doesn't require JS.

It's not a showstopper, of course, and my search script does ignore whatever values come via those fields.

So here's why I care: we see 1000's of searches every day. That's a ton of real IP addresses at any time of day loading relevant URLs for their desires, all of which are noticed by Google Analytics (and, in many cases, Google Toolbar). These URLs may not be linked-to, but they still can (and do) appear in the SERPs.

One of the Signals of Quality is shorter, simpler, easier-to-type URLs, without irrelevant stuff in them. With that in mind it's easy to see which of these looks better:

  • www.example.com/search?product=widgets&submit.x=8&submit.y=15
  • www.example.com/search?product=widgets

    If the latter is possible, that's where I want to be.

  • Fotiman

    7:12 pm on Jan 11, 2008 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



    It sounds like what you want is to have your SERP (Search Engine Results Page) show the URL in a more friendly manor. This should be done by whatever server side language is processing the request. Simply copy the URL to a new string, minus the submit.x and .y fields.

    jcmoon

    9:43 pm on Jan 11, 2008 (gmt 0)

    10+ Year Member



    Fotiman, do you mean using, say, a 301 redirect?

    Something along the lines of
    (.*)&submit.x=(.*)&submit.y=(.*)&(.*)
    being redirected to
    $1$4

    And then, after that, a rule to catch the times when submit.x and submit.y do not have &(.*) after them ...

    Is this what you had in mind?

    Fotiman

    10:10 pm on Jan 11, 2008 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



    No, I meant in whatever server side language you are using to spit out the text link on the results page (ASP? PHP?).

    jcmoon

    10:28 pm on Jan 11, 2008 (gmt 0)

    10+ Year Member



    Perl, actually. And thanks, my search script did that from the start. It says "243 results for widget" and the word "widget" has a perfect, clean, simple link.

    Achernar

    1:56 pm on Jan 12, 2008 (gmt 0)

    10+ Year Member Top Contributors Of The Month



    In the <form> tag add:
    onsubmit="this.submit();return false;"

    This will get rid of submit.x

    jcmoon

    10:52 pm on Jan 24, 2008 (gmt 0)

    10+ Year Member



    That worked, in all cases. Wow. Thanks!

    g1smd

    12:41 am on Jan 25, 2008 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



    Good to see people thinking about Duplicate Content issues at the design stage.