AdWordsApp.​MobileAppBuilder

Builder for MobileApp objects.

Example usage:

 // Create a mobile app builder.
 var mobileAppBuilder = AdWordsApp.extensions().newMobileAppBuilder();

 // Create a mobile app operation.
 var mobileAppOperation = mobileAppBuilder
   .withAppId("store specific app id")                 // required
   .withStore("Android")                               // required
   .withLinkText("Download Android App Here")          // required
   .withFinalUrl("http://wwww.example.com/androidApp") // required
   .withStartDate({day: 12, month: 9, year: 2013})     // optional
   .build();

 // Optional: examine the outcome. The call to isSuccessful()
 // will block until the operation completes.
 if (mobileAppOperation.isSuccessful()) {
   // Get the result.
   var mobileApp = mobileAppOperation.getResult();
 } else {
   // Handle the errors.
   var errors = mobileAppOperation.getErrors();
 }

Methods:

MemberTypeDescription
build AdWordsApp.MobileAppOperation Creates a MobileApp.
withAppId AdWordsApp.MobileAppBuilder Sets the mobile app's app ID.
withCustomParameters AdWordsApp.MobileAppBuilder Sets the custom parameters of the new mobile app to the specified value.
withEndDate AdWordsApp.MobileAppBuilder 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.
withFinalUrl AdWordsApp.MobileAppBuilder Sets the final URL of the new mobile app to the specified value.
withLinkText AdWordsApp.MobileAppBuilder Sets the link text of the mobile app.
withMobileFinalUrl AdWordsApp.MobileAppBuilder Sets the mobile final URL of the new mobile app to the specified value.
withMobilePreferred AdWordsApp.MobileAppBuilder Sets the mobile app's device preference to mobile or clears it.
withSchedules AdWordsApp.MobileAppBuilder Sets the mobile app scheduling.
withStartDate AdWordsApp.MobileAppBuilder 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.
withStore AdWordsApp.MobileAppBuilder Sets the application store that this application belongs to.
withTrackingTemplate AdWordsApp.MobileAppBuilder Sets the tracking template of the new mobile app to the specified value.

build()

Creates a MobileApp. Returns a MobileAppOperation that can be used to get the new mobile app (or access any associated errors if creation failed).

Return values:

TypeDescription
AdWordsApp.MobileAppOperation The associated mobile app operation.

withAppId(appId)

Sets the mobile app's app ID. Takes a string representing the store-specific ID for the target application. This field is required.

Arguments:

NameTypeDescription
appId String The mobile app's app ID.

Return values:

TypeDescription
AdWordsApp.MobileAppBuilder A mobile app builder with the specified app ID.

withCustomParameters(customParameters)

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 3 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 and custom parameters specified at the ad level override the setting at the ad group level.

See Using Upgraded URLs for more information.

Arguments:

NameTypeDescription
customParameters Object The custom parameters of the mobile app as a map of the following form: {key1: 'value1', key2: 'value2', key3: 'value3'}.

Return values:

TypeDescription
AdWordsApp.MobileAppBuilder 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}),
  • the start date now comes after the end date, or
  • it's a date in the past

Arguments:

NameTypeDescription
date Object The new mobile app end date.

Return values:

TypeDescription
AdWordsApp.MobileAppBuilder A mobile app builder with the specified end date.

withFinalUrl(finalUrl)

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.

See Using Upgraded URLs for more information.

Final URLs are required.

Arguments:

NameTypeDescription
finalUrl String The final URL for the mobile app.

Return values:

TypeDescription
AdWordsApp.MobileAppBuilder The mobile app builder with the specified final URL.

withLinkText(linkText)

Sets the link text of the mobile app. This field is required.

Arguments:

NameTypeDescription
linkText String The link text.

Return values:

TypeDescription
AdWordsApp.MobileAppBuilder 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.

See Using Upgraded URLs for more information.

Arguments:

NameTypeDescription
mobileFinalUrl String The mobile final URL for the mobile app.

Return values:

TypeDescription
AdWordsApp.MobileAppBuilder 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:

NameTypeDescription
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.

Return values:

TypeDescription
AdWordsApp.MobileAppBuilder 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.

  var mondayMorning = {
    dayOfWeek: "MONDAY",
    startHour: 8,
    startMinute: 0,
    endHour: 11,
    endMinute: 0
  };
  var tuesdayMorning = {
    dayOfWeek: "TUESDAY",
    startHour: 8,
    startMinute: 0,
    endHour: 11,
    endMinute: 0
  };

  mobileAppBuilder.withSchedules([mondayMorning, tuesdayMorning]);

Arguments:

NameTypeDescription
schedules AdWordsApp.ExtensionSchedule[] The new mobile app schedules.

Return values:

TypeDescription
AdWordsApp.MobileAppBuilder 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,

Arguments:

NameTypeDescription
date Object The new mobile app start date.

Return values:

TypeDescription
AdWordsApp.MobileAppBuilder A mobile app builder with the specified start date.

withStore(store)

Sets the application store that this application belongs to. This accepts either "iOS" or "Android". This field is required.

Arguments:

NameTypeDescription
store String The application store, "iOS" or "Android".

Return values:

TypeDescription
AdWordsApp.MobileAppBuilder 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. AdWords 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).

Arguments:

NameTypeDescription
trackingTemplate String The tracking template for the mobile app.

Return values:

TypeDescription
AdWordsApp.MobileAppBuilder The mobile app builder with the specified tracking template.

Feedback geben zu...

AdWords Scripts
AdWords Scripts