![]() |
What is the stuff after a question mark in a URL?
In the Hyatt forum, a member posted a prediction of an upcoming promotion. The included URL was "http://onemileatatime.boardingarea.com/2016/03/22/hyatt-promotion-2016/?_ga=1.38430631.548781155.1458582854". What is all that stuff after the question mark? Does it do anything for me?
Thanks for any insight. |
That is info passed to the program that handles that URL. They are known as CGI (Common Gateway Interface) parameters. Multiple parameter key/value pairs are separated by & characters. In this particular case, it could be some kind of unique session identifier, but no way to really tell without seeing the programming on the server.
|
Even more directly, the CGI parameters are a way for the browser to pass information to the web server so the server can process it and spit back a custom response. Usually this information is entered in a form on the page. So if you were searching for a flight, the url parameters might include the dates of travel and airports you enter.
There are other ways of passing this info to the webserver that don't involve user-viewable parameters in the url, so if you don't see them then that's what's going on. |
Also, characters after the question mark are used to pass information to web analytics software to know more about how someone got to the page. We use them in marketing to tell what specific email, social media post, etc, brought people to a website.
|
example
Code:
https://www.google.com/flights/#search;f=EWR;t=LHR;d=2016-04-07;r=2016-04-11if you can't, then you aren't a power user on flyertalk (syntax here is slightly different, no questionmark or ampersands... but the idea of key-value pairs remains the same |
Oh my. What has CGI has to do with the query component of an URI? https://tools.ietf.org/html/rfc3986#section-3.4 They are definitely NOT known as CGI parameters at least in the ten years I am a senior web developer (sometimes working on Top 100 sites) I never heard them called such. Googling "CGI parameters" finds only 21 400 documents which indicates it is definitely not a widely used phrase.
CGI will put those in the QUERY_STRING variable but also you can use PATH_INFO to pass information to a CGI script. As to what they might contain: anything. There's no standard. Most everyone went to so called "nice URLs" or "pretty URLs" or whatever which -- as I just mentioned -- gets passed in PATH_INFO -- nowadays they almost always contain tracking information. Very often it'll be utm_... which indicates a very lazy team using Google Analytics and Tag Manager. For one (of the many) nicer ways see http://www.lunametrics.com/blog/2014...gn-parameters/ paperwastage's example is not a query either, it's a fragment... and for fragments there's even less standardization, that Google Flights puts key-value pairs in a fragment is an interesting decision, not more. You will find most fragments are not key-value pairs. |
THANK YOU. I'd been thinking that "CGI params" didn't quite sound right. It's the query string. <dim memories of developing websites in ASP circa 2001>
|
I have noticed that United started using key-value pairs in the URL fragment linking to its award search engine.
Quite handy, as I can now save the entire address and with one click can search a specific month for a specific route. |
Originally Posted by paperwastage
(Post 26370358)
example
Code:
https://www.google.com/flights/#search;f=EWR;t=LHR;d=2016-04-07;r=2016-04-11(syntax here is slightly different, no questionmark or ampersands... but the idea of key-value pairs remains the same In the original example, the parts after the ? are sent to the web server as a part of the request. As someone has said above, this is normally referred to as the "query string", and on the server side is normally handled by something that was traditionally called CGI as someone else mentioned (but in an incorrect context), although realistically that term has been rarely used since the 90's. In your example, the parts after the # are NOT sent to the web server. Traditionally the part after the # allowed you to jump part-way through a page, however nowdays they are used as a way of passing data to javascript within the page - so although the items after the # are not passed to the web server directly, they can be read by the webpage itself, and then sent in a subsequent query to the web server. As far as the OP's original query string, that particular query string is there as a tracking string, so that someone can track you jumping between websites.
Originally Posted by gfunkdave
(Post 26371078)
THANK YOU. I'd been thinking that "CGI params" didn't quite sound right. It's the query string. <dim memories of developing websites in ASP circa 2001>
|
Thank you for the explanations
Thank you for the explanations.
It sounds like the string is much more for the benefit of the web site than the user. |
Originally Posted by serpens
(Post 26375272)
Thank you for the explanations.
It sounds like the string is much more for the benefit of the web site than the user. It's just a way to pass parameters or arguments from the client (your web browser) to the server. From that perspective it certainly is done for the benefit of the user, but indirectly. -David |
In general they're part of the URL and that means they're part of what says what content the server should put on the page. So if you leave them out you could get different content or an error.
However in this case I suspect they're just tracking codes indicating which user you are and what page you came from etc. You can try removing them and seeing if you get the same content. Often it's fairly obvious, at least with traditional web pages, which parameters are relevant and which are just session tracking info. You can strip most of it from Amazon URLs or eBay URLs for example and just keep the item number. But there's no single standard for how they get used by the server and more modern sites do complicated things with both the query string and the anchor. |
Originally Posted by serpens
(Post 26375272)
Thank you for the explanations.
It sounds like the string is much more for the benefit of the web site than the user. This isn't a real example, but sometimes you'll see something like this: http://www.flyertalk.com/forum/trave...ostsperpage=50 For example, on a forum where you can select the number of posts per page that are displayed. The maximum is usually 50 to 100 but some discussions span hundreds of posts. Sometimes you can get away to messing with that number to get a big, long discussion that spans many pages to show up in one - by changing that number to 9999 or something. And you can mess with them in other ways to manipulate the way pages behave, depending on what the developer is using those values for, and if they've done any checking server-side to see if anybody has entered unexpected values. |
| All times are GMT -6. The time now is 1:03 am. |
This site is owned, operated, and maintained by MH Sub I, LLC dba Internet Brands. Copyright © 2026 MH Sub I, LLC dba Internet Brands. All rights reserved. Designated trademarks are the property of their respective owners.