AdsApp.​Account

Miscellaneous information about Google Ads Accounts. When accessed by AdsApp.currentAccount(), it will provide information about the account in which the script is currently running.

Methods:

MemberTypeDescription
addCalloutAdsApp.CalloutOperationAdds a callout extension to this account.
addMobileAppAdsApp.MobileAppOperationAdds a mobile app extension to this account.
addPriceAdsApp.PriceOperationAdds a price extension to this account.
addSitelinkAdsApp.SitelinkOperationAdds a sitelink extension to this account.
addSnippetAdsApp.SnippetOperationAdds a snippet extension to this account.
extensionsAdsApp.AccountExtensionsProvides access to account-level extensions: AccountCallout, AccountMobileApp, AccountPhoneNumber, AccountSitelink, and AccountSnippet.
getCurrencyCodeStringReturns the currency code of the account.
getCustomerIdStringReturns the customer ID of the account.
getEntityTypeStringReturns the type of this entity as a String, in this case, "Account".
getNameStringReturns the name of the account.
getStatsForAdsApp.StatsReturns stats for the specified date range.
getStatsForAdsApp.StatsReturns stats for the specified custom date range.
getTimeZoneStringReturns the POSIX time zone of the account.
removeCalloutvoidRemoves a callout extension from this account.
removeMobileAppvoidRemoves a mobile app extension from this account.
removePricevoidRemoves a price extension from this account.
removeSitelinkvoidRemoves a sitelink extension from this account.
removeSnippetvoidRemoves a snippet extension from this account.

addCallout(calloutExtension)

Adds a callout extension to this account. See also Extensions.newCalloutBuilder()

Arguments:

NameTypeDescription
calloutExtensionAdsApp.CalloutThe callout to add to this account.

Return values:

TypeDescription
AdsApp.CalloutOperationThe associated callout operation.

addMobileApp(mobileAppExtension)

Adds a mobile app extension to this account. See also Extensions.newMobileAppBuilder()

Arguments:

NameTypeDescription
mobileAppExtensionAdsApp.MobileAppThe mobile app to add to this account.

Return values:

TypeDescription
AdsApp.MobileAppOperationThe associated mobile app operation.

addPrice(priceExtension)

Adds a price extension to this account. See also Extensions.newPriceBuilder().

Arguments:

NameTypeDescription
priceExtensionAdsApp.PriceThe price to add to this account.

Return values:

TypeDescription
AdsApp.PriceOperationThe associated price operation.
Adds a sitelink extension to this account. See also Extensions.newSitelinkBuilder()

Arguments:

NameTypeDescription
sitelinkExtensionAdsApp.SitelinkThe sitelink to add to this account.

Return values:

TypeDescription
AdsApp.SitelinkOperationThe associated sitelink operation.

addSnippet(snippetExtension)

Adds a snippet extension to this account. See also Extensions.newSnippetBuilder()

Arguments:

NameTypeDescription
snippetExtensionAdsApp.SnippetThe snippet to add to this account.

Return values:

TypeDescription
AdsApp.SnippetOperationThe associated snippet operation.

extensions()

Provides access to account-level extensions: AccountCallout, AccountMobileApp, AccountPhoneNumber, AccountSitelink, and AccountSnippet.

Return values:

TypeDescription
AdsApp.AccountExtensionsAccess to account-level extensions.

getCurrencyCode()

Returns the currency code of the account. The returned values are in the three-letter ISO 4217 format, e.g. 'USD', 'CAD', 'JPY', etc.

Please refer to Google Ads API Currency Codes for the full list of possible return values.

Return values:

TypeDescription
StringThe currency code of the account.

getCustomerId()

Returns the customer ID of the account.

The returned value is in the standard Google Ads format, e.g. '123-456-7890'.

Return values:

TypeDescription
StringThe customer ID of the account.

getEntityType()

Returns the type of this entity as a String, in this case, "Account".

Return values:

TypeDescription
StringType of this entity: "Account".

getName()

Returns the name of the account.

Return values:

TypeDescription
StringThe account descriptive name, or null if one doesn't exist.

getStatsFor(dateRange)

Returns stats for the specified date range. Supported values:

TODAY, YESTERDAY, LAST_7_DAYS, THIS_WEEK_SUN_TODAY, LAST_WEEK, LAST_14_DAYS, LAST_30_DAYS, LAST_BUSINESS_WEEK, LAST_WEEK_SUN_SAT, THIS_MONTH, LAST_MONTH, ALL_TIME.

Example:

var stats = account.getStatsFor("THIS_MONTH");

Arguments:

NameTypeDescription
dateRangeStringDate range for which the stats are requested.

Return values:

TypeDescription
AdsApp.StatsThe stats for the specified date range.

getStatsFor(dateFrom, dateTo)

Returns stats for the specified custom date range. Both parameters can be either an object containing year, month, and day fields, or an 8-digit string in YYYYMMDD form. For instance, March 24th, 2013 is represented as either {year: 2013, month: 3, day: 24} or "20130324". The date range is inclusive on both ends, so forDateRange("20130324", "20130324") defines a range of a single day.

Arguments:

NameTypeDescription
dateFromObjectStart date of the date range. Must be either a string in YYYYMMDD form, or an object with year, month and day properties.
dateToObjectEnd date of the date range. Must be either a string in YYYYMMDD form, or an object with year, month and day properties.

Return values:

TypeDescription
AdsApp.StatsThe stats for the specified date range.

getTimeZone()

Returns the POSIX time zone of the account.

Returned values are in the standard time zone identifier form, such as 'America/Los_Angeles'.

Please refer to Google Ads API Timezones for the full list of possible return values.

Return values:

TypeDescription
StringThe time zone of the account.

removeCallout(calloutExtension)

Removes a callout extension from this account.

Returns nothing.

Arguments:

NameTypeDescription
calloutExtensionAdsApp.CalloutThe callout to remove from this account.

removeMobileApp(mobileAppExtension)

Removes a mobile app extension from this account.

Returns nothing.

Arguments:

NameTypeDescription
mobileAppExtensionAdsApp.MobileAppThe mobile app to remove from this account.

removePrice(priceExtension)

Removes a price extension from this account.

Returns nothing.

Arguments:

NameTypeDescription
priceExtensionAdsApp.PriceThe price to remove from this account.
Removes a sitelink extension from this account.

Returns nothing.

Arguments:

NameTypeDescription
sitelinkExtensionAdsApp.SitelinkThe sitelink to remove from this account.

removeSnippet(snippetExtension)

Removes a snippet extension from this account.

Returns nothing.

Arguments:

NameTypeDescription
snippetExtensionAdsApp.SnippetThe snippet to remove from this account.