Merchant API'yi kullanan satıcıları inceleme

Satıcı yorumları, kullanıcıların yüksek kaliteli müşteri deneyimleri sunan işletmeleri bulmasına yardımcı olarak güven oluşturulmasını ve daha bilinçli satın alma kararları verilmesini sağlar. Sonuç olarak, mağaza puanları işletmelerin reklamların ve organik listelemelerin performansını artırmasına ve açılış sayfalarına daha nitelikli müşteriler çekmesine yardımcı olabilir.

Bu sayfada, satıcı yorumlarını Merchant API ile nasıl yönetebileceğiniz açıklanmaktadır.

Ön koşullar

Google, belirli bilgileri sağlamanızı gerektirir. Aşağıdakilere sahip olmanız gerekir:

  • Google Merchant Center'da etkin bir satıcı yorumu veri kaynağı.
  • Hesabınız Mağaza puanları programına kayıtlı olmalıdır. Programa kayıtlı olup olmadığınızdan emin değilseniz Merchant Center'ı kontrol edin. Kayıtlı değilseniz istek formunu gönderin.

Veri kaynağı oluşturma

Satıcı yorumları feed'i oluşturmak için accounts.dataSources.create yöntemini kullanın. Mevcut bir satıcı yorumları feed'i varsa dataSource.name alanını getirmek için accounts.dataSources.get yöntemini kullanın.

İsteğin biçimi aşağıdaki gibidir:

POST https://merchantapi.googleapis.com/datasources/v1/accounts/{ACCOUNT_ID}/dataSources/{DATASOURCE_ID}

Örnek

Örnekte, tipik bir istek ve yanıt gösterilmektedir.

İstek

POST https://merchantapi.googleapis.com/datasources/v1/accounts/123/dataSources {"displayName": "test api feed", "merchantReviewDataSource":{} }

Yanıt

{
  "name": "accounts/123/dataSources/1000000573361824",
  "dataSourceId": "1000000573361824",
  "displayName": "test api feed",
  "merchantReviewDataSource": {},
  "input": "API"
}

Daha fazla bilgi için Ürün yorumu veri kaynağı oluşturma başlıklı makaleyi inceleyin.

Satıcı yorumu oluşturma

Satıcı yorumu oluşturmak veya güncellemek için accounts.merchantReviews.insert yöntemini kullanabilirsiniz. accounts.merchantReviews.insert yöntemi, giriş olarak bir merchantreview kaynağı ve bir veri kaynağı adı alır. Başarılı olursa yeni veya güncellenmiş satıcı yorumunu döndürür. Satıcı yorumu oluşturmak için datasource.name gerekir.

Talebin şekli:

POST https://merchantapi.googleapis.com/reviews/v1alpha/{parent=accounts/*/}merchantReviews:insert

Referans için aşağıdaki örnek satıcı yorumunu inceleyin.

POST https://merchantapi.googleapis.com/reviews/v1alpha/accounts/{ACCOUNT_ID}/merchantReviews:insert?dataSource=accounts/{ACCOUNT_ID}/dataSources/{DATASOURCE_ID}

  merchantReviewId = 'my_own_review'
  merchantReviewAttributes {
    merchantId = 'merchant_id'
    merchantDisplayName = 'merchant_display_name'
    merchantLink = 'publisher_name'
    merchantRatingLink = 'https://www.google.com'
    minRating = 1
    maxRating = 10
    rating = 7.9
    title = 'Amazing Merchant'
    content = 'This is an incredible merchant'
    reviewerId = 'reviewer_id'
    reviewerUsername = 'reviewer_username'
    isAnonymous = false
    collectionMethod = 'AFTER_FULFILLMENT'
    reviewTime = '2024-04-01T00:00:00Z'
    reviewLanguage = 'en'
    reviewCountry = 'US'
  }

Satıcı yorumu oluşturulduktan sonra yorumun yayılması birkaç dakika sürebilir.

Satıcı yorumlarını görüntüleme

Satıcı yorumunu görüntülemek için accounts.merchantReviews.get değerini kullanın. Bu alan salt okunurdur. Ad alanı olarak merchantId ve satıcı yorumunun kimliği gerekir. get yöntemi, ilgili satıcı yorumu kaynağını döndürür.

Örneğin:

GET https://merchantapi.googleapis.com/reviews/v1alpha/{name=accounts/*/merchantReviews/*}

Belirli bir Merchant Center hesabı için tek bir ürünü almak üzere aşağıdaki örnekte gösterildiği gibi google.shopping.merchant.accounts.v1.GetProductRequest yöntemini kullanabilirsiniz.

Java

import com.google.api.gax.core.FixedCredentialsProvider;
import com.google.auth.oauth2.GoogleCredentials;
import com.google.shopping.merchant.products.v1.GetProductRequest;
import com.google.shopping.merchant.products.v1.Product;
import com.google.shopping.merchant.products.v1.ProductsServiceClient;
import com.google.shopping.merchant.products.v1.ProductsServiceSettings;
import shopping.merchant.samples.utils.Authenticator;
import shopping.merchant.samples.utils.Config;

/** This class demonstrates how to get a single product for a given Merchant Center account */
public class GetProductSample {

  public static void getProduct(Config config, String product) throws Exception {

    // Obtains OAuth token based on the user's configuration.
    GoogleCredentials credential = new Authenticator().authenticate();

    // Creates service settings using the credentials retrieved above.
    ProductsServiceSettings productsServiceSettings =
        ProductsServiceSettings.newBuilder()
            .setCredentialsProvider(FixedCredentialsProvider.create(credential))
            .build();

    // Calls the API and catches and prints any network failures/errors.
    try (ProductsServiceClient productsServiceClient =
        ProductsServiceClient.create(productsServiceSettings)) {

      // The name has the format: accounts/{account}/products/{productId}
      GetProductRequest request = GetProductRequest.newBuilder().setName(product).build();

      System.out.println("Sending get product request:");
      Product response = productsServiceClient.getProduct(request);

      System.out.println("Retrieved Product below");
      System.out.println(response);
    } catch (Exception e) {
      System.out.println(e);
    }
  }

  public static void main(String[] args) throws Exception {
    Config config = Config.load();
    // The name of the `product`, returned after a `Product.insert` request. We recommend
    // having stored this value in your database to use for all future requests.
    String product = "accounts/{datasource}/products/{productId}";

    getProduct(config, product);
  }
}

Satıcı yorumlarını listeleme

Oluşturulan tüm satıcı yorumlarını görüntülemek için accounts.merchantReviews.list yöntemini kullanabilirsiniz.

GET https://merchantapi.googleapis.com/reviews/v1alpha/accounts/{ACCOUNT_ID}/merchantReviews

Satıcı yorumlarını silme

Bir satıcı yorumunu silmek için accounts.merchantReviews.delete simgesini kullanın. accounts.merchantReviews.get yöntemine benzer şekilde, bu yöntemde de oluşturma sırasında döndürülen satıcı yorumunun ad alanı gerekir.

Örneğin:

DELETE https://merchantapi.googleapis.com/reviews/v1alpha/{name=accounts/*/merchantReviews/*}

Satıcı yorumu durumu

Satıcı yorumu kaynağı, diğer API'lere benzer bir durum içerir. Bu durum, kaynağın ayrılmaz bir parçasıdır ve aynı sorun ile hedef yapısını izler.