Content API for Shopping . recommendations

Instance Methods

close()

Close httplib2 connections.

generate(merchantId, allowedTag=None, languageCode=None, x__xgafv=None)

Generates recommendations for a merchant.

reportInteraction(merchantId, body=None, x__xgafv=None)

Reports an interaction on a recommendation for a merchant.

Method Details

close()
Close httplib2 connections.
generate(merchantId, allowedTag=None, languageCode=None, x__xgafv=None)
Generates recommendations for a merchant.

Args:
  merchantId: string, Required. The ID of the account to fetch recommendations for. (required)
  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 (repeated)
  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
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response containing generated recommendations.
  "recommendations": [ # Recommendations generated for a request.
    { # 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.
      "additionalCallToAction": [ # Output only. CTAs of this recommendation. Repeated.
        { # Call to action (CTA) that explains how a merchant can implement this recommendation
          "intent": "A 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](https://support.google.com/merchants/answer/9703228) for their Merchant account. (No default URL)
          "localizedText": "A String", # Output only. Localized text of the CTA. Optional.
          "uri": "A 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.
        },
      ],
      "additionalDescriptions": [ # Output only. List of additional localized descriptions for a recommendation. Localication uses the `languageCode` field in `GenerateRecommendations` requests. Not all description types are guaranteed to be present and we recommend to rely on default description.
        { # Google-provided description for the recommendation.
          "text": "A String", # Output only. Text of the description.
          "type": "A String", # Output only. Type of the description.
        },
      ],
      "creative": [ # Output only. Any creatives attached to the recommendation. Repeated.
        { # Creative is a multimedia attachment to recommendation that can be used on the frontend.
          "type": "A String", # Type of the creative.
          "uri": "A String", # URL of the creative.
        },
      ],
      "defaultCallToAction": { # Call to action (CTA) that explains how a merchant can implement this recommendation # Optional. Default CTA of the recommendation.
        "intent": "A 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](https://support.google.com/merchants/answer/9703228) for their Merchant account. (No default URL)
        "localizedText": "A String", # Output only. Localized text of the CTA. Optional.
        "uri": "A 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.
      },
      "defaultDescription": "A String", # Optional. Localized recommendation description. The localization the {@link `GenerateRecommendationsRequest.language_code`} field in {@link `GenerateRecommendationsRequest`} requests.
      "numericalImpact": 42, # 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.
      "paid": True or False, # Optional. Indicates whether a user needs to pay when they complete the user journey suggested by the recommendation.
      "recommendationName": "A String", # Optional. Localized recommendation name. The localization uses the {@link `GenerateRecommendationsRequest.language_code`} field in {@link `GenerateRecommendationsRequest`} requests.
      "subType": "A 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.
      "title": "A String", # Optional. Localized Recommendation Title. Localization uses the {@link `GenerateRecommendationsRequest.language_code`} field in {@link `GenerateRecommendationsRequest`} requests.
      "type": "A String", # Output only. Type of the recommendation. List of currently available recommendation types: - OPPORTUNITY_CREATE_NEW_COLLECTION - OPPORTUNITY_CREATE_EMAIL_CAMPAIGN
    },
  ],
  "responseToken": "A 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.
}
reportInteraction(merchantId, body=None, x__xgafv=None)
Reports an interaction on a recommendation for a merchant.

Args:
  merchantId: string, Required. The ID of the account that wants to report an interaction. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request to report interactions on a recommendation.
  "interactionType": "A String", # Required. Type of the interaction that is reported, for example INTERACTION_CLICK.
  "responseToken": "A String", # Required. Token of the response when recommendation was returned.
  "subtype": "A String", # Optional. Subtype of the recommendations this interaction happened on. This field must be set only to the value that is returned by {@link `RecommendationsService.GenerateRecommendations`} call.
  "type": "A String", # Required. Type of the recommendations on which this interaction happened. This field must be set only to the value that is returned by {@link `GenerateRecommendationsResponse`} call.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format