Windows apps
Collapse the table of content
Expand the table of content

AdScheduler.requestSchedule method

Requests an ad schedule from the server and insert it into a MediaPlayer timeline (if MediaPlayer was provided).

Syntax


var winJS.Promise = adScheduler.requestSchedule(applicationId, adUnitID, adTags);

Parameters

applicationId

Type: String

The application ID of the app. This value is available in the Windows Dev Center dashboard.

adUnitID

Type: String

The ad unit ID to use. This value is available in the Windows Dev Center dashboard.

adTags

Type: String

Name/value pairs which will be appended to the request URL. This parameter is optional. See the remarks for more information.

Return value

Type: WinJS.Promise

Promise object that completes when the schedule has been received.

Remarks

Applications should wait for requestSchedule to return before starting to play the primary video content in the MediaPlayer. Starting to play media before requestSchedule returns (in the case of a pre-roll advertisement) will result in the pre-roll interrupting the primary video content.

The optional adTags parameter is a JSON collection of name/value pairs that can be used for apps that have advanced targeting beyond the required publisher and adUnit codes.

For example, an app that may play a variety of auto related videos may supplement the adUnitId with the make and model of the car being shown:


var myAdTags = {
  "make":"ford",
  "model":"fusion"
};

myAdScheduler.requestSchedule("publisherid", "adunitid", myAdTags)

The following items should be noted when referring to adTags:

  • This parameter is a very rarely used option. The publisher must work closely with Microsoft before using adTags.
  • Both the names and the values must be predetermined on the advertisement service. Ad tags are not open ended search terms or keywords.
  • The maximum supported number of tags is 10.
  • Tag names are restricted to 16 characters.
  • Tag values have a maximum of 128 characters.

Requirements

Minimum supported client

Windows 10

Minimum supported server

None supported

Minimum supported phone

Windows 10 Mobile

Namespace

MicrosoftNSJS.Advertising

Metadata

Ad.js

See also

AdScheduler

 

 

Show:
© 2017 Microsoft