Go Back  FlyerTalk Forums > Travel&Dining > Travel Technology
Reload this Page >

What is the stuff after a question mark in a URL?

Community
Wiki Posts
Search

What is the stuff after a question mark in a URL?

Thread Tools
 
Search this Thread
 
Old Mar 22, 2016, 10:11 am
  #1  
Original Poster
Hilton Contributor Badge
 
Join Date: Sep 2015
Location: flyover country
Posts: 2,435
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.
serpens is offline  
Old Mar 22, 2016, 10:14 am
  #2  
 
Join Date: Sep 2002
Location: Orlando, FL, US
Programs: DL-Dirt Medallion;US-Cast Iron Preferred; HH-Gold; Avis First
Posts: 3,617
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.
djk7 is offline  
Old Mar 22, 2016, 11:08 am
  #3  
FlyerTalk Evangelist
 
Join Date: Nov 2002
Location: ORD
Posts: 14,231
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.
gfunkdave is offline  
Old Mar 22, 2016, 11:17 am
  #4  
 
Join Date: Mar 2015
Location: Wisconsin
Programs: Hilton Diamond, Delta PM
Posts: 323
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.
LizGross144 is offline  
Old Mar 22, 2016, 11:21 am
  #5  
 
Join Date: Jun 2012
Posts: 3,378
example

Code:
https://www.google.com/flights/#search;f=EWR;t=LHR;d=2016-04-07;r=2016-04-11
you should be able to decipher what this URL does (when you load into your browser)

if 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
paperwastage is offline  
Old Mar 22, 2016, 12:43 pm
  #6  
 
Join Date: Jun 2008
Location: YVR
Programs: Aeroplan, AAdvantage
Posts: 2,100
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.

Last edited by chx1975; Mar 22, 2016 at 1:03 pm
chx1975 is offline  
Old Mar 22, 2016, 1:21 pm
  #7  
FlyerTalk Evangelist
 
Join Date: Nov 2002
Location: ORD
Posts: 14,231
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>
gfunkdave is offline  
Old Mar 22, 2016, 8:26 pm
  #8  
Suspended
 
Join Date: Aug 2005
Location: BOS
Posts: 15,027
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.
Dieuwer is offline  
Old Mar 23, 2016, 12:26 am
  #9  
 
Join Date: Jul 2007
Location: San Francisco/Sydney
Programs: UA 1K/MM, Hilton Diamond, Marriott Something, IHG Gold, Hertz PC, Avis PC
Posts: 8,156
Originally Posted by paperwastage
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
No, in fact it couldn't be more different.

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
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>
Using 90's terminology, the query string becomes the CGI parameters once it hits the "CGI" code running on the webserver. Specifically CGI stands for "Common Gateway Interface" and is the interface between the webserver itself and the code running on the webserver for dynamic code. CGI defines the way that data passes between them, and thus the query string becomes the "parameters" within the CGI interface.
docbert is offline  
Old Mar 23, 2016, 10:04 am
  #10  
Original Poster
Hilton Contributor Badge
 
Join Date: Sep 2015
Location: flyover country
Posts: 2,435
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.
serpens is offline  
Old Mar 25, 2016, 2:21 am
  #11  
 
 
Join Date: Nov 2000
Location: Upcountry Maui, HI
Posts: 13,305
Originally Posted by serpens
Thank you for the explanations.

It sounds like the string is much more for the benefit of the web site than the user.
certainly not intended for the user to type them.

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
LIH Prem is offline  
Old Mar 26, 2016, 11:02 am
  #12  
 
Join Date: Dec 2007
Posts: 3,607
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.
zkzkz is offline  
Old Mar 29, 2016, 10:06 am
  #13  
 
Join Date: Sep 2015
Location: BUF
Programs: SkyTean, Star Alliance, HHonors
Posts: 155
Originally Posted by serpens
Thank you for the explanations.

It sounds like the string is much more for the benefit of the web site than the user.
Absolutley. Although in some cases, you can read them, try to make sense of them, and use them to make the website behave in a manner you can't otherwise.

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.
smc333 is offline  


Contact Us - Manage Preferences - Archive - Advertising - Cookie Policy - Privacy Statement - Terms of Service -

This site is owned, operated, and maintained by MH Sub I, LLC dba Internet Brands. Copyright © 2024 MH Sub I, LLC dba Internet Brands. All rights reserved. Designated trademarks are the property of their respective owners.