Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a landing page in which I need to understand what keywords are coming in from AdWords and then display some information based on this. I am not certain, but I don't believe that this information is in the request header the same as normal query keywords would be. How can you ascertain this information and properly strip out the inbound AdWords keywords so as to use meaningfully?

share|improve this question
up vote 0 down vote accepted

If by keywords, you mean what the user searched for, that's possible.

Look at the HTTP_REFERRER header and for the q=string bit.

e.g. This is one of the adwords links in our adwords http://www.google.co.uk/aclk?sa=l&ai=CSh_Wsj58ULfSG6eQ0wX2lYGoCeeOl-oC58Cl-Drf1IC_TggAEAMguVQoA1CKi6VhYLu-roPQCqAB4feK9wPIAQGpApKunRBI7ro-qgQoT9ChS2VRrwOYoAh7INk0o-weepWecQHgrRXsbAAywxiTq8S-Q2z3EoAFkE4&sig=AOD64_13QvYMRHa0MIhPoLtM_hiFL9X-Mg&ved=0CC8Q0Qw&adurl=http://vzaar.com/landing/trial%3Fpartner%3Dadwords_Business-Video-UK&rct=j&q=online+video+hosting

You can see the the &q=.... parameter which comes across in the referrer header. If you extract that from the header you can work out what the search query keywords are.

(You can see it in the referral header here - http://i.stack.imgur.com/vLERe.jpg )

share|improve this answer
Thanks @Sevitz, you've helped clear this up with a concrete example from an actual click-through. – ylluminate Oct 15 '12 at 17:04
@ylluminate that doesn't always work due to instant search see my answer – Anagio Oct 15 '12 at 17:05
I've found even with instant search, you still get the search string in the referrer most of the time. I agree though that it doesn't always come through. – Sevitz Oct 15 '12 at 17:13
I've updated my answer to show a clear example of Instant search on and off – Anagio Oct 15 '12 at 17:18

If the person has instant search on you wont get the keyword, the parameter q= shows up for static searches. In your Analytics go to Traffic Sources - Sources - Search - Organic you'll see in the keywords column (not provided) that's due to instant searches.

To track the keywords you can try adding keyword insertion into your target URL so when they click the Ad it'll be stored in Analytics as part of the landing pages URL


Similar to tagging your URL's only with this you'll add the keyword they searched to the URL so you have a record of it.

Try adding a unique destination URL to individual keywords. http://support.google.com/adwords/bin/answer.py?hl=en&answer=2404246

Here's two example searches one with instant search on one off

Instant Search on has no q= parameter at the end


Instant search off contains q=loan at the end

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.