Converts value to a string and returns the length of the string.
This function can be used only in inventory templates in manual campaigns. Templates in upgraded inventory management use a different set of functions.
Syntax
LENGTH(value)
Specify the function name in upper case: LENGTH
Parameter
- value: 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.
Example
[IF(LENGTH(BRAND) > 0, BRAND, "Generic")]
. If an item in the inventory feed specifies a value for BRAND, returns the brand name, otherwise returns Generic.[IF(LENGTH(c:CUSTOM_ATTR) > 0, c:CUSTOM_ATTR, "Generic")]
. If an item in the inventory feed specifies a value for a custom attribute named c:CUSTOM_ATTR, returns the value of c:CUSTOM_ATTR, otherwise returns Generic.Note that if the feed doesn't contain an attribute named c:CUSTOM_ATTR, the Preview keywords button remains dimmed. For example, if the feed uses the name CUSTOM_ATTR but you specify c:CUSTOM_ATTR, you can't click the Preview keywords button. To avoid this problem, select inventory attributes from the Attribute list instead of entering their names manually.