Stay organized with collections
Save and categorize content based on your preferences.
AI-generated Key Takeaways
The MobileAppBuilder facilitates the creation and configuration of mobile app extension objects in Google Ads scripts.
It provides methods to set crucial details like app ID, store, link text, final URLs, and scheduling, ensuring comprehensive app information is included in ads.
By using the build() method, a MobileAppOperation is generated, which is then used to retrieve the newly created MobileApp object or handle any errors encountered during the process.
The builder streamlines the process by offering a fluent interface, where methods can be chained together for concise and readable code.
Through this builder, advertisers gain granular control over their mobile app extensions, optimizing their ad campaigns for better user engagement and app downloads.
Sets the tracking template of the new mobile app to the specified
value.
build(buildLegacy)
Creates a MobileApp.
Returns a MobileAppOperation
that can be used to get the new mobile app (or access any
associated errors if creation failed).
Defaults to building the type of mobile app that is currently
serving. If there are upgraded mobile apps, then an upgraded
mobile app will be built by default. If there are only legacy
mobile apps, then a legacy mobile app will be built
by default. If there are neither, then an upgraded mobile app will
be built by default.
Arguments:
Name
Type
Description
buildLegacy
boolean
If true, builds a legacy mobile app. If false, builds an upgraded mobile app. If
unspecified, defaults to building whichever type is currently serving.
Sets the custom parameters of the new mobile app to the specified
value.
Custom parameters enable you to create your
own ValueTrack
parameters that you can assign your own IDs to.
The name of a custom parameter can contain only alphanumeric characters,
and custom parameter values may not contain white space. When referring to
the custom parameter in final URLs and tracking template, you should
surround the custom parameter in braces, and prefix an underscore to its
name, e.g. {_param}.
You can have up to 8 custom parameters for an entity. The key and value
must not exceed 16 and 200 bytes respectively.
Custom parameters specified at a lower level entity will override the
setting specified at a higher level entity, e.g., setting custom parameters
at the ad group level overrides the setting at the campaign level, and
custom parameters specified at the ad level override the setting at the ad
group level.
The mobile app builder with the specified custom
parameters.
withEndDate(date)
Sets the mobile app's end date from either an object containing
year, month, and day fields, or an 8-digit string in YYYYMMDD
format. This field is optional.
For instance, mobileAppBuilder.withEndDate("20130503"); is equivalent to mobileAppBuilder.withEndDate({year: 2013, month: 5, day: 3});.
The change will fail and report an error if:
the given date is invalid (e.g.,
{year: 2013, month: 5, day: 55}),
Sets the final URL of the new mobile app to the specified value.
The final URL represents the actual landing page for your mobile app. The final URL must be the URL of the page that the user
ends up on after clicking on your ad, once all the redirects have taken
place.
A mobile app builder with the specified link text.
withMobileFinalUrl(mobileFinalUrl)
Sets the mobile final URL of the new mobile app to the specified
value.
The mobile final URL represents the actual landing page for your mobile app on a mobile device. The final mobile URL must be the URL of
the page that the user ends up on after clicking on your ad on a mobile
device, once all the redirects have taken place.
The mobile app builder with the specified final URL.
withMobilePreferred(isMobilePreferred)
Sets the mobile app's device preference to mobile or clears it.
This field is optional and defaults to false.
Arguments:
Name
Type
Description
isMobilePreferred
boolean
Whether or not this mobile app should be
mobile preferred. If true is passed in, device preference
will be set to mobile. If false is passed in, device
preference will be set to none.
A mobile app builder with the specified mobile preference.
withSchedules(schedules)
Sets the mobile app scheduling. Scheduling of a mobile app allows you to control the days of week and times of day during which
the mobile app will show alongside your ads.
Passing in an empty array clears the scheduling field, causing the mobile app to run at all times.
The following example sets the mobile app to run on Mondays and
Tuesday from 8:00 to 11:00.
A mobile app builder with the specified schedules.
withStartDate(date)
Sets the mobile app's start date from either an object containing
year, month, and day fields, or an 8-digit string in YYYYMMDD
format. This field is optional.
For instance, mobileAppBuilder.withStartDate("20130503"); is equivalent to mobileAppBuilder.withStartDate({year: 2013, month: 5, day: 3});.
The change will fail and report an error if:
the given date is invalid (e.g.,
{year: 2013, month: 5, day: 55}),
the given date is after the mobile app's end date,
A mobile app builder with the specified application store.
withTrackingTemplate(trackingTemplate)
Sets the tracking template of the new mobile app to the specified
value.
You can optionally use the tracking template to specify additional
tracking parameters or redirects. Google Ads will use this template to
assemble the actual destination URL to associate with the ad.
A tracking template specified at a lower level entity will override the
setting specified at a higher level entity, e.g., a tracking template set
at the ad group level overrides the setting at the campaign level, and a
tracking template specified at the ad level overrides the setting at the ad
group level.
See Using
Upgraded URLs for more information.
If tracking template is not set, then tracking template will default to
"{lpurl}" (no tracking).
[[["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-23 UTC."],[],[]]