Legacy Dev Forum Posts

 View Only

Sign Up

Web Messaging Participant Data

  • 1.  Web Messaging Participant Data

    Posted 06-05-2025 18:38

    SKandel | 2024-07-12 16:36:27 UTC | #1

    We are helping our Genesys Cloud customer migrate from Chat to Web Messaging. Currently, we are storing the following as Participant Data on Chat interactions:

    OS (context.genesysOS) Browser (context.genesysbrowser) Source (context.genesyssource) Page Title (context.genesyspageTitle)

    We need to store this same data with Web Messaging interactions. I found a similar topic:

    Get URL on web messaging https://developer.genesys.cloud/forum/t/get-url-on-web-messaging/24263

    We added the code snippet and Web Messaging interactions now store the URL and Language. I would like to inquire if it is possible to store the above as Participant Data on Web Messaging interactions, and what other data can be stored with Web Messaging interactions using the Database.set command.

    Thank you in advance.


    msassoon | 2024-07-22 12:24:56 UTC | #2

    Yes, that method is used to store any data to Participant Data. You do not need the context part anymore, it is just the key name as explained. Any data that you can find in javascript and execute the command will work. The big difference is you can execute this at any time in the browser session and not just on the page they click to start.


    SKandel | 2024-07-22 16:34:48 UTC | #3

    Hello Marc,

    Thank you for replying to my topic.

    In the previous related topic, you indicated the following can be used:

    genesysurl: window.location.href browserlanguage: navigator.language

    Can you please provide the code that should be used after each of these key names:

    genesysOS: genesysbrowser: genesyssource: genesyspageTitle:

    Thank you in advance.


    msassoon | 2024-07-24 11:38:23 UTC | #4

    Some examples are window.navigator.userAgent to get the OS, but all of these are public javascript samples and not specific to Genesys. How did you get the values in the first place?


    SKandel | 2024-07-24 18:28:16 UTC | #5

    Thank you for that example. I believe another engineer obtained those key names when we originally implemented web chat for our customer. Would you happen to have the code/javascript for browser, source and page title? Thank you!


    msassoon | 2024-07-31 21:49:50 UTC | #6

    Sorry, if you point me to the page I can look. Examples might be:

    var genesysOS ="Unknown OS"; if (navigator.appVersion.indexOf("Win")!=-1) genesysOS ="Windows"; if (navigator.appVersion.indexOf("Mac")!=-1) genesysOS ="MacOS"; if (navigator.appVersion.indexOf("X11")!=-1) genesysOS ="UNIX"; if (navigator.appVersion.indexOf("Linux")!=-1) genesys_OS ="Linux";

    as there are multiple versions.

    genesyspageTitle == document.title; genesysbrowser == navigator.appName;

    Not sure what source is in this context. This isn't Genesys code and so I cannot find it for you or ask the engineer as I don't know where it came from. All the samples above are from Stack Overflow and any web developer could write them.


    SKandel | 2024-08-01 15:14:34 UTC | #7

    Thank you for providing the code/javascript for page title and browser. I updated my code as follows to include these:

    Genesys("command", "Database.set", { messaging: { customAttributes: { genesysbrowser: navigator.appName, browserlanguage: navigator.language genesyspageTitle: document.title, genesysurl: window.location.href, } } });

    The code you provided for OS looks a bit different than the others. Where/how would I include that in my above code? Thank you!


    system | 2024-08-31 15:15:10 UTC | #8

    This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 27224