Segment.io with BoxNCase and example destinations
A great example of Segment.io's strength is how easily you can build a workflow with external tools without writing a single line of code.
Abandoned baskets workflow with Segment.io & customer.io
Below you will find an example of an e-mail campaign for abandoned baskets. Usually companies want to build a workflow like that to be able to bring back customers who might have forgotten to finish their shopping. This involves waiting some time after someone has started adding products to their basket and sending an e-mail unless the order has been finalized.
Note: in BoxNCase we use the concept of checkout instead of a basket.
The steps required to get the workflow running.
Overview
Send checkout events from your storefront to Segment, map the fields for Customer.io, and cancel the reminder when an order is completed.
Install Segment
Set up Segment using the configuration guide.
Storefront → Segment
You first want to make sure Segment is able to receive events from the storefront.
Configure your storefront with your Segment write key. Keep customer credentials out of public environment variables.
Customer.io event mapping in Segment
In order for Customer.io to "understand" the data sent from Segment we need to configure the field mappings. Map the checkout identifier, customer identifier, currency, total, and product fields from your actual event payload.
Customer.io campaign workflow
In Customer.io, trigger a campaign on the checkout event, wait for your chosen reminder interval, and send a reminder only if the matching order has not completed.
Customer.io e-mail template
And in the e-mail template you can use the fields related to the basket someone has has in progress.
Example e-mail template for completed order:
Your order has been completed!
Order id: {{event.order_id}}
Total: {{event.total}} {{event.currency}}
Shipping: {{event.shipping}} {{event.currency}}
Products in order:
{% for product in event.products %}
{{ product.name }} x {{product.quantity}} x {{product.price}} {{event.currency}}
{% endfor %}
Example template for order that hasn't been completed yet:
Your order hasn't been completed yet!
Go back to our store to complete the purchase.
Products in basket:
{% for product in event.products %}
{{ product.name }} x {{product.quantity}} x {{product.price}} {{event.currency}}
{% endfor %}