Browse the documentation
Search Ads
Applies to: Publishers · needs the matching permission on your account
A Search Ads zone shows native ads for what visitors type into your own search box. As someone types "running shoes", the zone asks for ads that match that search and shows them as results, under your box or inside your existing suggestions list. It can also list the ads in the page itself, as search results under the box or in a spot you choose. Each result is labelled as an ad.
What this is#
Search Ads is an ad zone type built on native ads. It serves only Search Ads campaigns, which advertisers buy as their own ad type, and never regular native campaigns. It doesn't replace your search. Your search box, its form and its results page keep working as before. The zone listens to what is typed and, once enough characters are in, requests native ads for that search.
- Search Ads campaigns that target a keyword in the search are picked for it, so the results are relevant to what the visitor is looking for. Search Ads campaigns without keywords fill any remaining places.
- An advertiser can also put keywords on a single ad (Use Keyword Targeting on the ad). That ad then shows only when one of its keywords is in the search, and it takes at most 8 keywords. Without keyword targeting the ad shows for any search.
- The network can set a separate minimum bid for ads with keyword targeting on. When it has, the ad form shows that minimum under the bid once Use Keyword Targeting is on, and an ad below it cannot be saved.
- Some searches never get a matching ad. A built-in list blocks searches about minors, non-consent, violence and similar topics in many languages, including disguised spellings. That list is always on. You can add your own words and phrases on top. In a search box such a search gets one general ad that has nothing to do with what was typed: the search is not used to pick the ad, not put into landing page addresses and not recorded in your stats. Chat answers and in-text links get no ad at all.
- Each search is recorded in your stats as the zone's sid1, so you can see which searches earn. It is recorded in lower case, so "Shoes", "SHOES" and "shoes" count as one search. Ads that repeat the search in their text, and landing pages that receive it as
{search}, keep the visitor's own wording.
If Search Ads is not in the Type list when you create a zone, it has not been switched on for your network yet. Ask your account manager.
When you'll use this#
- Your site has a search box that gets real use, and you want to earn from that moment of intent.
- You already show search suggestions and want a sponsored result between them.
- Your site has no search box yet. The zone can draw one for you.
- You want the ads listed in the page like search results, not in a box that floats over it.
Set it up#
- Create a zone of type Search Ads under Ad Zones.
- On the zone's Settings tab, fill in:
- Where the ads show:
- Own dropdown under the search box: the zone opens its own box under your input with the ads and the visitor's recent searches. Use this when your site has no suggestions of its own.
- Inside the site's existing suggestions panel: the ads go into a placement you put inside your current suggestions list. Fill in the Suggestions panel selector so ads are only requested while that panel is open.
- We draw the search box, with the ads under it: the zone puts a search box on your page itself and opens the same dropdown under it. Fill in Text in the empty box and, if searches should go to your own results page, Your search page, for example
https://yoursite.com/search?q={q}.{q}is replaced by what the visitor typed. Leave it empty and the box only shows ads and recent searches. - A results list in the page, under the search box or in your own div: the ads are listed in the page itself, like search results, instead of in a dropdown that floats over it. They appear right under the search box, or in a
divyou put where you want them, for example in your content column. The list updates as the visitor types and when they press Enter, and stays when they click elsewhere. Leave Search box selector empty and the zone draws the box; fill it in to use your own. If the page address carries a search, for example/search?q=shoes, it is filled in and the ads are listed on load; Search parameter in the page address is its name (q, orsfor/?s=shoes). - In-text: words in your articles become ad links (no search box): the zone needs no search box at all. The most frequent words and two-word phrases of your article are looked up as if a visitor had searched for them, and each one that matches a campaign keyword becomes an underlined link. Hovering it (tapping it on a phone) opens a small card with the ad; a click on the card opens the advertiser's page. Article selector says where your article text is (empty = the page's article, or its main content) and Ad links per page caps the links (1–10). Links, headings, menus, header and footer are never touched, and the impression is only counted when the card opens.
- AI chat: an ad card under your chatbot's answers: for a chatbot on your site. Point the zone at your chat widget — Message list, Answer bubbles and Visitor messages are CSS selectors — and when an answer has finished, an ad for what the visitor asked appears under it, labelled as an ad and counted only when it is on screen. An ad under every Nth answer spaces them out. A chat app without a web page (a mobile app, a messenger bot, your own server) asks the ad server directly: the zone code shows the URL, which takes the visitor's question (
q), optionally the answer (a), and the visitor's IP and browser, and answers with the ad as JSON (title,description,image,click_url,impression_url). Show the ad with your label, openclick_urlon a tap and callimpression_urlonce the ad is actually shown. Questions or answers on our blocked-term list never get an ad.
- How each ad looks: an ad card with image, title, description and link, or a search suggestion, one line with a small image and the title, so the ad reads like one of the suggestions, or a search result: the label and link on top, the title, the full description and a small image, so the ad reads like one of your own results. Use the search result look with the results list. A new zone starts with the search suggestion look and Square images. With the ad card and the search result you can switch off Show the description and Show the display URL; with Square images the picture is drawn square.
- With the own dropdown or the drawn box: Where the ads sit in the dropdown (above or below the visitor's recent searches), Picking a recent search (search for it right away, or only put it in the box and show its ads), and Show an ad as soon as the search box is opened: before enough is typed, an ad from a campaign without keywords is shown, and the ad for the search replaces it once the text is long enough. What was typed is not used for that first ad. It costs one extra ad request per visit to the box.
- Ads per search, Characters before ads show, and the Ad label text.
- Extra blocked terms: words or phrases handled like the built-in list on your site: only a general ad in a search box, no ad in a chat, and never recorded.
- Where the ads show:
- Open the zone's Code tab. For the own dropdown, the suggestions panel and the results list, fill in Search box selector there: a CSS selector that matches exactly one search input on your page, such as
#header-search, and save. It is optional: without it the code uses#your-search-inputand comes with an example search box, and for the results list the zone draws the box. A selector the browser can't read is flagged before you copy the code. Then copy the code; the other settings are already filled in. - Put the code on your page after the ad controller tag:
- Own dropdown: paste the script anywhere, for example just before
</body>. There is no div to place. - Existing suggestions: put the
divinside your suggestions panel, after your own suggestions. To show the ads above your suggestions instead, move thedivabove them; the zone never reorders your own list. For aulorollist, change thedivinto anli. Paste the script once. - Results list: put the box
div(or keep your own search box) where the search box should appear. The ads are listed right under it. To list them somewhere else, add thedivfrom the comment in the code there. Paste the script once. - Drawn search box: put the
divwhere the box should appear, for example in your header. The box fills the width of thedivup to 480px. Paste the script anywhere after the controller tag.
- Own dropdown: paste the script anywhere, for example just before
Changing settings later#
You don't need to copy the code again after changing how the ads look or behave. Your pages pick up the zone's current Ads per search, Characters before ads show, Ad label, How each ad looks (including the description, display URL and Square images), the dropdown colours, the recent searches, Where the ads sit in the dropdown, Picking a recent search, Show an ad as soon as the search box is opened, the text in the empty drawn box, Your search page and Search parameter in the page address by themselves, usually within about 10 minutes. A visitor who already has the page open sees the change on their next page view.
Copy the code again only when you change Where the ads show or the Search box selector, because those decide where on your page the zone sits. In-text and AI chat zones still take every setting from the code, so copy it again after a change there. While this is being rolled out to your network's ad servers, a change may still need the code copied again; your account manager can tell you when it is live.
Keep your search form and its input name exactly as they are. With the own dropdown, also set autocomplete="off" on the input so the browser's saved suggestions don't cover the ads. The zone code does this for you once it loads.
Changing the layout#
The results use the same templates as a native zone: tpl_body, tpl_row and tpl_item. Inside tpl_item, {image}, {title}, {description} and {displayurl} are replaced for each ad. The element with the class {href_itemid} is what the visitor clicks. The default layout comes with gcs- class names (gcs-item, gcs-title, gcs-label, …) that you can restyle from your own CSS. Keep the ad label visible.
Because the zone's settings now reach your page by themselves, they also replace the templates in the code. If you edit the templates in the code yourself, add "own_tpl":1 next to them so your own templates are kept; the other settings still follow the zone. A tpl_item without the gcs-item class is always kept as you wrote it.
The drawn search box uses gcs-box, gcs-box-input and gcs-box-btn. Its width and corner radius follow the CSS variables --gcs-box-width and --gcs-box-radius, and the colours follow the Dropdown colours setting.
Tips#
- One zone per search box. A header box and a separate mobile box need two zones. One box that is only restyled for mobile needs one.
- If your search box is added to the page later, for example by a single-page app, the zone waits for it. If you replace the box with a new one, call
goCtrl.search.refresh(<zone id>)afterwards, using the controller name from your code. - With the own dropdown, a search that runs without a form submit (an instant-results page, say) can still be added to the visitor's recent searches with
goCtrl.search.remember(<zone id>, "the search"). goCtrl.search.query(<zone id>, "a search")puts a search into the box from your own code and shows the ads for it, for example when your page runs a search without a reload.- To control when your suggestions panel counts as open, call
goCtrl.search.setOpen(<zone id>, true)andfalseyourself.
Troubleshooting#
- Nothing shows up. Check that the Search box selector on the Code tab matches exactly one input. Then check the search is at least as long as Characters before ads show. Also check that the controller tag is on the page before the zone code.
- Ads show for some searches and not others. Either the search is on the blocked list, or no campaign had an ad for it at that moment. Blocked searches get only a general ad (none in a chat) and never appear in your stats.
- The dropdown sits in the wrong place. It is positioned under the input when it opens, and again on scroll and resize. If your header is fixed or animates, use the existing-suggestions mode instead and place the
divyourself.