Marketing
Overview
The Marketing feature helps Siyahfy vendors reach their customers through multiple channels. It includes Google Analytics integration for traffic and conversion tracking, WhatsApp marketing via the Wonestop API for direct customer messaging, and abandoned cart recovery workflows. Vendors can view marketing performance data broken down by channel and time period, and send targeted messages to recover lost sales.
How It Works
Marketing Analytics
The analytics dashboard pulls data from Google Analytics (GA4) and internal order data to show:
| Metric | Source |
|---|---|
| Sessions | Google Analytics |
| Conversion Rate | Google Analytics |
| Revenue | Google Analytics + Internal orders |
| Average Purchase Revenue | Google Analytics |
| Channel Attribution | Google Analytics (UTM tracking) |
Data is fetched daily from GA4 and stored in hourly_marketing_reports for fast dashboard rendering.
WhatsApp Marketing
Siyahfy integrates with Wonestop (a WhatsApp Business API provider) to enable:
- Settings configuration — Vendor connects their Wonestop API token and phone number.
- Template management — Create and manage WhatsApp message templates (must comply with Meta’s template policies).
- Campaign sending — Send marketing messages to customer segments.
- Test messages — Send a test message before launching a campaign.
- Campaign analytics — Track delivery, read, and response rates.
Abandoned Cart Recovery
When customers leave items in their cart without completing checkout:
- The system records the abandoned checkout with cart details and customer info.
- After a configurable delay (e.g., 1 hour, 24 hours), a recovery message is sent.
- Messages can be sent via email or WhatsApp.
- The message includes a link to restore the customer’s cart.
- If the customer completes the order, the abandoned checkout is marked as recovered.
Key API Endpoints
Marketing Analytics
WhatsApp Marketing
Abandoned Cart Recovery
Database Tables
| Table | Purpose |
|---|---|
hourly_marketing_reports | Cached marketing data from Google Analytics (date, hour, sessions, revenue, channel) |
whatsapp_marketing_settings | WhatsApp API configuration per store (API token, phone number) |
whatsapp_templates | WhatsApp message templates |
whatsapp_campaigns | Campaign records with delivery and engagement stats |
abandon_checkouts | Abandoned checkout sessions with cart data, customer info, and recovery status |