Using the CONTAINER function

The CONTAINER(...) function checks if the container matches a filter. The "container" is the immediate owner of an item. For example, for keywords or ad group-level audiences, the container would be the ad group. For ad groups or campaign-level sitelinks, the container would be the campaign. And for campaigns, account-level assets, or items from the shared library, the container would be the account itself.


  • filter -- owning containers must match these filter conditions.


CONTAINER( labels = ("abc", "xyz") )

Checks if the owning ad group or campaign has the labels "abc" or "xyz" applied.

CONTAINER( status = enabled CONTAINER(bidstrategytype = enhancedcpc) )

If applied to keywords, or any items under ad groups, checks if the owning ad group is enabled and its owning campaign has a bid strategy type of "Enhanced CPC".

CONTAINER( COUNT(keywords, status = enabled) < 100 )

Checks if the owning container has less than 100 enabled keywords. If applied to campaigns, this filter will count the enabled keywords in the entire account (the container of the campaign).


  • If there are multiple conditions in the filter, they must all match for the item to be considered. They can be wrapped in an OR function to look for items matching any of the conditions. For example, CONTAINER(OR(status = enabled adrotation = optimize)) will check if the owning ad group is enabled or has an optimized ad rotation, or both.
  • For items which can exist at multiple levels, the filter can contain conditions that only apply to some of those levels. Conditions that don't apply to a particular level will be ignored. For example, if CONTAINER(bidstrategytype = maximizeclicks targetingoptimization = conservative) is used to filter audiences, which can be campaign-level or ad group-level, it would find all campaign-level audiences whose campaign uses a "Maximize Clicks" bid strategy type and ad group-level audiences whose ad group has a "Conservative" targeting optimization.

Was this helpful?

How can we improve it?

Need more help?

Try these next steps:

Clear search
Close search
Google apps
Main menu
Search Help Center