Method: recommendations.generate

Generates recommendations for a merchant.

HTTP request

GET https://shoppingcontent.googleapis.com/content/v2.1/{merchantId}/recommendations/generate

Path parameters

Parameters
merchantId

string (int64 format)

Required. The ID of the account to fetch recommendations for.

Query parameters

Parameters
languageCode

string

Optional. Language code of the client. If not set, the result will be in default language (English). This language code affects all fields prefixed with "localized". This should be set to ISO 639-1 country code. List of currently verified supported language code: en, fr, cs, da, de, es, it, nl, no, pl, pt, pt, fi, sv, vi, tr, th, ko, zh-CN, zh-TW, ja, id, hi

allowedTag[]

string

Optional. List of allowed tags. Tags are a set of predefined strings that describe the category that individual recommendation types belong to. User can specify zero or more tags in this field to indicate what categories of recommendations they want to receive. Current list of supported tags: - TREND

Request body

The request body must be empty.

Response body

Response containing generated recommendations.

If successful, the response body contains data with the following structure:

JSON representation
{
  "recommendations": [
    {
      object (Recommendation)
    }
  ],
  "responseToken": string
}
Fields
recommendations[]

object (Recommendation)

Recommendations generated for a request.

responseToken

string

Output only. Response token is a string created for each GenerateRecommendationsResponse. This token doesn't expire, and is globally unique. This token must be used when reporting interactions for recommendations.

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/content

For more information, see the OAuth 2.0 Overview.

Recommendation

Recommendations are suggested ways to improve your merchant account's performance. For example, to engage with a feature, or start using a new Google product.

JSON representation
{
  "type": string,
  "additionalDescriptions": [
    {
      object (Description)
    }
  ],
  "defaultCallToAction": {
    object (CallToAction)
  },
  "additionalCallToAction": [
    {
      object (CallToAction)
    }
  ],
  "creative": [
    {
      object (Creative)
    }
  ],
  "subType": string,
  "recommendationName": string,
  "title": string,
  "defaultDescription": string,
  "paid": boolean,
  "numericalImpact": integer
}
Fields
type

string

Output only. Type of the recommendation. List of currently available recommendation types: - OPPORTUNITY_CREATE_NEW_COLLECTION - OPPORTUNITY_CREATE_EMAIL_CAMPAIGN

additionalDescriptions[]

object (Description)

Output only. List of additional localized descriptions for a recommendation. Localication uses the languageCode field in recommendations.generate requests. Not all description types are guaranteed to be present and we recommend to rely on default description.

defaultCallToAction

object (CallToAction)

Optional. Default CTA of the recommendation.

additionalCallToAction[]

object (CallToAction)

Output only. CTAs of this recommendation. Repeated.

creative[]

object (Creative)

Output only. Any creatives attached to the recommendation. Repeated.

subType

string

Optional. Subtype of the recommendations. Only applicable when multiple recommendations can be generated per type, and is used as an identifier of recommendation under the same recommendation type.

recommendationName

string

Optional. Localized recommendation name. The localization uses the {@link GenerateRecommendationsRequest.language_code} field in {@link GenerateRecommendationsRequest} requests.

title

string

Optional. Localized Recommendation Title. Localization uses the {@link GenerateRecommendationsRequest.language_code} field in {@link GenerateRecommendationsRequest} requests.

defaultDescription

string

Optional. Localized recommendation description. The localization the {@link GenerateRecommendationsRequest.language_code} field in {@link GenerateRecommendationsRequest} requests.

paid

boolean

Optional. Indicates whether a user needs to pay when they complete the user journey suggested by the recommendation.

numericalImpact

integer

Optional. A numerical score of the impact from the recommendation's description. For example, a recommendation might suggest an upward trend in sales for a certain product. Higher number means larger impact.

Description

Google-provided description for the recommendation.

JSON representation
{
  "text": string,
  "type": enum (DescriptionType)
}
Fields
text

string

Output only. Text of the description.

type

enum (DescriptionType)

Output only. Type of the description.

DescriptionType

Enum specifying type of the description.

Enums
DESCRIPTION_TYPE_UNSPECIFIED Default value. Will never be provided by the API.
SHORT Short description.
LONG Long description.

CallToAction

Call to action (CTA) that explains how a merchant can implement this recommendation

JSON representation
{
  "localizedText": string,
  "intent": string,
  "uri": string
}
Fields
localizedText

string

Output only. Localized text of the CTA. Optional.

intent

string

Output only. Intent of the action. This value describes the intent (for example, OPEN_CREATE_EMAIL_CAMPAIGN_FLOW) and can vary from recommendation to recommendation. This value can change over time for the same recommendation.

Currently available intent values: - OPEN_CREATE_EMAIL_CAMPAIGN_FLOW: Opens a user journey where they can create a marketing email campaign. (No default URL) - OPEN_CREATE_COLLECTION_TAB: Opens a user journey where they can create a collection for their Merchant account. (No default URL)

uri

string

Optional. URL of the CTA. This field will only be set for some recommendations where there is a suggested landing URL. Otherwise it will be set to an empty string. We recommend developers to use their own custom landing page according to the description of the intent field above when this uri field is empty.

Creative

Creative is a multimedia attachment to recommendation that can be used on the frontend.

JSON representation
{
  "uri": string,
  "type": enum (CreativeType)
}
Fields
uri

string

URL of the creative.

type

enum (CreativeType)

Type of the creative.

CreativeType

Enum containing possible values of creative type.

Enums
CREATIVE_TYPE_UNSPECIFIED Default value. If provided, shall be considered invalid.
VIDEO Video creatives.
PHOTO Photo creatives.