In Web2Chat, you can customize how the Messenger is launched on your website or mobile application. By creating a custom launcher, you can trigger the Messenger to open when a user interacts with a specific button, link, or any other element that fits seamlessly with your site's design.
Creating a Custom Launcher on Your Website
To set up a custom launcher on your website, follow these steps:
- Identify the HTML Element:Choose the HTML element (e.g., a link or button) that you want to use to open the Messenger. Assign a unique
id
orclass
to this element.Example:html
CopyEdit<a id="my_custom_launcher" href="#">Contact Us</a>
- Modify the Web2Chat Settings:
- Locate the Web2Chat initialization script on your website.
- Add the
custom_launcher_selector
property to theweb2chatSettings
object, specifying the selector for your custom launcher.
Example:javascript
window.web2chatSettings = { app_id: 'YOUR_APP_ID', custom_launcher_selector: '#my_custom_launcher' };
Replace'YOUR_APP_ID'
with your actual Web2Chat application ID. - Disable the Default Launcher (Optional):If you prefer to use only your custom launcher and hide the default Messenger icon, add the
hide_default_launcher
property to theweb2chatSettings
object.Example:javascript
window.web2chatSettings = { app_id: 'YOUR_APP_ID', custom_launcher_selector: '#my_custom_launcher', hide_default_launcher: true };
By following these steps, clicking on the element with the
id
my_custom_launcher
will open the Web2Chat Messenger.If you need further assistance, contact our Customer Support.