Page Summary
-
AdsApp.adParams() fetches ad parameters and does not support filtering or sorting directly, although it offers methods for ordering, conditions, and limits.
-
The
get()method fetches requested ad params and returns an AdParamIterator. -
The
orderBy()method specifies the ordering of the resulting entities based on parameter index or insertion text. -
The
withCondition()method adds conditions to the selector to narrow down results, with multiple conditions being AND-ed together. -
The
withLimit()method specifies the maximum number of entities to return.
Typical usage:
var adParamSelector = AdsApp . adParams (); var adParamIterator = adParamSelector . get (); while ( adParamIterator . hasNext ()) { var adParam = adParamIterator . next (); }
Methods:
| Member | Type | Description |
|---|---|---|
AdsApp.AdParamIterator
|
Fetches the requested ad params and returns an iterator. | |
AdsApp.AdParamSelector
|
Specifies the ordering of the resulting entities. | |
AdsApp.AdParamSelector
|
Adds the specified condition to the selector in order to narrow down the results. | |
AdsApp.AdParamSelector
|
Specifies limit for the selector to use. |
get()
Fetches the requested ad params and returns an iterator. Return values:
| Type | Description |
|---|---|
AdsApp.AdParamIterator
|
Iterator of the requested ad params. |
orderBy(orderBy)
Specifies the ordering of the resulting entities. The orderBy
parameter can have one of the following forms: -
orderBy("ad_parameter.parameter_index")- orders results by index, in ascending order. -
orderBy("ad_parameter.parameter_index ASC")- orders results by index, in ascending order. -
orderBy("ad_parameter.insertion_text DESC")- orders results by insertion text, in descending order.
Arguments:
| Name | Type | Description |
|---|---|---|
|
orderBy
|
String
|
Ordering to apply. |
Return values:
| Type | Description |
|---|---|
AdsApp.AdParamSelector
|
The selector with ordering applied. |
withCondition(condition)
Adds the specified condition to the selector in order to narrow down the
results. Multiple conditions can be added to the same selector:
selector = selector
.withCondition("ad_parameter.parameter_index = 1")
.withCondition("ad_parameter.insertion_text = '$99'");
AND
-ed together. The above
example will retrieve ad params whose index is 1 and insertion text is
'$99'. The condition passed into this method must be of the following form:
"COLUMN_NAME OPERATOR VALUE"
Arguments:
| Name | Type | Description |
|---|---|---|
|
condition
|
String
|
Condition to add to the selector. |
Return values:
| Type | Description |
|---|---|
AdsApp.AdParamSelector
|
The selector with the condition applied. |
withLimit(limit)
Specifies limit for the selector to use. For instance, withLimit(50)
returns only the first 50 entities. Arguments:
| Name | Type | Description |
|---|---|---|
|
limit
|
int
|
How many entities to return. |
Return values:
| Type | Description |
|---|---|
AdsApp.AdParamSelector
|
The selector with limit applied. |

