AdsApp.MediaBundleAssetBuilder
Stay organized with collections
Save and categorize content based on your preferences.
Builds new media bundle assets.
Typical usage:
var assetBundleUrl = "http://www.example.com/example.zip";
var assetBundleBlob = UrlFetchApp.fetch(assetBundleUrl).getBlob();
var assetOperation = AdsApp.adAssets().newMediaBundleAssetBuilder()
.withName("name")
.withData(assetBundleBlob)
.build();
var bundleAsset = assetOperation.getResult();
Methods:
build()
Creates a bundle asset. Returns an
AssetOperation
that can be
used to get the new bundle asset (or access any associated errors if the
creation failed).
Return values:
withData(data)
Sets new bundle asset's data to the specified value. This field is
required.
Arguments:
Name | Type | Description |
data |
Blob.Blob |
The data for the asset bundle. |
Return values:
withName(name)
Sets new bundle asset's name to the specified value. This field is
required.
Arguments:
Name | Type | Description |
name |
String |
The name for the asset bundle. |
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-08-25 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-08-25 UTC."],[[["\u003cp\u003eCreates new media bundle assets to be used in Google Ads.\u003c/p\u003e\n"],["\u003cp\u003eRequires providing a name and the asset bundle data (as a Blob) for creation.\u003c/p\u003e\n"],["\u003cp\u003eUses a builder pattern to construct the asset with \u003ccode\u003ewithName\u003c/code\u003e and \u003ccode\u003ewithData\u003c/code\u003e methods.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003ebuild\u003c/code\u003e method initiates the asset creation and returns an \u003ccode\u003eAssetOperation\u003c/code\u003e to access the result.\u003c/p\u003e\n"]]],[],null,["# AdsApp.MediaBundleAssetBuilder\n\nBuilds new media bundle assets.\n\nTypical usage:\n\n```gdscript\nvar assetBundleUrl = \"http://www.example.com/example.zip\";\nvar assetBundleBlob = UrlFetchApp.fetch(assetBundleUrl).getBlob();\nvar assetOperation = AdsApp.adAssets().newMediaBundleAssetBuilder()\n .withName(\"name\")\n .withData(assetBundleBlob)\n .build();\nvar bundleAsset = assetOperation.getResult();\n```\n\n### Methods:\n\n| Member | Type | Description |\n|----------------------------------|------------------------------------------------------------------------------------------------------------|------------------------------------------------------|\n| [build()](#build) | [AdsApp.AssetOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_assetoperation) | Creates a bundle asset. |\n| [withData(data)](#withData_data) | [AdsApp.MediaBundleAssetBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_mediabundleassetbuilder) | Sets new bundle asset's data to the specified value. |\n| [withName(name)](#withName_name) | [AdsApp.MediaBundleAssetBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_mediabundleassetbuilder) | Sets new bundle asset's name to the specified value. |\n\n`build()`\n---------\n\nCreates a bundle asset. Returns an `AssetOperation` that can be used to get the new bundle asset (or access any associated errors if the creation failed).\n\n### Return values:\n\n| Type | Description |\n|------------------------------------------------------------------------------------------|----------------------|\n| [AdsApp.AssetOperation](/google-ads/scripts/docs/reference/adsapp/adsapp_assetoperation) | The asset operation. |\n\n`withData(data)`\n----------------\n\nSets new bundle asset's data to the specified value. This field is required.\n\n### Arguments:\n\n| Name | Type | Description |\n|------|----------------------------------------------------------------------------|--------------------------------|\n| data | [Blob.Blob](https://developers.google.com/apps-script/reference/base/blob) | The data for the asset bundle. |\n\n### Return values:\n\n| Type | Description |\n|------------------------------------------------------------------------------------------------------------|---------------------------------------------------|\n| [AdsApp.MediaBundleAssetBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_mediabundleassetbuilder) | The asset bundle builder with the specified data. |\n\n`withName(name)`\n----------------\n\nSets new bundle asset's name to the specified value. This field is required.\n\n### Arguments:\n\n| Name | Type | Description |\n|------|----------|--------------------------------|\n| name | `String` | The name for the asset bundle. |\n\n### Return values:\n\n| Type | Description |\n|------------------------------------------------------------------------------------------------------------|---------------------------------------------------|\n| [AdsApp.MediaBundleAssetBuilder](/google-ads/scripts/docs/reference/adsapp/adsapp_mediabundleassetbuilder) | The asset bundle builder with the specified name. |"]]