Reference documentation and code samples for the Google Cloud Retail V2 Client class Audience.
An intended audience of the Product for
whom it's sold.
Generated from protobuf message google.cloud.retail.v2.Audience
Namespace
Google \ Cloud \ Retail \ V2
Methods
__construct
Constructor.
Parameters
Name
Description
data
array
Optional. Data for populating the Message object.
↳ genders
array
The genders of the audience. Strongly encouraged to use the standard values: "male", "female", "unisex". At most 5 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Google Merchant Center property gender. Schema.org property Product.audience.suggestedGender.
↳ age_groups
array
The age groups of the audience. Strongly encouraged to use the standard values: "newborn" (up to 3 months old), "infant" (3–12 months old), "toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically teens or older). At most 5 values are allowed. Each value must be a UTF-8 encoded string with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error is returned. Google Merchant Center property age_group. Schema.org property Product.audience.suggestedMinAge and Product.audience.suggestedMaxAge.
getGenders
The genders of the audience. Strongly encouraged to use the standard
values: "male", "female", "unisex".
At most 5 values are allowed. Each value must be a UTF-8 encoded string
with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
is returned.
Google Merchant Center property
gender. Schema.org
property
Product.audience.suggestedGender.
The genders of the audience. Strongly encouraged to use the standard
values: "male", "female", "unisex".
At most 5 values are allowed. Each value must be a UTF-8 encoded string
with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
is returned.
Google Merchant Center property
gender. Schema.org
property
Product.audience.suggestedGender.
Parameter
Name
Description
var
string[]
Returns
Type
Description
$this
getAgeGroups
The age groups of the audience. Strongly encouraged to use the standard
values: "newborn" (up to 3 months old), "infant" (3–12 months old),
"toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
teens or older).
At most 5 values are allowed. Each value must be a UTF-8 encoded string
with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
is returned.
Google Merchant Center property
age_group.
Schema.org property
Product.audience.suggestedMinAge and
Product.audience.suggestedMaxAge.
The age groups of the audience. Strongly encouraged to use the standard
values: "newborn" (up to 3 months old), "infant" (3–12 months old),
"toddler" (1–5 years old), "kids" (5–13 years old), "adult" (typically
teens or older).
At most 5 values are allowed. Each value must be a UTF-8 encoded string
with a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error
is returned.
Google Merchant Center property
age_group.
Schema.org property
Product.audience.suggestedMinAge and
Product.audience.suggestedMaxAge.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Google Cloud Retail V2 Client - Class Audience (2.3.1)\n\nVersion latestkeyboard_arrow_down\n\n- [2.3.1 (latest)](/php/docs/reference/cloud-retail/latest/V2.Audience)\n- [2.3.0](/php/docs/reference/cloud-retail/2.3.0/V2.Audience)\n- [2.2.1](/php/docs/reference/cloud-retail/2.2.1/V2.Audience)\n- [2.1.3](/php/docs/reference/cloud-retail/2.1.3/V2.Audience)\n- [2.0.0](/php/docs/reference/cloud-retail/2.0.0/V2.Audience)\n- [1.7.0](/php/docs/reference/cloud-retail/1.7.0/V2.Audience)\n- [1.6.4](/php/docs/reference/cloud-retail/1.6.4/V2.Audience)\n- [1.5.0](/php/docs/reference/cloud-retail/1.5.0/V2.Audience)\n- [1.4.2](/php/docs/reference/cloud-retail/1.4.2/V2.Audience)\n- [1.3.1](/php/docs/reference/cloud-retail/1.3.1/V2.Audience)\n- [1.2.1](/php/docs/reference/cloud-retail/1.2.1/V2.Audience)\n- [1.1.1](/php/docs/reference/cloud-retail/1.1.1/V2.Audience)\n- [1.0.1](/php/docs/reference/cloud-retail/1.0.1/V2.Audience) \nReference documentation and code samples for the Google Cloud Retail V2 Client class Audience.\n\nAn intended audience of the [Product](/php/docs/reference/cloud-retail/latest/V2.Product) for\nwhom it's sold.\n\nGenerated from protobuf message `google.cloud.retail.v2.Audience`\n\nNamespace\n---------\n\nGoogle \\\\ Cloud \\\\ Retail \\\\ V2\n\nMethods\n-------\n\n### __construct\n\nConstructor.\n\n### getGenders\n\nThe genders of the audience. Strongly encouraged to use the standard\nvalues: \"male\", \"female\", \"unisex\".\n\nAt most 5 values are allowed. Each value must be a UTF-8 encoded string\nwith a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error\nis returned.\nGoogle Merchant Center property\n[gender](https://support.google.com/merchants/answer/6324479). Schema.org\nproperty\n[Product.audience.suggestedGender](https://schema.org/suggestedGender).\n\n### setGenders\n\nThe genders of the audience. Strongly encouraged to use the standard\nvalues: \"male\", \"female\", \"unisex\".\n\nAt most 5 values are allowed. Each value must be a UTF-8 encoded string\nwith a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error\nis returned.\nGoogle Merchant Center property\n[gender](https://support.google.com/merchants/answer/6324479). Schema.org\nproperty\n[Product.audience.suggestedGender](https://schema.org/suggestedGender).\n\n### getAgeGroups\n\nThe age groups of the audience. Strongly encouraged to use the standard\nvalues: \"newborn\" (up to 3 months old), \"infant\" (3--12 months old),\n\"toddler\" (1--5 years old), \"kids\" (5--13 years old), \"adult\" (typically\nteens or older).\n\nAt most 5 values are allowed. Each value must be a UTF-8 encoded string\nwith a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error\nis returned.\nGoogle Merchant Center property\n[age_group](https://support.google.com/merchants/answer/6324463).\nSchema.org property\n[Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and\n[Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge).\n\n### setAgeGroups\n\nThe age groups of the audience. Strongly encouraged to use the standard\nvalues: \"newborn\" (up to 3 months old), \"infant\" (3--12 months old),\n\"toddler\" (1--5 years old), \"kids\" (5--13 years old), \"adult\" (typically\nteens or older).\n\nAt most 5 values are allowed. Each value must be a UTF-8 encoded string\nwith a length limit of 128 characters. Otherwise, an INVALID_ARGUMENT error\nis returned.\nGoogle Merchant Center property\n[age_group](https://support.google.com/merchants/answer/6324463).\nSchema.org property\n[Product.audience.suggestedMinAge](https://schema.org/suggestedMinAge) and\n[Product.audience.suggestedMaxAge](https://schema.org/suggestedMaxAge)."]]