4

Dialogflow ES has an event called 'WELCOME' which makes it possible for the bot to initiate the conversation.

How can I do the same in Dialogflow CX?

There is no entry fulfillment option in the Start Page of Dialogflow CX.

Edit:

  1. Delete the 'Default Welcome Intent' route. I am unable to perform this. I get the following error. enter image description here

  2. In 'Default Welcome Intent' change the intent from 'WELCOME' to nothing. I get the following error. I have set the condition to true. I have also set the page transition to 'onboarding' page.

enter image description here

Please let me know if more screenshots are required.

ParshvaShah
  • 125
  • 1
  • 11
  • Are you looking for *[Default welcome intent](https://cloud.google.com/dialogflow/cx/docs/concept/intent#welcome)*? – Nick_Kh Apr 02 '21 at 07:50
  • 2
    No. The idea is to let the bot start the conversation in Dialogflow CX. What is/are the method/s to do that?. Once the bot window opens. Bot should say 'Hello' instead of user typing 'Hello' – ParshvaShah Apr 02 '21 at 14:24

4 Answers4

5

To accomplish what you're asking, the easiest way would be to:

  1. Open the "Default Start Flow" and select its Start page.
  2. Remove all routes and add a new one.
  3. This new route takes a "custom condition" in the form of true (in the condition pane, click on customize expression and then just type true) and goes to a new page called "Onboarding" (on the bottom of the route creation page, click on new page and name it Onboarding).
  4. Go to the Onboarding page and add an entry fulfilment "Hello there, how are you doing today?"

in this way every time the default start flow is activated (window is opened) the bot will use that fulfilment.

EDIT:

ok, i tried creating a new agent and i think i solved the problem. it seems as though we can't erase the default welcome intent, but it doesn't matter.

i created two pages: onboarding and first page. from start i added an always true route to the onboarding page, and i did the same with the onboarding and first page. As you can see from the testing console we only get the expected behaviour for the second transition, look at this:

start page: enter image description here

onboarding page: enter image description here

"first" page: enter image description here

After looking for info on the documentation i think i understood this: from the testing console, google doesn't let you see the actual behaviour of the conversation. If you see the screenshots, when i say "hi" and go the the onboarding page, i get immediately brought to the next page by that "true" transition. Since the same exact sequence is on the start page, the same behaviour should apply there: you only can't see it in the console because "opening the window" in the console is not the same as opening the conversation "in real life".

So, what i suggest you to do is create a new integration or develop a testing environment for the bot, say a website with the messenger integration, a telephony integration or whatever else, and test this onboarding on there. Speaking from personal experience, try with the messenger one maybe: you get a link and you just embed the script in any webpage (works well and easy).

It should work, as in, as soon as you open the conversation, the bot should go the onboarding page and say "hello there!"

fcagnola
  • 640
  • 7
  • 17
  • But an Intent seems necessary. I get a ```[Resource Name error]```. – ParshvaShah Apr 07 '21 at 01:34
  • i just added pictures to clarify what i meant. again, no intent necessary, just follow the instructions in the pictures and make sure to do this in the DEFAULT START FLOW – fcagnola Apr 07 '21 at 05:55
  • 1
    I am unable to delete the 'Default Welcome Intent' route. In this route I changed the intent to nothing, it throws me an error ```[Resource Name error]```, whilst keeping my transition to a new page 'onboarding'. I am editing my question to put the screenshots. – ParshvaShah Apr 08 '21 at 13:31
  • 1
    ok, i updated my answer with what i think is a solution: i think the problem is with google's console and not with the flow itself. – fcagnola Apr 09 '21 at 06:53
  • 1
    Yes, Google's Dialogflow CX doesn't have that feature as of yet. It can be achieved by embedding the iframe script, as mentioned by @fcagnola in your edit, in the webpage and using the code from this following link: [link](https://cloud.google.com/dialogflow/cx/docs/concept/integration/dialogflow-messenger#js-func). With this I was able to achieve my use case. – ParshvaShah Apr 15 '21 at 04:41
4

So, I'm not sure what your end use-case is, but DFCX (at it's core) isn't exactly designed to initiate an unsolicited message because it's really just a language model with a bunch of features built on top of it.

With that being said, if you want to create a pop-up window for your website chat-widget, you can actually configure this in the integration settings with your embed code. Here's an example:

//The DF Messenger element: 
 
<df-messenger df-cx="true" chat-title="Agent Name" agent-id="<your agent ID>" language-code="en" expand="true"></df-messenger>

 //The window load script : 

<script src="https://www.gstatic.com/dialogflow-console/fast/messenger-cx/bootstrap.js?v=1"></script><script>
window.addEventListener('dfMessengerLoaded', function (event) {
  const dfMessenger = document.querySelector('df-messenger');
  const openText = ('<The Text You Want To Display On Page Load>');
dfMessenger.renderCustomText(openText);
});

</script>

Please note this will only work if you have the DF Messenger Integration enabled on your agent. See the docs for integrating DF Messenger here

belwood
  • 3,320
  • 11
  • 38
  • 45
CapriAi
  • 41
  • 1
4

1.Use the attribute intent inside the df-messenger tag in your UI/HTML page

2.Then create a Custom Event in Dialogflow CX (By clicking on Event handler '+' icon)

3.Check the 'use custom event' checkbox and provide event name and provide a text response in fulfillment section of this custom event.

4.Finally provide this custom event name as value to the attribute intent(mentioned in step 1)

please refer to this document for df-messenger HTML customizations https://cloud.google.com/dialogflow/cx/docs/concept/integration/dialogflow-messenger#html-customize

Rohit Soma
  • 51
  • 1
  • I've had to deal with this since day one and you suggestion here is how I tackled it. Not sure why someone would downvote. The built-in "WELCOME" and "WELCOME_TELEPHONY" events do not work the same in DialogFlow CX. ES works fine...Basically just add a route using a custom event name "WELCOME" and duplicate your fulfillment messages in there. Or, you can do all of this in your webhook. Push messages from the webhook and just use the same tag name. Webhook won't care if you are executing "Default Welcome Intent" or event handler "WELCOME". – akuma6099 Jan 03 '23 at 17:51
  • Thank you very much, @Rohit, it worked like a charm, simple and efficient – razimbres Aug 26 '23 at 12:32
2

According to Dialogflow CX documentation, the WELCOME event (although not visible in the Start flow) is also available. As you can see in this link and the picture below.

Screenshot from Dialogflow CX Welcome intent documentation

To invoke this event, you have to use the detectIntent method of a Session client. You'll need to specify the event name in queryInput.event.event of the request used in detectIntent.

Hope this helps!

Thomas Smyth - Treliant
  • 4,993
  • 6
  • 25
  • 36
ruthless33
  • 21
  • 5