First steps
User Data
- Responsive Email Editor Review
- Designing your email
- Creating Synchronized Modules
- Setting Responsivity
- Building Smart Containers
- Creating a Gmail Promotions Annotation
- Adding The Rollover Effect
- Adding Anchor Links
- Module Library
- Adding a Table to an Email
- Adding Custom Fonts
- Creating CTA Button
- Working with Images
- Using AI in the Email Editor
Omnichannel
- Setting Up Widgets for Your Site
- Widget Calling
- Setting Up Locations for the Widget Calling Rules
- Storing data from widgets to contact fields
- Using Annoyance Safeguard
- Actions After Form Submission
- Replacing Double Opt-In System Workflow
- Using Yespo Extension for Google Chrome
- Creating Pop-ups via Google Tag Manager or WordPress
- Sending Yespo Widget Events to Google Analytics
- Using A/B Tests for Widgets
Automation
- Double Opt-In
- Welcome Сampaign
- Welcome Series Segmented by Category
- Launching a Workflow After a Contact Import
- Regular Workflow for a Segment
- Birthday Campaign
- Linking Workflow to the Button
- Using Variables from Order in Workflow
- Collecting Order Feedback
- Customer Reactivation
- Sending Extra Campaigns
Personalization
Analytics
- Email Campaign Report
- Web Push Campaign Report
- Viber Campaign Report
- Mobile Push Campaign Report
- App Inbox Campaign Report
- Widget Report
- Triggered Campaign Report
- AMP Campaign Report
- SMS Campaign Report
- Multilingual Campaign Report
- Setting up UTM Tags
- Revenue from Campaigns
- Tracking Campaign Performance in Google Analytics
Multilanguage Campaigns
Events and Behaviour Tracking
Recommendations
API
Security and Compliance
Integration
Connecting PostgreSQL
Some companies use several platforms to collect and manage customer data. Thus, sometimes you need to add to messages certain content based on customer data tracked or stored at third-party platforms, such as an external CRM, mobile application, database, etc. For example, you want to add to an email personalized product recommendations based on offline sales or orders made via calls and need access to this data.
To access data from third-party sources and use it for content substitution, use a preprocessor or connect to external data sources, such as Google Sheets, BigQuery or PostgreSQL.
Connection to PostgreSQL would be the most optimal option if you need to
- add extra fields for segmentation by contact fields;
- configure seamless synchronization of content component;
- get extra data on contacts in order to build precise segments based on specific conditions.
1. Set up a connector.
1. Go to your personal profile > Settings > Connectors > and select Connect PostgreSQL.
2. Fill in all fields:
- Name. Required.
- Host. Can be the domain name of the remote server or its IP address.
- Port. Entered automatically by default.
- Database. Name of the database on a remote server.
- Username. User's database login (read only user role is enough). Required.
- Password. Required.
You may click Validate connection to test whether authorization data is entered correctly. In case of a successful connection, the corresponding service notification will appear in the top right corner. If the connection failed, check the entered data and contact your system administrator if needed.
3. In Set unique contact field, select a table column that contains a unique contact key and our system's unique contact key. They should match.
For example, you choose Email. After connection, the column of the PostgreSQL table with email addresses will be mapped to the corresponding field in the system.
Aside from email addresses, uniqueness of contacts can be determined by a phone number, external ID or additional contact field.
Important
The created connector can be used to connect to several data sources. All of them will have the same unique contact key so it’s recommended to use one key in all tables. To use a different key, then create another connector to the same database and set a different unique contact field.
4. Click Save.
2. Configure a data source.
Your external database may contain several tables, and you need to select which one you want to connect to.
1. Go to your personal profile > Settings > Data sources, click New data source and select External data source.
2. Select the created connector.
3. Select dataset and table and enter a source name. Click Save.
4. Now, import contacts to our service and fill the external source with data.
Now you can build segments based on the imported contact fields.
Important
Connection to the external database doesn’t presuppose contact import. Segmentation is only available for contacts that exist both in your account and in the external database. Synchronize and update contacts before creating campaigns.
3. Add data to a message.
To insert data, you need to reference it using a Velocity parameter $!data.get(‘source_name’). As an example, we will be using the created source with the name promo_codes.
Bulk campaign to a segment
For example, you plan a campaign to a contact kozak@example.com.
A set of data will be extracted from the table and inserted into an object:
{
"data": {
"promo_codes": [
{
"id": "2",
"email": "kozak@example.com",
"name": "Dina Kozak",
"birthday": "2020-09-02T00:00:00Z",
"promo_code": "AAAA-BBBB-DDDD"
}
]
}
}
Fields of the array promo_codes can be referenced in two ways:
- With parameters (if you know the number of parameters in the array).
$!data.get('promo_codes').get(0).get('name')
$!data.get('promo_codes').get(0).get('promo_code')
- With a loop (most common method).
#foreach($pc in $!data.get('promo_codes'))
$!pc.get('name')
$!pc.get('promo_code')
#end
Triggered campaign
First, you need to create a dynamic segment with certain conditions. For example, your segment will include only contacts who have a birthday today.
When the workflow is triggered for contacts that match this condition, the system generates the event. The name of the event is formed from the static part (regularEventType) and the segment ID the campaign is sent to. It can be, for example, regularEventType-170531841.
The event contains contact data, contact ID in our platform (ContactId), email address (EmailAddress), and data from an external table.
The data from each table field is converted into a key and is placed in an array with a numerical name that corresponds to the ID of the data source.
In turn, this array is serialized and placed as a string in the field jsonParam. The body of the event may look as follows:
{
"params": [
{
"name": "ContactId",
"value": "623927159"
},
{
"name": "jsonParam",
"value": "{\"1043\":[{\"id\":,\"email\":\"kozak@example.com\",\"name\":\"Dina Kozak\",\"birthday\":\"2020-09-02T00:00:00Z\",\"promo_code\":\"AAAA-BBBB-DDDD\"}]}"
},
{
"name": "EmailAddress",
"value": "kozak@example.com"
}
]
}
To deserialize a string into a set of objects, in the workflow > block Email > JSON specify the data source from the event - ${jsonParam}.
Having set up the workflow, configure triggers:
The same approach as for a bulk campaign is used to extract data from the event, with little difference in the name of the array. The following object will be in the email:
{
"data": {
"1043": [
{
"id": "2",
"email": "kozak@example.com",
"name": "Dina Kozak",
"birthday": "2020-09-02T00:00:00Z",
"promo_code": "AAAA-BBBB-DDDD"
}
]
}
}
The fields of the array 1043 can be referenced in two ways:
- With parameters (if you know the number of parameters in the array).
$!data.get('1043').get(0).get('name')
$!data.get('1043').get(0).get('promo_code')
- With a loop (most common method).
#foreach($pc in $!data.get('1043'))
$!pc.get('name')
$!pc.get('promo_code')
#end
Connect PostgreSQL as an external data source to fulfill a wide range of marketing tasks, for example, substitute promo codes in triggered campaigns or build complex segments based on data collected on different platforms.
Step 4. Set up Data Export
To regularly update information about the audience, orders and campaign results in PostgreSQL, set up data export from the Yespo to tables. For example, you can export responses to an NPS survey, purchase history, date of the last click in a message, etc.
Available datasets for export:
- workflowInstanceId — the identifier of a particular workflow launch; use it to group mailings within the launch of a workflow;
- contactActivities;
- contacts;
- orderItems;
- orders;
- revenue.
List of Data Export Parameters
ContactActivities
Parameter | Type | Description |
---|---|---|
activity | string | Activity status:
|
broadcastId | int | Broadcast ID |
campaignType | string | Campaign type:
|
clickEventLink | string | Contains the link clicked by a contact (when the status is CLICKED) |
contactId | int | Contact ID in Yespo (Internal) |
errorCode | string | Delivery error SMTP and description |
eventKey | string | Event key |
eventTypeKey | string | Event type key |
externalCustomerId | string | Contact ID in your system (External) |
mediaType | string | Media type (Sms, Email, WebPush, Viber, MobilePush, AppInbox, Widget) |
messageInstanceId | int | Service field |
messageLanguageCode | string | Message language code |
messageName | string | Message name in Yespo account |
messageTags | string | Message tags |
messageURL | string | Contains the link to the email web-version |
senderName | string | Viber sender name |
started | timestamp | Day and time of message sending (format: '2021-10-08 11:11:02') |
utmCampaign | string | Campaign UTM |
workflowId | int | Workflow ID |
workflowInstanceId | int | The identifier of a particular workflow launch. Use it to group mailings within the launch of a workflow. |
Contacts
Parameter | Type | Description |
---|---|---|
contactId | int | Contact ID in Yespo (Internal) |
contactSource | string |
Contact source:
|
createdDate | timestamp | Contact creation date and time (format: '2021-10-08 11:11:02') |
string | Contact email | |
emailDomain | string | Email domain |
emailStatus | string | Email status |
externalCustomerId | string | Contact ID in your system (External) |
firstName | string | Contact first name |
languageCode | string | Contact language code |
lastClickedDate | timestamp | Day and time of the last click (format: '2021-10-08 11:11:02') |
lastName | string | Contact last name |
lastReceivedDate | timestamp | Day and time of the last delivery (format: '2021-10-08 11:11:02') |
lastSentDate | timestamp | Day and time of the last sending (format: '2021-10-08 11:11:02') |
lastViewedDate | timestamp | Day and time of the last opening (format: '2021-10-08 11:11:02') |
sms | string | Phone number |
totalClicked | int | Total clicks amount |
totalReceived | int | Total received messages amount |
totalSent | int | Total sent messages amount |
totalViewed | int | Total viewed messages amount |
OrderItems
Parameter | Type | Description |
---|---|---|
cost | float | Product price |
description | string | Product description |
externalProductId | string | External product ID |
imageUrl | string | Product image link |
name | string | Product name |
orderDate | timestamp | Order creation date (format: '2021-10-08 11:11:02') |
orderId | int | Order ID in Yespo (Internal) |
quantity | int | Number of products |
url | string | Product URL |
Orders
Parameter | Type | Description |
---|---|---|
contactId | int | Contact ID in Yespo (Internal) |
deliveryAddress | string | Delivery address |
deliveryMethod | string | Delivery method |
discount | float | Discount |
string | ||
externalOrderId | string | External order ID |
firstName | string | Contact first name |
lastName | string | Contact last name |
orderCreatedDate | timestamp | Date of order creation in Yespo (format: '2021-10-08 11:11:02') |
orderDate | timestamp | Order creation date (format: '2021-10-08 11:11:02') |
orderId | int | Order ID in Yespo (Internal) |
paymentMethod | string | Payment method |
phone | string | Phone number |
status | string | Order status:
|
totalCost | float | Total order cost |
Revenue
Parameter | Type | Description |
---|---|---|
activity | string |
Activity status:
|
campaignType | string | Campaign type:
|
clickEventLink | string | Contains the link clicked by a contact (when the status is CLICKED) |
contactId | int | Contact ID in Yespo (Internal) |
currency | float | Currency |
externalCustomerId | string | Contact ID in your system (External) |
externalOrderId | string | External order ID |
mediaType | string | Media type of the message (Sms, Email, WebPush, Viber, MobilePush, AppInbox) |
messageInstanceId | int | Service field |
messageName | string | Message name in Yespo account |
messageTags | string | Message tags |
messageUrl | string | Contains the link to the email web-version |
orderDate | timestamp | Order creation date (format: '2021-10-08 11:11:02') |
senderName | string | Viber sender name |
started | timestamp | Day and time of message sending (format: '2021-10-08 11:11:02') |
totalCost | float | Total order cost |
utmCampaign | string | Campaign UTM |
This information will be transferred to PostgreSQL and will update the data in the tables.
Important
You don’t need to pre-create PostgreSQL tables. They will be generated automatically at the first export, and since that all the incoming data will be updated. All the table names will correspond to the data sets (contact activities, contacts, order items, orders, revenue)
Setting up PostgreSQL connector for data export
1. Go to Settings → Data export and click New data export. Select one of the created PostgreSQL connectors.
2. Select upload interval and check the boxes for the data sets you want to upload. The data set type by default is public, you can select another type if you have specified it in your PostgreSQL settings.
Click Save.
The connection will be displayed in the Data export section, here you can edit its settings.