यह पक्का करने के लिए कि लोगों को आपके एजेंट के साथ काम करने वाले इंटरैक्शन मिलें, Google एजेंट से बातचीत पूरी होने के बाद, उपयोगकर्ताओं को सर्वे भेजे. अगर आपने आपको अलग-अलग समय पर डेटा इकट्ठा करना हो, जैसे कि इवेंट के आखिर में तो आपके पास बातचीत. सर्वे, बातचीत में दिखते हैं और उपयोगकर्ताओं को कई विकल्पों के साथ सुझाव, शिकायत या राय भेज सकते हैं.
Google के ट्रिगर किए जाने वाले सर्वे का समय, एजेंट के मैसेज सेवा पर निर्भर करता है खरीदारी के लिए उपलब्धता:
उपलब्धता | सर्वे का समय |
---|---|
सिर्फ़ बॉट | आखिरी मैसेज के 30 मिनट बाद |
सिर्फ़ इंसानों के लिए | पिछले मैसेज के 24 कामकाजी घंटे बाद |
बॉट और इंसान | पिछले मैसेज के 24 कामकाजी घंटे बाद |
अगर < अगले 7 दिनों में 24 कामकाजी घंटों के लिए, हम इसके बजाय 24 घंटे का इस्तेमाल करते हैं.
हर 24 घंटे में हर बातचीत के लिए एक सर्वे भेजा जा सकता है. अगर आपको पहले की बातचीत होती है, तो Google उस बातचीत के लिए सर्वे नहीं भेजता. अगर आपका एजेंट 24 घंटे के अंदर एक ही बातचीत में एक से ज़्यादा सर्वे भेजता है, तो Business Messages, उपयोगकर्ता को सिर्फ़ पहला सर्वे भेजने की कोशिश करता है.
अगली बार जब कोई उपयोगकर्ता, कार्रवाई पूरी करने के बाद आपके एजेंट के साथ बातचीत शुरू करे सर्वे में, एजेंट एक ग्रीटिंग दिखाता है. अगर कोई उपयोगकर्ता सर्वे का जवाब नहीं देता है, तो सर्वे 7 दिन बाद खत्म हो जाता है और सर्वे खत्म होने के बाद, उपयोगकर्ता को अगली बातचीत में कोई वेलकम मैसेज दिखता है.
अगर कोई उपयोगकर्ता सर्वे के दौरान ऐसा मैसेज भेजता है जो सर्वे से जुड़ा न हो Business Messages, सर्वे रद्द करता है और उपयोगकर्ता का मैसेज भेजता है के वेबहुक पर जा सकता है.
अगर उपयोगकर्ताओं को सर्वे नहीं भेजे जाते हैं, तब भी आपके एजेंट को यह जानकारी मिलती रहेगी Google के सर्वे के नतीजे आपको देख सकते हैं. इन नतीजों को स्वीकार और प्रोसेस करना चाहिए उन्हें कस्टमाइज़ किया जा सकता है.
सवाल
सर्वे में ज़्यादा से ज़्यादा पांच सवाल शामिल किए जा सकते हैं. इन्हें तीन कैटगरी में बांटा जा सकता है: ज़रूरी, टेंप्लेट, और कस्टम. सर्वे हमेशा ज़रूरी सवाल शामिल करता है. इसके बाद, ज़्यादा से ज़्यादा दो टेंप्लेट दिखाता है सवाल और फिर पसंद के मुताबिक बनाए गए ज़्यादा से ज़्यादा दो सवाल दिखाए जाते हैं.
ज़रूरी सवाल
ज़रूरी सवाल को Business Messages की सभी भाषाओं में स्थानीय भाषा में लिखा गया है इस्तेमाल किया जा सकता है. उपयोगकर्ता 'पसंद करें' या 'नापसंद करें' बटन का इस्तेमाल करके, जवाब दे सकते हैं.
ज़रूरी सवाल: "क्या इस मैसेज सेवा ने आपकी ज़रूरतों को पूरा किया
टेंप्लेट से जुड़े सवाल
टेंप्लेट में पूछे जाने वाले सवाल वैकल्पिक होते हैं. इन्हें Google ने तय किया है और इन्हें स्थानीय भाषा में लिखा जाता है सभी भाषाओं में उपलब्ध है, जो Business Messages पर काम करता है. सर्वे में ज़्यादा से ज़्यादा दो टेंप्लेट वाले सवाल. उपयोगकर्ता के रिस्पॉन्स फ़ॉर्मैट, सवाल के हिसाब से अलग-अलग होते हैं.
टेंप्लेट से जुड़े सवालों में ये शामिल हैं
- AGENT_NAME से मैसेज करने का आपका अनुभव कैसा रहा?
- क्या आप अपने दोस्त को AGENT_NAME का सुझाव देना चाहेंगे?
- अगली बार AGENT_NAME से संपर्क करने पर, इसकी कितनी संभावना है मैसेज सेवा चुनें?
- कुल मिलाकर, AGENT_NAME के साथ इंटरैक्ट करना कितना आसान था?
- आप इस बात से, किस हद तक सहमत या असहमत हैं: AGENT_NAME ने मेरे लिए अपनी समस्या को मैनेज करना आसान बनाया है.
- कृपया बताएं कि सहायता सहयोगी के साथ आप कुल मिलाकर कितने संतुष्ट हैं.
- क्या इस चैट सेशन में, आपको AGENT_NAME को कॉल करने से बचने में मदद मिली?
सभी उपलब्ध टेंप्लेट सवालों की सूची देखने और टेंप्लेट आईडी पाने के लिए,
- Business Communications डेवलपर खोलें कंसोल और अपने Business Messages के Google खाते से साइन इन करें.
- अपना एजेंट चुनें.
- बाईं ओर मौजूद नेविगेशन में, सर्वे पर क्लिक करें.
मनमुताबिक सवाल
एक सर्वे में ज़्यादा से ज़्यादा दो पसंद के मुताबिक सवाल शामिल किए जा सकते हैं. यदि आप सवाल, हर एक के लिए सवाल के वर्शन शामिल करें स्थानीय भाषा जिसकी मदद से आपका एजेंट काम करता है. आपको अपने डिफ़ॉल्ट स्थान-भाषा. अगर किसी उपयोगकर्ता को सर्वे मिलता है, लेकिन वह ऐसी जगह में है जो उपलब्ध नहीं है पसंद के मुताबिक बनाए गए सवाल का खास वर्शन, जैसा कि बताया गया है, सवाल वैसा ही दिखेगा की जगह तय करें.
पसंद के मुताबिक सवालों के जवाबों के लिए अलग टेक्स्ट और पोस्टबैक डेटा का इस्तेमाल किया जा सकता है, यह इसी तरह का है सुझाए गए जवाब.
सर्वे को अपनी पसंद के मुताबिक बनाना
एजेंट के लिए सर्वे को अपनी पसंद के मुताबिक बनाने के लिए,
- Business Communications डेवलपर खोलें कंसोल और अपने Business Messages के Google खाते से साइन इन करें.
- अपना एजेंट चुनें.
- बाईं ओर मौजूद नेविगेशन में, सर्वे पर क्लिक करें.
- इस सर्वे में, टेंप्लेट वाले ज़्यादा से ज़्यादा दो सवाल जोड़ें.
- अपने सर्वे में अपनी पसंद के मुताबिक सवाल जोड़ने के लिए, पसंद के मुताबिक सवाल बनाएं पर क्लिक करें.
फ़ॉर्मैटिंग और वैल्यू के विकल्पों के लिए, यह देखें
surveyConfig
.
सर्वे भेजें
सर्वे भेजने के लिए, नीचे दिया गया निर्देश चलाएं. CONVERSATION_ID बदलें उस बातचीत के आइडेंटिफ़ायर के साथ जहां आपको सर्वे भेजना है और SURVEY_ID, सर्वे के लिए किसी यूनीक आइडेंटिफ़ायर के साथ.
# Copyright 2021 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # https://www.apache.org/licenses/LICENSE-2.0 # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # This code sends a survey to the user: # Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/message/surveys?hl=en # Replace the __CONVERSATION_ID__ with a conversation id that you can send messages to # Make sure a service account key file exists at ./service_account_key.json curl -X POST "https://businessmessages.googleapis.com/v1/conversations/__CONVERSATION_ID__/surveys?surveyId=f4bd7576-6c2e-4674-9db4-d697166f63ce" \ -H "Content-Type: application/json" \ -H "User-Agent: curl/business-messages" \ -H "$(oauth2l header --json ./service_account_key.json businessmessages)"
/** * This code sends a survey to the user: * Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/message/surveys?hl=en * * This code is based on the https://github.com/google-business-communications/nodejs-businessmessages Node.js * Business Messages client library. */ /** * Edit the values below: */ const PATH_TO_SERVICE_ACCOUNT_KEY = './service_account_key.json'; const CONVERSATION_ID = 'EDIT_HERE'; const businessmessages = require('businessmessages'); const uuidv4 = require('uuid').v4; const {google} = require('googleapis'); // Initialize the Business Messages API const bmApi = new businessmessages.businessmessages_v1.Businessmessages({}); // Set the scope that we need for the Business Messages API const scopes = [ 'https://www.googleapis.com/auth/businessmessages', ]; // Set the private key to the service account file const privatekey = require(PATH_TO_SERVICE_ACCOUNT_KEY); /** * Posts a survey to the Business Messages API. * * @param {string} conversationId The unique id for this user and agent. */ async function sendSurvey(conversationId) { const authClient = await initCredentials(); // Create the payload for creating a new survey const apiParams = { auth: authClient, parent: 'conversations/' + conversationId, surveyId: uuidv4(), resource: {} }; // Call the message create function using the // Business Messages client library bmApi.conversations.surveys.create(apiParams, {auth: authClient}, (err, response) => { console.log(err); console.log(response); }); } /** * Initializes the Google credentials for calling the * Business Messages API. */ async function initCredentials() { // configure a JWT auth client const authClient = new google.auth.JWT( privatekey.client_email, null, privatekey.private_key, scopes, ); return new Promise(function(resolve, reject) { // authenticate request authClient.authorize(function(err, tokens) { if (err) { reject(false); } else { resolve(authClient); } }); }); } sendSurvey(CONVERSATION_ID);
import com.google.api.client.googleapis.services.AbstractGoogleClientRequest; import com.google.api.client.http.HttpBackOffUnsuccessfulResponseHandler; import com.google.api.client.http.HttpRequest; import com.google.api.client.googleapis.auth.oauth2.GoogleCredential; import com.google.api.client.googleapis.javanet.GoogleNetHttpTransport; import com.google.api.client.http.HttpTransport; import com.google.api.client.json.jackson2.JacksonFactory; import com.google.api.client.util.ExponentialBackOff; import com.google.api.services.businessmessages.v1.Businessmessages; import com.google.api.services.businessmessages.v1.model.*; import java.io.FileInputStream; import java.util.Arrays; import java.util.UUID; class SendSurveySnippet { /** * Initializes credentials used by the Business Messages API. */ private static Businessmessages.Builder getBusinessMessagesBuilder() { Businessmessages.Builder builder = null; try { GoogleCredential credential = GoogleCredential .fromStream(new FileInputStream("PATH_TO_SERVICE_ACCOUNT_KEY")); credential = credential.createScoped(Arrays.asList( "https://www.googleapis.com/auth/businessmessages")); credential.refreshToken(); HttpTransport httpTransport = GoogleNetHttpTransport.newTrustedTransport(); JacksonFactory jsonFactory = JacksonFactory.getDefaultInstance(); // Create instance of the Business Messages API builder = new Businessmessages .Builder(httpTransport, jsonFactory, null) .setApplicationName("Sample Application"); // Set the API credentials and endpoint builder.setHttpRequestInitializer(credential); } catch (Exception e) { e.printStackTrace(); } return builder; } public static void main(String args[]) { try { String conversationId = "CONVERSATION_ID"; // Create client library reference Businessmessages.Builder builder = getBusinessMessagesBuilder(); // Create a new survey to send to the user associated with the conversationId Businessmessages.Conversations.Surveys.Create request = bmBuilder.build().conversations().surveys() .create("conversations/" + conversationId, new BusinessMessagesSurvey()); request.setSurveyId(UUID.randomUUID().toString()); // Setup retries with exponential backoff HttpRequest httpRequest = ((AbstractGoogleClientRequest) request).buildHttpRequest(); httpRequest.setUnsuccessfulResponseHandler(new HttpBackOffUnsuccessfulResponseHandler( new ExponentialBackOff())); // Execute request httpRequest.execute(); } catch (Exception e) { e.printStackTrace(); } } }
"""This code sends a survey to the user. Read more: https://developers.google.com/business-communications/business-messages/guides/how-to/message/surveys?hl=en This code is based on the https://github.com/google-business-communications/python-businessmessages Python Business Messages client library. """ import uuid from businessmessages import businessmessages_v1_client as bm_client from businessmessages.businessmessages_v1_messages import BusinessmessagesConversationsSurveysCreateRequest from businessmessages.businessmessages_v1_messages import BusinessMessagesSurvey from oauth2client.service_account import ServiceAccountCredentials # Edit the values below: path_to_service_account_key = './service_account_key.json' conversation_id = 'EDIT_HERE' credentials = ServiceAccountCredentials.from_json_keyfile_name( path_to_service_account_key, scopes=['https://www.googleapis.com/auth/businessmessages']) client = bm_client.BusinessmessagesV1(credentials=credentials) # Create the survey request survey_request = BusinessmessagesConversationsSurveysCreateRequest( surveyId=str(uuid.uuid4().int), parent='conversations/' + conversation_id, businessMessagesSurvey=BusinessMessagesSurvey()) # Send the survey bm_client.BusinessmessagesV1.ConversationsSurveysService( client=client).Create(request=survey_request)
फ़ॉर्मैटिंग और वैल्यू के विकल्पों के लिए, यह देखें
conversations.surveys
.
सर्वे के जवाब पाएं
जब कोई उपयोगकर्ता सर्वे में किसी सवाल का जवाब देता है, तो आपके एजेंट को जवाब मिलता है के वेबहुक पर काम करता है. सर्वे के जवाब उसी तरह से पाना और प्रोसेस करना जिस तरह मिलता है मैसेज.
सर्वे के सभी सवालों के surveyResponse.survey
की एक जैसी वैल्यू होती है. अगर आपने
आपके सर्वे में कई सवाल शामिल हैं. इसलिए, पक्का करें कि आपका इन्फ़्रास्ट्रक्चर
समान surveyResponse.survey
मान के साथ कई प्रतिक्रियाएं होती हैं और
surveyResponse.surveyQuestionId
फ़ील्ड के हिसाब से अलग-अलग सवाल.
सर्वे के जवाबों के लिए टेक्स्ट वैल्यू इसमें दिखती हैं
surveyResponse.questionResponseText
. ज़रूरी और टेंप्लेट सवालों के लिए,
Business Messages, 'पसंदीदा' जवाब के तौर पर VERY_SATISFIED
और 'पसंद है' बटन का इस्तेमाल करता है
VERY_DISSATISFIED
की तरह डाउन रिस्पॉन्स. अगर पसंद के मुताबिक बनाए गए सवाल के जवाब में
इमोजी, यह सबसे सही तरीका है कि
तो surveyResponse.questionResponsePostbackData
को पार्स करने का प्रयास करें
यूनिकोड मान.
सर्वे के जवाबों का फ़ॉर्मैट इस तरह होता है.
{ "agent": "brands/BRAND_ID /agents/AGENT_ID ", "sendTime": "SEND_TIME ", "conversationId": "CONVERSATION_ID ", "requestId": "REQUEST_ID ", "surveyResponse": { "survey": "conversations/CONVERSATION_ID /surveys/SURVEY_ID ", "rating": "SURVEY_RATING ", "createTime": "CREATE_TIME ", "surveyQuestionId": "QUESTION_ID ", "questionResponseText": "RESPONSE_TEXT ", "questionResponsePostbackData": "RESPONSE_POSTBACK_DATA ", "questionType": "QUESTION_TYPE ", "questionIndex":QUESTION_INDEX , "totalQuestionCount":TOTAL_QUESTION_COUNT , "surveyTriggerSource": "TRIGGER_SOURCE " } }
फ़ॉर्मैटिंग और वैल्यू के विकल्पों के लिए, यह देखें
UserMessage
और
SurveyResponse
.