Text campaigns
Typically, bot scripts are used for processing incoming requests: the bot is launched only when the client sends a message in a channel where the bot is published: in a messenger, social network, or chat widget.
JAICP bots can also launch text campaigns — send messages to new clients or clients the bot talked to before. When you launch a campaign, the bot does not wait for the first message from a client and initiates the dialog itself. For example, the bot can send information on promotions and discounts, changes in your business operations, or announcements.
Text campaigns are supported in text-based channels only. They will not work in voice assistants, such as Google Assistant. You can also launch campaigns in the phone channel: refer to the Call campaigns section to find out more.
Campaign creation
To create a new text campaign:
- Open your bot project, go to the Text campaigns page and click Create text campaign.
- Configure the campaign settings and content.
- Launch the campaign.
Settings
Fill out the campaign name or leave the default one.
Select the channel where you want to launch the campaign. You can select any text-based inbound channel where the bot is already published.
In the Client list field, select All channel clients. This will target the campaign at all channel clients existing at the time when the campaign is launched.
tipRather than send campaigns to all channel clients, you can also target them at clients from a predefined list.If necessary, schedule the date and time when the campaign should start.
Content
Here you can configure the campaign content using the built-in editor. In the campaign, you can send any number of the following bot reactions:
- Text — a text message in the chat. Messages can be formatted using HTML markup.
- Image — an image that will be displayed in the chat. You can provide a link to an image available online or upload your own.
- Button group — one or several buttons. For each button, you can customize the text and (optionally) the link opened when the button is selected.
Launch
After configuring the campaign settings and content, click Create text campaign. This will either launch it immediately or schedule it for the specified time.
Campaign control
When the text campaign is launched, you can suspend it or terminate it prematurely . Suspended campaigns can be resumed at any moment. Additionally, through the context menu any campaign can be:
Duplicated. When duplicating a text campaign, you can edit any of its settings and content: for example, launch it in a different channel.
Edited. You can change any settings except for the channel type and the client list before you start the text campaign.
cautionText campaigns already started cannot be edited.Deleted. If you delete a campaign in progress, it will be terminated automatically. The report for this campaign will no longer be accessible.
Campaigns targeted at clients from a list
Rather than send campaigns to all channel clients, you can target them at clients from a predefined list. You will likely need this feature if:
- You want to target your campaign at a subset of the channel audience filtered by the necessary criteria.
- You want to employ cold marketing to attract clients who haven’t interacted with the bot before.
To target the campaign at clients from a list, create a list of clients in advance, then specify it during campaign creation.
Campaign script coding
When you set up the campaign content through the built-in editor, you are limited to three types of bot reactions. If overcoming this restriction is important for your needs, you can make use of a more advanced way to set up a campaign: code it as a separate script branch inside the bot script.
In such campaigns, you can make use of all JAICP DSL features: manage the dialog context to handle client reactions, implement business logic in JavaScript. A special method for campaign analytics is available as well.
Script example
In the script code, add a separate state triggered by an event that will activate the bot when the campaign is launched.
This event will occur in the channel and will be handled in the script via the event!
tag.
Add the campaign content to the same state.
You can also implement other states to configure the bot behavior for different client responses.
In any of these states, use the script
tag to call the $analytics.setTextCampaignResult
method and assign a result to the campaign.
This will allow doing analytics over the campaign and assessing how effective it is.
The example below shows a campaign script triggered by textCampaignEvent
.
If the client’s answer is matched by one of the intents, the campaign will be assigned the appropriate result.
state: TextCampaign
event!: textCampaignEvent
a: A 10% discount on all items if you register a bonus card! Are you interested?
state: Success
intent: /yes
a: Here’s your registration link: https://example.com
script:
$analytics.setTextCampaignResult("Campaign succeeded");
state: Failure
intent: /no
a: It’s a pity. Bye!
script:
$analytics.setTextCampaignResult("Campaign failed");
Event setup
When you create a text campaign for which you have set up a script, you don’t need to use the built-in campaign editor. Instead, fill out the Event name that will trigger the appropriate state.
Campaign list
All campaigns are displayed in a list sorted by the time of creation. The following information on each campaign is available:
Name.
The date of creation.
An ID unique within the account (for example,
#169
).tipClick the ID to quickly navigate to analytics over dialogs started with this campaign.Real-time progress:
*the number of the sent messages / the number of clients (the percentage of the campaign completion)*.Channel type.
The name of the list of clients whom the campaign targets.
The start and completion date and time.
Campaign reports
You can view and download reports on the results for each campaign. Reports include aggregate statistics over sessions based on their results:
If the
$analytics.setTextCampaignResult
method is called during the campaign, the session will fall into a group named after the value passed into the method.tipIf the method is called several times, the campaign result will be the value passed during the last call.Otherwise, the campaign result value will be No result.
Campaign statuses
A campaign can have one of the following statuses:
Status | Description |
---|---|
Created | The campaign has been created, the list of clients is still being processed. |
Scheduled | The list of clients has been processed, the campaign will start at the specified time. |
In progress | The campaign is in progress at the moment. |
Completed | The campaign is completed. |
Error | The campaign has not started due to problems when processing the list of clients. |