Query String Queries

Website addresses or URLs are complicated things that are actually made up of many parts.

This is a URL with all it’s different bits colour coded:

https://www.client.com/shop/offer?source=display&campaign=summer#section2

There are actually more parts than this that could be used but these are pretty much the only ones you are likely to see when running ad campaigns.

  • Scheme = this will just be either “http” or (hopefully nowadays) “https”. Other things can be used like “mailto” or “ftp” but they’re not common enough to go into here.
  • Host = this can be thought of as just the website in general, remember that the “www.” may be required or may not, both are actually valid.
  • Path = this is basically the different folders you navigate through to get to the page in question.
  • Query String = now this is the most important part for use in AdOps. The query string is a collection of what are called “name value pairs”. In this example you have one with the name “source” and its value “display”, another called “campaign” with the value “summer”. A query string must always start with a question mark (there should only be one question mark in a URL with some rare exceptions) and have it’s different pairs separated by ampersands (&).
  • Fragment = call this a hashtag and I may have to slap you (while we’re at it these things {} are called “braces” not “squiggly brackets!). These are sometimes referred to as anchor tags and they cause the webpage to jump down to or show a particular section. If you look at most FAQ type pages where the questions are all at the top and clicking on one of them makes the page jump down to the right answer, these work by using these fragments in the links.

 

A common mistake I see with URLs my team gets sent to traffic is this:

  • URL Sent: https://www.client.com/offers?code=12345
  • They know that they need to add “?source=display” to every URL they are given.
  • Resulting URL: https://www.client.com/offers?code=12345?source=display
  • This URL has two question marks in which won’t work, technically the value of “code” is all of “12345?source=display”
  • The extra tracking should be added on separated by an ampersand to keep the format correct.
  • Correct URL: https://www.client.com/offers?code=12345&source=display

Another mistake is related to those fragments:

  • URL Sent: https://www.client.com/offers#section2
  • Again they try to add “?source=display” to the URL
  • Resulting URL: https://www.client.com/offers#section2?source=display
  • The page doesn’t change to the right section correctly, this is because the fragment is not at the end where it should be.
  • Correct URL: https://www.client.com/offers?source=display#section2

Leave a reply

Your email address will not be published.

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>