Cross channel Auto-Pop With Initial Message and Intent using Quiq Chat SDK

Overview

This is an advanced recipe that makes use of several Quiq feature’s to support a landing page that will start a chat across Webchat, SMS, or Apple Business chat based on the device the end user is on. An example use case for this is if you want to provide a campaign link inside of an email that goes to a landing page you host and starts a relevant conversation seamlessly.

Contact Point Configuration

1. Set up a Contact Point to be enabled for Web Chat, SMS, and Apple Messages.

2638

2. Set your Web Chat settings Mobile Options to the phone number you want to use for SMS and the Business ID you want to use for Apple Messages

2704

3. Under the Welcome Form section add an “Other” unbound field and mark it as being an initial message.

2088

At this point you can use Quiq’s Chat SDK to have a “chat with us” button on any page you want that will automatically prefer the richest experience for all of your end users in the following ways:

  • If the user is on an iPhone or iPad, and they click the chat button their iMessage app will launch and their conversation will occur over Apple Business Messaging.
  • If the user is on a non-iOS mobile device (i.e. Android) and they click the chat button their SMS related app will launch
  • If the user is on a computer, and they click the chat button the web chat iFrame will show and be used to chat with your agents

Web Page Javascript Configuration

As mentioned above if you include Quiq’s Javascript library on your webpage your end users will now get the richest possible experience over the native messaging apps their device supports.

This can be done with minimal Javascript:

<script src="https://<tenant>.quiq-api.com/app/webchat/index.js" charset="UTF-8"></script>
<script>
var chat = Quiq({
  contactPoint: 'test'
});
</script>

Auto-Pop With Initial Message Javascript

Quiq’s Web Chat SDK supports populating registration form data using Javascript. It also supports automatically popping the chat window (or appropriate messaging app). To do this go to your hidden welcome form field you created above, click the gear icon, and select Copy Field ID.

519

You can set this field’s value in your Javascript to whatever you want. If the user is on a computer this will send that message in and start the conversation over webchat. If the user is on a mobile device it will pop their messaging app and set the Text Message area of that app to be the value you specified as well.

Example Javascript:

var chat = Quiq({
  contactPoint: 'test',
});

chat.setChatRegistrationField(
  'customField0',
  'Hi! I have a question and am excited to use messaging to talk with you.',
);
chat.toggle();

Passing in Intent

Many platforms support passing in an intent when you start a conversation. Quiq’s Javascript SDK also supports this. You can set this intent as part of the chat context options.

This works great for you to pass a user identifier and/or a campaign identifier in. You can then use webhooks, the agent SDK, or a bot to condition off of this identifier or to look something up in your backend system and update the conversation accordingly.

Example Javascript (with intent set):

var chat = Quiq({
  contactPoint: 'test',
  context: {
    intent: 'SOME_CAMPAIGN_ID_1234',
  },
});

chat.setChatRegistrationField(
  'customField0',
  'Hi! I have a question and am excited to use messaging to talk with you.',
);
chat.toggle();

🚧

⚠️ NOTE

Intent can not be passed through on SMS (the carriers don’t provide a way to do this). In this case we recommend you infer intent based on the contact point used and the initial message being sent in.

Ideas of how to use this

Link based opt-in

By creating a landing page like above you can send email’s to your contacts with a link asking them to opt-in to messaging with you. You can even include a tracking id, look stuff up in your backend, and populate the contactPoint, Initial Message, and Intent based off of your backend data. For example your initial message could say: ‘This is Billy Bob (Account #1234) and I would like to receive future notifications over messaging.’

Campaign Tracking

By creating a landing page like above you can include links in your Google search results, email campaigns, etc. This tracking ID can be passed in as an intent value and will be stored on the conversation. This is passed through to our webhooks where you can track campaign success and failure rates.

To see more details of what Quiq’s Javascript SDK supports please refer to the Quiq Web Chat Developer’s Page