- Sector
- Fashion and accessories
- Market
- Bangladesh — BDT, cash on delivery
- Service
- Custom ecommerce build
- When
- June – November 2026
Store: faviaz.com
The problem
Orders were priced where the browser could reach them — the amount charged was the amount the customer's own page said it should be.
Payment success was believed rather than verified with SSLCommerz.
Customer-supplied text reached invoices and emails unescaped.
An admin route trusted the role the client claimed instead of checking the role it held.
Purchase events were inconsistent: some sales counted twice, some never arrived, and the ones that did could not be reconciled with the order table.
A stale init migration meant there was no clean database baseline to rebuild from.
What we did
- 1
Price and verify on the server
Orders are priced from the database, so nothing the browser sends can change what a customer pays. Every SSLCommerz callback is checked against the gateway before an order is marked paid.
- 2
Close the access holes
Customer input is escaped on the way into invoices and emails. Admin permissions are read per request instead of being trusted from a token issued earlier, and a schema baseline replaced the stale migration.
- 3
Rebuild the measurement layer
GA4 and Meta events fire from the server as well as the browser, so an ad blocker or a dropped pixel no longer erases a sale. Double counting was removed, GTM became the single source for GA4 with a fallback when no container is set, page_view is pushed to the dataLayer on in-app navigation, view_item_list was added, and the storefront event contract was written down.
- 4
Make the measurement explain itself
A tracking health panel shows which events fired, which did not and why, so a lost purchase names itself instead of surfacing a month later in a revenue report. Store email moved to Resend or any SMTP provider so confirmations stop depending on one vendor.
The result
Every purchase traces to an order row, whichever way the customer paid.
- Purchase events
- Server-side
- Storefront events
- 13
- Payment state
- Verified
- Build span
- 41 commits
GA4 and Meta CAPI alongside the browser tags, deduplicated on one event id
Documented in one contract so the store and the analytics property cannot drift
Checked against SSLCommerz rather than inferred from a redirect
9 June to 21 November 2026 — engineering counts, not commercial results
Faviaz sells handbags under its own name and domain, direct to customers in Bangladesh, where cash on delivery is the default and mobile is the storefront. The first build took six weeks and shipped to a droplet behind nginx, taking real orders the same week.
What followed is the part most stores never get to. A store that takes cash cannot afford to guess: if the purchase events are wrong, the ad platforms optimise on a fiction and the reporting cannot settle a single argument about where the money went.
The fix was not a plugin. Checkout, the payment callback and the event stream had to be treated as one system with one source of truth, and then instrumented so it could prove it was still true the following month.
Faviaz is a client build, not an FHAVI property: the store, the stock and the brand are the client's. It is the reference build for this work — a live, revenue-generating store in a market where cash on delivery and mobile-first traffic break the assumptions off-the-shelf analytics is built on.
