Specyfikacja
Aby wpłynąć na kolejność wyświetlania usług danego sprzedawcy, ustawranking_hint.score
w każdym pliku Service
w pliku danych usługi.
// Ranking hints for a service. message ServiceRankingHint { // Arbitrary partner or merchant assigned rank for this service. // // Services with a higher score will be shown more prominently (e.g. shown // higher in lists). Note that other factors may also influence ranking, such // as price, availability, user history, etc. // // Optional. Must be non-negative if set. optional float score = 1; }Jeśli wyświetla się wiele usług (na przykład strona bezpośrednio po przycisku „Zarezerwuj” wyświetla wszystkie usługi, które użytkownik może wybrać), używa
Service.ranking_hint.score
jako jednego z sygnałów, aby zamówić usługi. Im wyższy wynik, tym wyżej na stronie będzie wyświetlana usługa.
Przykład
Sprzedawca oferuje 3 usługi „strzyżenie i fryzjerstwo” oraz „masaż głowy i strzyżenie” oraz wybraną przez niego kolejność:- Strzyżenie
- Masaż głowy i strzyżenie włosów
- Kolorowanki
Usługi
{ "service": [ { "price": { "currency_code": "USD", "price_micros": 20000000 }, "service_id": "haircut", "prepayment_type": "NOT_SUPPORTED", "merchant_id": "beauty-1", "localized_service_name": { "value": "Haircut", "localized_value": [ { "locale": "en", "value": "Haircut" } ] }, "localized_description": { "value": "Get a haircut.", "localized_value": [ { "locale": "en", "value": "Get a haircut." } ] }, "ranking_hint": { "score": 30.0 } }, { "localized_service_name": { "value": "Coloring", "localized_value": [ { "locale": "en", "value": "Coloring" } ] }, "price": { "currency_code": "USD", "price_micros": 40000000 }, "service_id": "haircoloring", "prepayment_type": "NOT_SUPPORTED", "merchant_id": "beauty-1", "localized_description": { "value": "Get your hair dyed.", "localized_value": [ { "locale": "en", "value": "Get your hair dyed." } ] }, "ranking_hint": { "score": 10.0 } }, { "localized_service_name": { "value": "Scalp massage and Haircut", "localized_value": [ { "locale": "en", "value": "Scalp massage and Haircut" } ] }, "price": { "currency_code": "USD", "price_micros": 30000000 }, "service_id": "scalpmassage", "prepayment_type": "NOT_SUPPORTED", "merchant_id": "beauty-1", "localized_description": { "value": "Get a shampoo and scalp massage followed by a haircut.", "localized_value": [ { "locale": "en", "value": "Get a shampoo and scalp massage followed by a haircut." } ] }, "ranking_hint": { "score": 20.0 } } ] }