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.

count_with_min

Finds a group of items that share the lowest value for a specific attribute, and then returns the number of items that also share the same value of another attribute. 

Syntax

count_with_min(ATTRIBUTE, MIN-ATTRIBUTE)
Learn more about syntax for functions.

Parameters

  • ATTRIBUTE: Any type of standard attribute or custom attribute (number, text, or other types).
  • MIN-ATTRIBUTE: Any type of standard attribute or custom attribute (number, text, or other types), though typically you specify numeric or monetary attribute. The function selects all items that share the lowest value of this attribute.

    If you specify a text attribute, the function sorts by lexicographic order and selects items at the beginning of the sort list.

Learn more about referring to inventory attributes.

Example

An ad group that's scoped to the "MyBrand" brand contains the following items:

BRAND TITLE PRICE DISCOUNT
MyBrand Red shoes $10.00 10%
MyBrand Yellow shoes $10.00 10%
MyBrand Blue shoes $10.00 5%
MyBrand Crew socks $5.00 20%
MyBrand Dress socks $5.00 20%
MyBrand Knee-high socks $5.00 15%
  • In an ad template, 
    [count_with_min(DISCOUNT, PRICE)]

    does the following:

    1. Scans the PRICE column and finds the items that share the lowest price.
      In this case, the function selects "Crew socks", "Dress socks", and "Knee-high socks" (which all specify a price of $5).
    2. Scans the DISCOUNT column for "Crew socks", "Dress socks", and "Knee-high socks" and counts how many items specify the same value.

    In this example, the function returns 2 ("Crew socks" and "Dress socks" both have a 20% discount).

  • In an ad template, 
    [count_with_min(TITLE, PRICE)

    returns 1, since all items with the lowest price have unique titles.

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
4920364581746433454
true
Search Help Center
true
true
true
true
true
263
false
false