Create a process that allows to send messages only to unique phone numbers
This use case presents a solution to prevent sending the same message to the profiles who have the same phone number. Sharing the same phone number by profiles may happen for example, when a person leaves the company and a new employee takes over a work phone with the phone number of the previous employee; or when a person creates two accounts with different personal data but the same phone number.
The core idea of this use case is to check the database for the same phone number and ensure that only one message is sent out when multiple profiles have the same number. This solution is designed to save costs and ensure that profiles do not receive unnecessary messages.
The assumption of this use case is importing all customers with unique phone numbers and enabled marketing agreement in the SMS channel to a catalog. All these customers will have a phone_unique
tag assigned to them. Then, every time a customer enables SMS marketing agreement a workflow will verify whether the phone number for this customer is unique. If so, it will be tagged with phon_unique
.
phone_unique
tag for addressing recipients in mass campaigns to all customers (for example, general information about important changes that do not contain personalization). It is not necessary for real-time campaigns, especially those triggered by specific user behaviors and activities such as entering a page, purchasing, and so on, because there is a small probability of sending the same message several times to one number. However, this risk is high with large and mass shipments.
It is important to be careful with the personalization of such messages, especially without additional verification of ness of the phone number.Prerequisites
- Create a catalog in Synerise in which you will store customers with unique phone numbers
This will allow you to select customers with a phone_unique
tag as the recipients of your future SMS campaigns - this way you will make sure each customer won’t receive the same message several times.
-
In Data Management > Profile Tags, add the following tag:
phone_unique
It will be used later in the process. -
Create a workspace API Key which you will use in the process.
Process
In this use case, you will go through the following steps:
- Create a segmentation to group customers who have a phone number assigned and enabled marketing agreement in the SMS channel.
- Create a workflow which sends the customers from the segmentation to the catalog.
- Download the file with customers from the catalog.
- Transform data in the file: add a column with a
phone_unique
tag, removeitem_key
column, and rename theid
column. - Create a workflow which imports the modified file with customers to Synerise.
- Create a workflow that verifies uniqueness of the phone number and assigns a tag to a customer.
- Create a workflow that deletes a tag when a customer withdraws consent for receiving SMS.
Create a segmentation
In this part of the process, you will create a segmentation of customers who have a phone number and enabled a marketing agreement in the SMS channel.
- Go to Analytics > Segmentations V2 > New segmentation.
- Enter the name of the segmentation.
- From the Add condition dropdown list, select the
phone
attribute. - Click the Choose button, and from the list of operators, choose Boolean, and then select Is true.
- From the Add condition dropdown list, select the
SMS agreement
attribute. - Click the Choose button, and from the list of operators, choose Boolean, and then select Is true.
- Save the segmentation.
Create a workflow which sends the customers from the segmentation to the catalog
In this part of the process, you will create a workflow that imports customer data (phone number) to a file and sends it to the catalog you created as a part of prerequisites. The data will be deduplicated, which means the catalog will contain only unique phone numbers.
- Go to Automation > Workflows > New workflow.
- Enter the name of the workflow.
Define the Scheduled Run trigger node
At this stage, configure the conditions that trigger the workflow.
- As the trigger node, select Scheduled Run.
- In the configuration of the node:
- Change the Run trigger option to one time.
- Choose the Immediately option.
- Confirm by clicking Apply.
Select customers to export
In this part of the process, select a segmentation of customers you created in the previous part of the process. Then, you will select the attribute (phone
) whose value will be exported to a catalog in further steps.
-
Add the Get Profiles node.
-
In the configuration of the node:
- Select the segmentation you created in the previous step to extract customers’ data.
- In the Attributes section, select phone.
- Confirm by clicking Apply.
Add the Import to Catalog node
In this part of the process, select a catalog to which the customer data will be imported.
- Add the Import to Catalog node.
- In the configuration of the node:
- Select the catalog created as a part of the prerequisites to which the data will be imported.
- In the Primary key field, enter the
phone
attribute. - Confirm by clicking Apply.
Prepare the final settings
- Add the End node and connect it to the Import to Catalog node.
- Optionally, add titles to each node so the workflow will be more understandable to your colleagues.
- Activate the workflow by clicking Save & Run.
Result: The data will be sent to a catalog and de-duplicated during import.
Export the file from the catalog
In this part of the process, you will download the file you imported to the catalog.
- Go to Data Management > Catalogs.
- Choose the catalog from the list.
- To download the file with your data, click Download CSV .
In the next step, you will use the exported file to create a data transformation rule which you will use further in the process in the Data Transformation node.
Transform data
In this part of the process, you will perform the following modifications to the file:
- remove the
item_key
column - rename the
id
column toclientId
- add the
tags
column with thephone_unique
value
- Go to Automation > Data Transformation > Create transformation.
- Enter the name of the transformation.
- Click Add input.
Add file with sample data
The Data input node allows you to add a file to be modified. In further steps, you define how the data in the file will be modified (transformation rules). Later, when this transformation is used in the workflow in the Data Transformation node, the system uses the rules to transform a file selected in the workflow.
- On the pop-up, click Add example.
- Upload the file exported in the previous step.
- Click Apply.
Remove column
Use the Remove columns node, which allows you to remove the item_key
column.
- On the Data Input node, click the grey dot.
- From the dropdown list, select Remove columns.
- In the configuration of the node:
- Leave the Remove Columns option selected in the dropdown menu.
- Leave the default value in the dropdown (Equal).
- In the text field, enter
item_key
. - Confirm by clicking Apply.
Rename column
In this part of the process, change the name of the id
column to clientId
.
- On the Filter column node, click the grey dot.
- From the dropdown list, select Rename column.
- Click the Rename column node.
- In the configuration of the node:
- Click Add rule.
- Click Add column.
- Select the id column.
- Under Edit values by, from the dropdown list, select Replacing.
- In the text field, enter
clientId
. - Confirm by clicking Apply.
Add the new column
In this part of the process, you will add the new tags
column with the phone_unique
value.
- On the Rename Column node, click the grey dot.
- From the dropdown list, select Add column.
- Click the Add column node.
- In the configuration of the node:
- In the Add column field, enter the name of the column. In this use case, it’s
tags
. - From the dropdown list, select Static value.
- In the value box, enter
phone_unique
. - Leave Handle incomplete data at default (Skip row if error occurred) to skip missing or invalid data which may occur during transformation.
- Confirm by clicking Apply.
- In the Add column field, enter the name of the column. In this use case, it’s
Add the finishing node
This node lets you preview the output of the transformation rules applied to the file.
-
On the Add column node, click the grey dot.
-
From the dropdown list, select Data Output.
-
To preview the results, click the Data Output node.
-
Close the preview
-
In the upper right corner, click Save and publish.
Create a workflow which imports the modified file with customers to Synerise
In this part of the process, you will create a workflow that applies transformation rules you created in the previous part of the process to the file with customers data and import the modified file to Synerise. As a result, the profiles will be updated.
- Go to Automation > Workflows > New workflow.
- Enter the name of the workflow.
Define the Scheduled Run trigger node
At this stage, you will define the conditions that launch the workflow.
- As the trigger node, add Scheduled Run.
- In the configuration of the node:
- Change the Run trigger option to one time.
- Choose the Immediately option.
- Confirm by clicking Apply.
Select file to import
Select the file you exported in part of the process.
- Add the Local File node.
- In the configuration of the node:
- Upload the file.
- Confirm by clicking Apply.
Add Data Transformation node
Select a data transformation rule you created in this part of the process.
-
Add the Data Transformation node.
-
In the configuration of the node, select the data transformation you have created before.
-
Confirm by clicking Apply.
Add import profiles and finishing node
In this part of the process, you will import the transformed file with customers to Synerise.
- Add the Import Profiles node.
- Add the End node.
- In the upper right corner, click Save & Run.
Create a workflow that verifies uniqueness of the phone number and assigns a tag to a customer
In this part of the process, you will create a workflow that is launched when a customer enables marketing agreement in the SMS channel. The workflow checks whether the phone number is unique, if so the customer is assigned with a phone_unique
tag and the catalog which stores unique phone numbers is updated.
- Go to Automation > Workflows > New workflow.
- Enter the name of the workflow.
Define the trigger node
The workflow is triggered by Profile Event where the triggering event is profile.updated
with the profile.receivesmses
parameter which is set to true.
- Add the first node - Profile Event. In the node configuration:
- From the Choose event dropdown list, choose the profile.updated event.
- Click button.
- From the Choose parameter dropdown list, select profile.receivesmses.
- From the Choose operator dropdown list, select Is true(Boolean).
- Click Apply.
Add the Profile Filter node
In the next stage, using the Profile Filter node, you check if the customer already has the phone_unique
tag and phone number. You take into account customers who have phone but do not have the phone_unique
tag.
-
Add the Profile Filter node.
-
In the settings of the node, choose Profiles > Attributes and select the
phone_unique
tag. -
As Operator, choose Boolean - Is true and nd modify the “Profile
matching
attribute” to “not matching
attribute.” -
Click Choose filter and select the attribute
phone
. -
As the Operator, choose Boolean - Is true.
-
Click Apply.
-
For the Not Matched path, add the End node .
-
Click Apply.
Configure the Outgoing Integration node
In this part of the process, you will send a request to retrieve all items from the catalog to check if the phone number exists in the catalog.
- To the Matched path, add the Outgoing Integration node. In the configuration of the node:
- Choose Custom webhook.
- In the Webhook name field, enter
getPhoneFromCatalog
. - In the URL section:
- Choose the GET method.
- Enter the following endpoint:
https://api.synerise.com/catalogs/bags/XXXX/items?itemKey={{client.phone}}
, replaceXXXX
with the ID of your catalog.
- As the method of authorization, select by API key.
- From the dropdown list, select the API key you created as a part of prerequisites.
- Click Apply.
Configure the Event Filter node
The workflow will wait for the webhook to return the value of the body.metaData.totalCount parameter. If it’s other than 0, the workflow will end. If it is 0, the profile will be updated with the phone_unique
tag.
- As the next node, add Event Filter. In the configuration of the node:
- In the Check field, from the dropdown menu choose for period of time.
- Set the time range. In our case, it is 5 minutes.
- In the Define conditions field, from the Choose event dropdown menu, choose
webhook.response
event. - Click the + where button and select
name
. - As the logical operator, select Equal (String).
- As the value, add the name of the event used in the previous node:
getPhoneFromCatalog
. - Click the + where button and select
body.metaData.totalCount
. - As the logical operator, select Equal (Number).
- As the value, add
0
.
- Click Apply.
- For the Not matched path, add the End node .
Add the Update Profile node
- For the Matched path, add the Update Profile node.
- From the dropdown list, select phone_unique tag.
- Leave the right dropdown list at default (Add).
- To save the changes, click Apply.
Configure the Outgoing Integration node
In this step, your catalog with unique phone numbers will be updated.
- Add Outgoing Integration node. In the configuration of the node:
- Choose Custom webhook.
- In the Webhook name, enter
addPhoneToCatalog
. - In the URL section:
- Choose the POST method.
- Enter the following URL:
https://api.synerise.com/catalogs/bags/XXXX/items?itemKey={{client.phone}}
, whereXXXX
is the ID of your catalog.
- In the Body section, enter:
{ "itemKey": "{{client.phone}}", "value": { "id": "{{client.id }}", "phone": "{{client.phone}}" } }
- As the authorization method, select by API key.
Add the finishing node
- Add the End node.
- In the upper right corner, click Save & Run.
Result:
Create a workflow that deletes a tag when a customer withdraws consent for receiving SMS
The next step is to create a workflow that will be triggered when a customer withdraws their consent. The workflow has similar structure to the previous one. What changes here is the trigger, instead of Profile Event, you will use the Audience node that is repeatedly triggered, for example everyday, at a certain time.
- Go to Automation > Workflows > New workflow.
- Enter the name of the workflow.
Define the trigger node
The workflow is triggered for specific group of customers every date at a define time.
-
Start the workflow with the Audience node.
-
In the configuration of the node, set the Run trigger option to repeatable.
-
Set the interval to 1 per day.
-
Choose the day and time when the process starts.
-
Select the time zone.
-
In Define audience, choose New Audience and click Define conditions. Our audience will be a group of users who has
phone_unique
tag and change their sms agreement.- As the first condition, from the Choose filter dropdown menu, choose
phone_unique
attribute. - Choose operator as Is true (Boolean).
- As the second condition, from the Choose filter dropdown menu, choose the
SMS agreement
attribute. - Choose operator as Equal (String) and add the value. In our case it will be
false
.
- As the first condition, from the Choose filter dropdown menu, choose
-
Click Apply.
Add the Profile Filter node
In the next stage, using the Profile Filter node, you check if the customer has the phone_unique
tag and phone number.
-
Add Profile Filter node.
-
In the settings of the node choose Profiles > Attributes and select the tag
phone_unique
. -
As the Operator, choose Boolean - Is true.
-
Click Choose filter and select the attribute
phone
. -
As the Operator, choose Boolean - Is true.
-
Click Apply.
-
For the Not Matched path, add the End node .
Configure the Outgoing Integration node
In this part of the process, you will send a request to retrieve all items from the catalog to check if the phone number exists in the catalog.
- To the Matched path, add the Outgoing Integration node. In the configuration of the node:
- Choose Custom webhook.
- In the Webhook name field, enter
getPhoneFromCatalog
. - In the URL section:
- Choose the GET method.
- Enter the following endpoint:
https://api.synerise.com/catalogs/bags/XXXX/items?itemKey={{client.phone}}
, replaceXXXX
with the ID of your catalog.
- As the method of authorization, select by API key.
- From the dropdown list, select the API key you created as a part of prerequisites.
- Click Apply.
Configure the Event Filter node
The workflow will wait for the webhook to return the value of the body.metaData.totalCount parameter. If it’s equal 0, the workflow will end, because it means that the number is not in the catalog and no need to remove the tag since the number was not unique and the workflow ends. If it’s 1, it means the number exists in the catalog because it was unique and the workflow must go on.
- As the next node, add Event Filter. In the configuration of the node:
- In the Check field, from the dropdown menu choose for period of time.
- Set the time range. In our case, it is 5 minutes.
- In the Define conditions field, from the Choose event dropdown menu, choose
webhook.response
event. - Click the + where button and select
name
. - As the logical operator, select Equal (String).
- As the value, add the name of the event used in the previous node:
getPhoneFromCatalog
. - Click the + where button and select
body.metaData.totalCount
. - As the logical operator, select Equal (Number).
- As the value, add
1
.
- Click Apply.
- For the Not matched path, add the End node .
Add the Update Profile node
- For the Matched path, add the Update Profile node.
- From the dropdown list, select phone_unique tag.
- Click the right dropdown list and select Remove.
- To save the changes, click Apply.
Configure the Outgoing Integration node
In this step, you will remove a customer with their phone number from the catalog.
- Add the Outgoing Integration node. In the configuration of the node:
- Choose Custom webhook.
- In the Webhook name field, enter
removePhoneFromCatalog
- In the URL section:
- Choose the DELETE method.
- Enter the following URL:
https://api.synerise.com/catalogs/bags/XXXX/items/{{event.params['body.data[0].id']}}
, whereXXXX
is the ID of your catalog.
- As the authorization method, select by API key.
- From the dropdown list, select the API key you created as a part of prerequisites.
- Click Apply.
Add the finishing node
- Add the End node.
- In the upper right corner, click Save & Run.
Result:
Check the use case set up on the Synerise Demo workspace
You can check the:
- segmentation configuration
- workflow configuration
- data transformation
- workflow which imports modified file with customers back to Synerise
- workflow which updates the customer’s profile
- workflow that deletes a tag when a customer withdraws consent for receiving SMS directly in Synerise Demo workspace.
If you don’t have access to the Synerise Demo workspace, please leave your contact details in this form, and our representative will contact you shortly.