Get URL on web messaging

Hi there,
is there any way to get the URL of the page where the web messenger is located?
E.g. in webchat, we used "Get Participant Data" and the attribute to search for was "context.genesys_url"
I didn't have to do anything fancy to get it, is there any way to replicate this in Web Messenger?
To save me from creating a new inbound message flow and bot for every single page we have it on?

Based on the page, it may do different things OR we have some clients who use the same chat widget as the core functionality is the same the only difference might be "Hi welcome to BRAND/CLIENT chatbot" or a few other links mentioned in the bot.

Cheers,
Eilidh

You have to set the data now and we do not automatically store the url. So, something like:

 Genesys("command", "Database.set", {
messaging: {
		customAttributes: {
  				   genesys_url: window.location.href,
                   browser_language: navigator.language
				   }
	   }
});

Should give you 2 keys to retrieve with Get Participant Data. genesys_url (no context scope needed) will give you the current URL and browser_language will give you the current language to set in the bot. You could of course bypass the url bit and just use set values instead that are less likely to change as the web site develops. So, could be a key brand_context with a value like "retail" to check for in the bot. Would simplify logic. Any data can be passed like this using Database.set.

Run this code after the Web Messaging snippet.

The alternative is to use Predictive Engagement as the tracking data is available in Message.Journey as a set of values.

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