AdsApp.​Asset

Represents a Google Ads asset. An asset can be an image, text, or video. Assets are deduplicated within a given customer account, so assets may be shared between different ads.

Methods:

MemberTypeDescription
getDimensionsAdsApp.DimensionsReturns image dimension info if this asset is an image, or null otherwise.
getEntityTypeStringReturns the type of this entity as a String, in this case, "Asset".
getIdStringReturns the ID of the asset.
getImageUrlStringReturns the image URL if this asset is an image, or null otherwise.
getNameStringReturns the name of the asset object, or null if the asset was created without a name.
getResourceNameStringReturns the resource name of the asset.
getTextStringReturns asset text if this is a text asset, or null otherwise.
getTypeStringReturns the asset object's type.
getYouTubeVideoIdStringReturns the YouTube video ID if this asset is a YouTube video, or null otherwise.

getDimensions()

Returns image dimension info if this asset is an image, or null otherwise.

Return values:

TypeDescription
AdsApp.DimensionsImage dimension info if this asset is an image, or null otherwise.

getEntityType()

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

Return values:

TypeDescription
StringType of this entity: "Asset".

getId()

Returns the ID of the asset.

Return values:

TypeDescription
StringThe ID of the asset.

getImageUrl()

Returns the image URL if this asset is an image, or null otherwise.

Return values:

TypeDescription
StringThe image URL if this asset is an image, or null otherwise.

getName()

Returns the name of the asset object, or null if the asset was created without a name.

Return values:

TypeDescription
StringThe name of the asset object, or null if the asset was created without a name.

getResourceName()

Returns the resource name of the asset.

Return values:

TypeDescription
StringThe resource name of the asset.

getText()

Returns asset text if this is a text asset, or null otherwise.

Return values:

TypeDescription
StringAsset text if this is a text asset, or null otherwise.

getType()

Returns the asset object's type. This is one of IMAGE, MEDIA_BUNDLE, TEXT, or YOUTUBE_VIDEO.

Return values:

TypeDescription
StringThe asset type.

getYouTubeVideoId()

Returns the YouTube video ID if this asset is a YouTube video, or null otherwise.

Return values:

TypeDescription
StringThe YouTube video ID if this asset is a YouTube video, or null otherwise.