AdsApp.FrequencyCapBuilder
Stay organized with collections
Save and categorize content based on your preferences.
Builder for FrequencyCap
objects. Methods:
build()
Builds the frequency cap. Returns nothing.
withEventType(eventType)
Set the event type to the new frequency cap. Arguments:
Return values:
withLimit(limit)
Set the cap number to the new frequency cap. Arguments:
Return values:
withTimeUnit(timeUnit)
Set the time unit to the new frequency cap. Arguments:
Return values:
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-09-03 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-03 UTC."],[[["\u003cp\u003eThis page documents the \u003ccode\u003eFrequencyCap\u003c/code\u003e builder, which is used to create frequency caps in Google Ads scripts.\u003c/p\u003e\n"],["\u003cp\u003eThe builder provides methods to set the event type (\u003ccode\u003eIMPRESSION\u003c/code\u003e or \u003ccode\u003eVIDEO_VIEW\u003c/code\u003e), the frequency limit, and the time unit (\u003ccode\u003eDAY\u003c/code\u003e, \u003ccode\u003eWEEK\u003c/code\u003e, or \u003ccode\u003eMONTH\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ebuild()\u003c/code\u003e method is used to finalize and create the frequency cap object.\u003c/p\u003e\n"],["\u003cp\u003eYou can chain the \u003ccode\u003ewithEventType\u003c/code\u003e, \u003ccode\u003ewithLimit\u003c/code\u003e, and \u003ccode\u003ewithTimeUnit\u003c/code\u003e methods to configure the frequency cap before building it.\u003c/p\u003e\n"]]],[],null,["# AdsApp.FrequencyCapBuilder\n\nBuilder for [FrequencyCap](/google-ads/scripts/docs/reference/adsapp/adsapp_frequencycap) objects.\n\n### Methods:\n\n| Member | Type | Description |\n|------------------------------------------------------|----------------------------------------------------------------------------------------------------|----------------------------------------------|\n| [build()](#build) | `void` | Builds the frequency cap. |\n| [withEventType(eventType)](#withEventType_eventType) | [AdsApp.FrequencyCapBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_frequencycapbuilder) | Set the event type to the new frequency cap. |\n| [withLimit(limit)](#withLimit_limit) | [AdsApp.FrequencyCapBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_frequencycapbuilder) | Set the cap number to the new frequency cap. |\n| [withTimeUnit(timeUnit)](#withTimeUnit_timeUnit) | [AdsApp.FrequencyCapBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_frequencycapbuilder) | Set the time unit to the new frequency cap. |\n\n`build()`\n---------\n\nBuilds the frequency cap.\n\nReturns nothing.\n\n`withEventType(eventType)`\n--------------------------\n\nSet the event type to the new frequency cap.\n\n### Arguments:\n\n| Name | Type | Description |\n|-----------|----------|--------------------------------------------------------------------------------------------------|\n| eventType | `String` | The type of event that the cap applies to. The value can be either `IMPRESSION` or `VIDEO_VIEW`. |\n\n### Return values:\n\n| Type | Description |\n|----------------------------------------------------------------------------------------------------|----------------------------------------------------------|\n| [AdsApp.FrequencyCapBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_frequencycapbuilder) | The frequency cap builder with the specified event type. |\n\n`withLimit(limit)`\n------------------\n\nSet the cap number to the new frequency cap.\n\n### Arguments:\n\n| Name | Type | Description |\n|-------|--------|-------------------------------------|\n| limit | `long` | Number of time units the cap lasts. |\n\n### Return values:\n\n| Type | Description |\n|----------------------------------------------------------------------------------------------------|----------------------------------------------------------|\n| [AdsApp.FrequencyCapBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_frequencycapbuilder) | The frequency cap builder with the specified cap number. |\n\n`withTimeUnit(timeUnit)`\n------------------------\n\nSet the time unit to the new frequency cap.\n\n### Arguments:\n\n| Name | Type | Description |\n|----------|----------|--------------------------------------------------------------------------------|\n| timeUnit | `String` | Unit of time the cap is defined at. The value can be `DAY`, `WEEK` or `MONTH`. |\n\n### Return values:\n\n| Type | Description |\n|----------------------------------------------------------------------------------------------------|---------------------------------------------------------|\n| [AdsApp.FrequencyCapBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_frequencycapbuilder) | The frequency cap builder with the specified time unit. |"]]