AdsApp.Asset
Stay organized with collections
Save and categorize content based on your preferences.
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:
getDimensions()
Returns image dimension info if this asset is an image, or null
otherwise. Return values:
getEntityType()
Returns the type of this entity as a String
, in this case, "Asset"
. Return values:
getId()
Returns the ID of the asset. Return values:
getImageUrl()
Returns the image URL if this asset is an image, or null
otherwise. Return values:
getName()
Returns the name of the asset object, or null
if the asset was
created without a name. Return values:
getResourceName()
Returns the resource name of the asset. Return values:
getText()
Returns asset text if this is a text asset, or null
otherwise. Return values:
getType()
Returns the asset object's type. This is one of IMAGE
, MEDIA_BUNDLE
, TEXT
, or YOUTUBE_VIDEO
. Return values:
getYouTubeVideoId()
Returns the YouTube video ID if this asset is a YouTube video, or null
otherwise. 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\u003eRepresents a Google Ads asset, which can be an image, text, or video, used within ads.\u003c/p\u003e\n"],["\u003cp\u003eAssets are deduplicated within a customer account and can be shared across different ads.\u003c/p\u003e\n"],["\u003cp\u003eProvides methods to access asset properties like ID, name, type, and content (text, image URL, YouTube video ID).\u003c/p\u003e\n"],["\u003cp\u003eOffers specific methods like \u003ccode\u003egetDimensions()\u003c/code\u003e for image assets and \u003ccode\u003egetText()\u003c/code\u003e for text assets to retrieve their respective data.\u003c/p\u003e\n"]]],[],null,["# AdsApp.Asset\n\nRepresents 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.\n\n### Methods:\n\n| Member | Type | Description |\n|-------------------------------------------|----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------|\n| [getDimensions()](#getDimensions) | [AdsApp.Dimensions](/google-ads/scripts/docs/reference/adsapp/adsapp_dimensions) | Returns image dimension info if this asset is an image, or `null` otherwise. |\n| [getEntityType()](#getEntityType) | `String` | Returns the type of this entity as a `String`, in this case, `\"Asset\"`. |\n| [getId()](#getId) | `String` | Returns the ID of the asset. |\n| [getImageUrl()](#getImageUrl) | `String` | Returns the image URL if this asset is an image, or `null` otherwise. |\n| [getName()](#getName) | `String` | Returns the name of the asset object, or `null` if the asset was created without a name. |\n| [getResourceName()](#getResourceName) | `String` | Returns the resource name of the asset. |\n| [getText()](#getText) | `String` | Returns asset text if this is a text asset, or `null` otherwise. |\n| [getType()](#getType) | `String` | Returns the asset object's type. |\n| [getYouTubeVideoId()](#getYouTubeVideoId) | `String` | Returns the YouTube video ID if this asset is a YouTube video, or `null` otherwise. |\n\n`getDimensions()`\n-----------------\n\nReturns image dimension info if this asset is an image, or `null` otherwise.\n\n### Return values:\n\n| Type | Description |\n|----------------------------------------------------------------------------------|----------------------------------------------------------------------|\n| [AdsApp.Dimensions](/google-ads/scripts/docs/reference/adsapp/adsapp_dimensions) | Image dimension info if this asset is an image, or `null` otherwise. |\n\n`getEntityType()`\n-----------------\n\nReturns the type of this entity as a `String`, in this case, `\"Asset\"`.\n\n### Return values:\n\n| Type | Description |\n|----------|---------------------------------|\n| `String` | Type of this entity: `\"Asset\"`. |\n\n`getId()`\n---------\n\nReturns the ID of the asset.\n\n### Return values:\n\n| Type | Description |\n|----------|----------------------|\n| `String` | The ID of the asset. |\n\n`getImageUrl()`\n---------------\n\nReturns the image URL if this asset is an image, or `null` otherwise.\n\n### Return values:\n\n| Type | Description |\n|----------|---------------------------------------------------------------|\n| `String` | The image URL if this asset is an image, or `null` otherwise. |\n\n`getName()`\n-----------\n\nReturns the name of the asset object, or `null` if the asset was created without a name.\n\n### Return values:\n\n| Type | Description |\n|----------|----------------------------------------------------------------------------------|\n| `String` | The name of the asset object, or `null` if the asset was created without a name. |\n\n`getResourceName()`\n-------------------\n\nReturns the resource name of the asset.\n\n### Return values:\n\n| Type | Description |\n|----------|---------------------------------|\n| `String` | The resource name of the asset. |\n\n`getText()`\n-----------\n\nReturns asset text if this is a text asset, or `null` otherwise.\n\n### Return values:\n\n| Type | Description |\n|----------|----------------------------------------------------------|\n| `String` | Asset text if this is a text asset, or `null` otherwise. |\n\n`getType()`\n-----------\n\nReturns the asset object's type. This is one of `IMAGE`, `MEDIA_BUNDLE`, `TEXT`, or `YOUTUBE_VIDEO`.\n\n### Return values:\n\n| Type | Description |\n|----------|-----------------|\n| `String` | The asset type. |\n\n`getYouTubeVideoId()`\n---------------------\n\nReturns the YouTube video ID if this asset is a YouTube video, or `null` otherwise.\n\n### Return values:\n\n| Type | Description |\n|----------|-----------------------------------------------------------------------------|\n| `String` | The YouTube video ID if this asset is a YouTube video, or `null` otherwise. |"]]