AdRequest.Builder class

Warning.

This is an archived version of the documentation. Actual documentation for all platforms can be found here.

Class for creating a targeted ad request.

Methods

Builder WithAge(string age)

Sets the user's age in the app.

Builder WithContextQuery(string contextQuery)

Sets the search query that the user entered in the app.

Builder WithContextTags(List<string> contextTags)

Sets a list of tags that describe the current user context. The list depends on which screen the user is on.

Builder WithGender(string gender)

Sets the user's gender in the app.

Builder WithLocation(Location location)

Sets the user location.

Builder WithParameters(Dictionary<string, string> parameters)

Specifies a list of additional parameters.

Builder WithAdRequest(AdRequest adRequest)

Sets the AdRequest object.

AdRequest Build()

Creates an AdRequest class object with data for a targeted ad request.

Builder WithAge(string age)

Sets the user's age in the app.

Builder WithContextQuery(string contextQuery)

Sets the search query that the user entered in the app.

Builder WithContextTags(List<string> contextTags)

Sets a list of tags that describe the current user context. The list depends on which screen the user is on.

Builder WithGender(string gender)

Sets the user's gender in the app.

Builder WithLocation(Location location)

Sets the user location.

Builder WithParameters(Dictionary<string, string> parameters)

Specifies a list of additional parameters.

Builder WithAdRequest(AdRequest adRequest)

Sets the AdRequest object.

AdRequest Build()

Creates an AdRequest class object with data for a targeted ad request.

Method description

Builder WithAge(string age)

public Builder WithAge(string age)

Sets the user's age in the app.

Parameters:
age User age.
age User age.

Returns:

An object of the AdRequest.Builder class with the specified user age.

Builder WithContextQuery(string contextQuery)

public Builder WithContextQuery(string contextQuery)

Sets the search query that the user entered in the app.

Parameters:
contextQuery The search query that the user entered in the app.
contextQuery The search query that the user entered in the app.

Returns:

An object of the AdRequest.Builder class with the specified search query.

Builder WithContextTags(List<string> contextTags)

public Builder WithContextTags(List<string> contextTags)

Sets a list of tags that describe the current user context. The list depends on which screen the user is on.

Parameters:
contextTags A list of tags produced by the app.
contextTags A list of tags produced by the app.

Returns:

An object of the AdRequest.Builder class with a list of assigned tags.

Builder WithGender(string gender)

public Builder WithGender(string gender)

Sets the user's gender in the app.

Parameters:
gender The gender of the user.
gender The gender of the user.

Returns:

An object of the AdRequest.Builder class with the specified gender.

Builder WithLocation(Location location)

public Builder WithLocation(Location location)

Sets the user location.

Parameters:
location User location.
location User location.

Returns:

An object of the AdRequest.Builder class with the specified user location.

Builder WithParameters(Dictionary<string, string> parameters)

public Builder WithParameters(Dictionary<string, string> parameters)

Specifies a list of additional parameters.

Parameters:
parameters Additional parameters.
parameters Additional parameters.

Returns:

An object of the AdRequest.Builder class with a list of additional parameters specified.

Builder WithAdRequest(AdRequest adRequest)

public Builder WithAdRequest(AdRequest adRequest)

Sets the AdRequest object.

Parameters:
adRequest An object of the AdRequest class.
adRequest An object of the AdRequest class.

Returns:

An object of the AdRequest.Builder class that was created based on the AdRequest object passed.

AdRequest Build()

public AdRequest Build()

Creates an AdRequest class object with data for a targeted ad request.

Parameters:
adRequest An object of the AdRequest class.
adRequest An object of the AdRequest class.

Returns:

An object of the AdRequest class including the data for a targeted ad request.