WooCommerce SMS journeys
Run Attentive-style ecommerce SMS on OutcomeOS: the site tag starts journeys; WooCommerce posts purchases so conversions count. SMS alone never marks an outcome achieved.
What Paras asked for → what you use
| Need | Outcome template | Workflow template | Verified by |
|---|---|---|---|
| Abandoned cart SMS | Recover abandoned carts within 24 hours | WooCommerce: abandoned cart SMS | order.paid |
| Welcome subscribe SMS | Convert welcome subscribers within 7 days | WooCommerce: welcome subscribe SMS | order.paid |
| Lists by product bought / upsell | Upsell buyers by product type within 14 days | WooCommerce: upsell by product type (clone per segment) | order.upsell_paid |
| Order tracking SMS | Confirm order delivery within 7 days | WooCommerce: order tracking SMS | order.delivered |
| Review request SMS | Collect product reviews within 14 days | WooCommerce: review request SMS | review.submitted |
| Conversion tracking | Built into each outcome (progress + optional amount) | Trusted API / signed webhook events only | |
| Campaign / workflow sequence | The workflow builder (delay, wait, branch, Twilio SMS) | ||
Easiest path (portal)
- Sign in → Integrations → WooCommerce → Set up SMS.
- Connect Twilio, enter your store brand name, click Install WooCommerce SMS.
- Copy the two snippets the portal shows (HTML site tag + WordPress PHP) and paste them on the store.
That creates all five journeys for any WooCommerce merchant. Manual template setup is only needed if you want a custom flow.
Manual setup (optional)
- Connect Twilio under Integrations (Account SID, Auth token, From number). Test until it shows connected.
- Create the outcome from Templates → matching Ecommerce SMS card (or Outcomes → New → template).
- Create the workflow from the matching WooCommerce template, link it to that outcome, edit SMS copy, Publish, set status Active.
- Copy the workflow webhook URL from the workflow page. Cart/welcome templates ship with signature off so the browser tag can post.
- Paste the site tag in WordPress (footer / WPCode):
<script
src="https://outcomeos.cloud/track.js"
data-webhook="https://app.outcomeos.cloud/hooks/w/wf_YOUR_CART_WORKFLOW"
data-subscribe-webhook="https://app.outcomeos.cloud/hooks/w/wf_YOUR_WELCOME_WORKFLOW"
data-brand="Your Store"
async></script>
/track.js is a static asset on the public site. Point data-webhook at your app host workflow URL (shown on the workflow page after publish).
What the tag sends
- Woo
added_to_cart/ cart updates →cart.updated(starts abandoned-cart workflow). - Forms with
data-outcomeos-subscribeor a checked SMS opt-in checkbox →sms.subscribed. OutcomeOS.identify({ phone, email, name })andOutcomeOS.track(event, props)from your own JS.
Phone/email are remembered in localStorage after checkout fields are filled. Without a phone, the abandoned-cart workflow skips SMS.
How SMS subscribe / sms.subscribed works
- Site tag must include
data-subscribe-webhookpointing at the welcome workflow (portal install fills this in). - Shopper submits a form marked
data-outcomeos-subscribe, or any form with a checked checkbox whose name containssms(e.g.sms_opt_in) and a phone field. track.jspostssms.subscribedto that webhook → welcome SMS workflow runs and the contact lands in the SMS subscribers audience preset.- You can also call
OutcomeOS.track('sms.subscribed', { phone: '+1…' })from custom JS.
Buyers who only appear from Woo order posts have a phone but are not automatically sms.subscribed — use the “Past buyers” / product-type audiences for those lists, and keep marketing consent on you.
Start post-purchase journeys (upsell / tracking / reviews)
Those three workflows listen on their own workflow webhook URLs (signature off). From WooCommerce, POST the order JSON to the matching URL when the status changes — that is what sends the SMS.
// Example: on status = completed / shipped, POST to the tracking workflow webhook
wp_remote_post('https://app.outcomeos.cloud/hooks/w/wf_TRACKING_WORKFLOW', [
'headers' => ['Content-Type' => 'application/json'],
'body' => wp_json_encode([
'id' => (string) $order_id,
'event_id' => 'woo_shipped_'.$order_id,
'phone' => $order->get_billing_phone(),
'email' => $order->get_billing_email(),
'tracking_number' => $tracking,
'tracking_url' => $tracking_url,
'review_url' => $review_url,
'upsell_url' => $upsell_url,
'product_types' => implode(',', $types),
'line_items' => $line_summary,
'total' => $order->get_total(),
'billing' => ['phone' => $order->get_billing_phone(), 'email' => $order->get_billing_email()],
]),
]);
Use the upsell workflow URL on processing/completed, tracking URL when you have a tracking number, review URL on delivered (or completed + delay in the workflow).
Prove purchases (required for conversion)
Separately, from WordPress (server-side — not the browser tag), post verified events with an API key from Settings → API keys so outcomes count and wait_for_event steps resume:
<?php
// functions.php or a tiny mu-plugin. Set OUTCOMEOS_API_KEY + OUTCOMEOS_ORIGIN + outcome ids in wp-config.
add_action('woocommerce_order_status_processing', function ($order_id) {
$order = wc_get_order($order_id);
if (!$order) return;
$phone = $order->get_billing_phone();
$types = [];
foreach ($order->get_items() as $item) {
$product = $item->get_product();
if ($product) foreach ($product->get_category_ids() as $cid) {
$term = get_term($cid, 'product_cat');
if ($term && !is_wp_error($term)) $types[] = $term->slug;
}
}
$body = [
'event_type' => 'order.paid',
'contact' => [
'phone' => $phone,
'email' => $order->get_billing_email(),
'name' => trim($order->get_billing_first_name().' '.$order->get_billing_last_name()),
],
'data' => [
'amount' => (float) $order->get_total(),
'order_id' => (string) $order_id,
'product_types' => implode(',', array_unique($types)),
],
'idempotency_key' => 'woo_order_'.$order_id.'_paid',
];
wp_remote_post(rtrim(OUTCOMEOS_ORIGIN, '/').'/api/v1/outcomes/'.OUTCOMEOS_CART_OUTCOME_ID.'/events', [
'headers' => [
'Authorization' => 'Bearer '.OUTCOMEOS_API_KEY,
'Content-Type' => 'application/json',
],
'body' => wp_json_encode($body),
'timeout' => 8,
]);
});
Also post order.shipped / order.delivered / review.submitted / order.upsell_paid to the matching outcome ids the same way. Those events resume wait_for_event steps and mark subjects achieved.
Product-type lists & campaigns
For one-off SMS (Attentive-style): open Audiences → create a list → Send campaign. Sends fan out over Cloudflare Queues (no hard size cap); the campaign page shows queued / sent / failed / rates. Contact product_types comes from Woo order posts. Automated journeys (welcome, cart, upsell) stay under WooCommerce SMS / Workflows.
Compliance
You own 10DLC / opt-in / STOP language with Twilio. Keep promotional SMS behind marketing consent; treat shipping updates as transactional where your counsel allows.
Smoke test
- Publish cart workflow + outcome; paste tag with a test phone via
OutcomeOS.identify({phone:'+1…'})in the console, thenOutcomeOS.track('cart.updated',{}). - Confirm an execution appears; after the delay, SMS sends (or shorten the delay for testing).
- POST
order.paidfor that phone — outcome subject becomes achieved and conversion value updates.