Skip to main content
답변 3개
  1. 어제 오후 4:15

    Hi Purushottam, the key thing is the agent runs server-side, so it cannot read the browser URL itself. You extract the params on the host page and pass them in as context. For an embedded Messaging for In-App and Web (or Enhanced) deployment: 

     

    1. In your page's embedded messaging snippet, read location.search and parse param0, param1, param2. 

    2. Pass them in through the Pre-Chat API just before the chat launches: embeddedservice_bootstrap.prechatAPI.setHiddenPrechatFields(...). Hidden pre-chat fields carry the values in with no visible form. 

    3. Map those onto custom fields on the Messaging Session, then expose them as Messaging Session Context Variables in your agent config. 

    4. Reference those context variables in the agent's topic instructions or actions to shape the response. 

     

    If you are calling the headless Agent API instead of the embedded widget, pass the same values as context variables when you start the session. 

     

    So the agent never reads the URL directly, the page reads it and hands the values to the conversation as context. 

     

    if this helps, please mark it as the Best Answer so it helps the next person, thanks 🙂

0/9000