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
getDimensions AdsApp.Dimensions Returns image dimension info if this asset is an image, or null otherwise.
getEntityType String Returns the type of this entity as a String, in this case, "Asset".
getId String Returns the ID of the asset.
getImageUrl String Returns the image URL if this asset is an image, or null otherwise.
getName String Returns the name of the asset object, or null if the asset was created without a name.
getResourceName String Returns the resource name of the asset.
getText String Returns asset text if this is a text asset, or null otherwise.
getType String Returns the asset object's type.
getYouTubeVideoId String Returns 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.Dimensions Image 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
String Type of this entity: "Asset".

getId()

Returns the ID of the asset.

Return values:

TypeDescription
String The ID of the asset.

getImageUrl()

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

Return values:

TypeDescription
String The 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
String The 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
String The resource name of the asset.

getText()

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

Return values:

TypeDescription
String Asset 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
String The asset type.

getYouTubeVideoId()

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

Return values:

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