Search code examples
javascriptwordpressheaderdialogflow-es

Dialogflow Beta integration and session ID


I hope someone would be able to guide me, I'm a beginner with Dialogflow

I'm integrating Dialogflow on Wordpress by using their 'Dialogflow Beta integration' and i'm wondering what would be the best way to produce a session-id for visitors coming on the website:

<script src="https://www.gstatic.com/dialogflow-console/fast/messenger/bootstrap.js?v=1"></script>
<df-messenger
  intent="WELCOME"
  chat-title="cdcloudlogix-agent"
  agent-id="xxxxxxxxxxxxxxxxx"
  language-code="en"
  session-id="??????"
></df-messenger>

I'm integrating this piece of code in the header of the landing page, but I was wondering what would be the best practice to handle this type of situation. Or should I make use of the user-id instead?

If you need more information, don't hesitate to ask!


Solution

  • You can omit including session-id in your code. When session-id is not defined, Dialogflow will generate a unique session-id for each chat. See Dialogflow Messenger doc for reference.

    enter image description here