I'm trying to set up a custom search ad, but I am nost sure about the query.

On the site it says:

'query' should be dynamic based on your page. This variable targets the ads and therefore should always match what the user on your site has just performed a search for.

Now, what I understand is: I have to program my page so that the query variable contains some custom words. Am I right?

If a user gets to my site through clicking on an AdSense, there is no way to "know" what the user looked for and display my query accordingly, right?

  • How did you get this to work? Anyone get it to work with Wordpress? – user32035 Oct 16 '13 at 15:56

Can you post a link to your site so I can answer better?

Custom search ads are intended for search engines. Is your site a search engine? If so, it should have a query box, which you should integrate into the code.

If your site is not a search engine, then you should use regular adsense.

Have you applied and been approved for Adsense custom search ads? Using it requires special approval per site.


I found out the answer, and it it yes, you have to program your javascript to grab the search parameters and put them into the "query" variable inside the adsense code!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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