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

NeedOutcome templateWorkflow templateVerified by
Abandoned cart SMSRecover abandoned carts within 24 hoursWooCommerce: abandoned cart SMSorder.paid
Welcome subscribe SMSConvert welcome subscribers within 7 daysWooCommerce: welcome subscribe SMSorder.paid
Lists by product bought / upsellUpsell buyers by product type within 14 daysWooCommerce: upsell by product type (clone per segment)order.upsell_paid
Order tracking SMSConfirm order delivery within 7 daysWooCommerce: order tracking SMSorder.delivered
Review request SMSCollect product reviews within 14 daysWooCommerce: review request SMSreview.submitted
Conversion trackingBuilt into each outcome (progress + optional amount)Trusted API / signed webhook events only
Campaign / workflow sequenceThe workflow builder (delay, wait, branch, Twilio SMS)

Easiest path (portal)

  1. Sign in → Integrations → WooCommerce → Set up SMS.
  2. Connect Twilio, enter your store brand name, click Install WooCommerce SMS.
  3. 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)

  1. Connect Twilio under Integrations (Account SID, Auth token, From number). Test until it shows connected.
  2. Create the outcome from Templates → matching Ecommerce SMS card (or Outcomes → New → template).
  3. Create the workflow from the matching WooCommerce template, link it to that outcome, edit SMS copy, Publish, set status Active.
  4. Copy the workflow webhook URL from the workflow page. Cart/welcome templates ship with signature off so the browser tag can post.
  5. 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

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

  1. Site tag must include data-subscribe-webhook pointing at the welcome workflow (portal install fills this in).
  2. Shopper submits a form marked data-outcomeos-subscribe, or any form with a checked checkbox whose name contains sms (e.g. sms_opt_in) and a phone field.
  3. track.js posts sms.subscribed to that webhook → welcome SMS workflow runs and the contact lands in the SMS subscribers audience preset.
  4. 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

  1. Publish cart workflow + outcome; paste tag with a test phone via OutcomeOS.identify({phone:'+1…'}) in the console, then OutcomeOS.track('cart.updated',{}).
  2. Confirm an execution appears; after the delay, SMS sends (or shorten the delay for testing).
  3. POST order.paid for that phone — outcome subject becomes achieved and conversion value updates.