Notification

Welcome to the help center for Search Ads 360, a platform for managing search marketing campaigns.  While the help center is available to the public, access to the Search Ads 360 product is available only to subscribing customers who are signed in. To subscribe or find out more, contact our sales team.

SEARCH

Returns the starting position of the first instance of needle in haystack. Returns null if needle is not in haystack.

By default, this function counts from the beginning of haystack, but you can specify a starting position.

Always counts in the natural direction of the advertiser’s locale. For example, if the advertiser’s language is English, this function counts from left to right.

This function can be used only in inventory templates in manual campaigns. Templates in upgraded inventory management use a different set of functions.

Syntax

SEARCH(needle, haystack[, starting-position])
Specify the function name in upper case: SEARCH

Parameters

  • needle and haystack can be any of the following:
    • An inventory attribute such as BRAND, or a static string surrounded by quotes such as "Shoes".
      Specify standard attributes in upper case; use the Search Ads 360 UI for guidance on specifying custom attributes.
    • An expression or function that returns a string.
  • starting-position is an optional positive integer that indicates where to start searching in haystack.
    A value of 1 searches from the beginning of haystack (this is the same as the default behavior). A value of 4 starts searching from the 4th character.

Case sensitive

Text searches are case sensitive. That is, SEARCH("Shoe", "shoes") evaluates to false.

Empty character

If you include an expression or function, the expression or function could evaluate to an empty string.

Be aware that searching for an empty string always returns 1. That is, SEARCH("", "GDN") evaluates to 1.

Examples

  • SEARCH("cow",BRAND) returns 1 if the inventory feed returns a brand name of "cowabunga".

  • SEARCH("abunga","cowabunga") returns 4.

  • SEARCH("a","cowabunga") returns 4, which is the location of the first a.

  • SEARCH("a","cowabunga", 5) returns 9, which is the location of the first a that occurs if you start counting from the 5th character.
    That is, SEARCH("a","cowabunga", 5) starts searching cowabunga from the 5th character, which is b. The function finds an a in position 9 of cowabunga.

Was this helpful?

How can we improve it?

Need more help?

Try these next steps:

true
Search
Clear search
Close search
Google apps
Main menu