Skip to main content

Ecommerce & Retail · Shopify Apps

Shopify Conditional Triggers

We developed a micro-SaaS application with a custom script engine to deliver behavior-driven popups within the Shopify ecosystem.

Shopify Conditional Triggers
Focus
SHOPIFY, MICRO-SAAS, MVP, CUSTOM-WEB-APP
Delivered
09 Dec 2022
Location
Becedillas, Spain

Outcome

Generic popups replaced by offers tied to behaviour: 3 signals, views, session time and cart value, trigger unique discounts from a job queue.

The Vision & Challenge

The Shopify App Marketplace provides merchants with thousands of tools, but many solutions for lead capture rely on generic, disruptive popups. A micro-SaaS provider identified a gap for a more intelligent approach that respected the customer's journey and improved the quality of engagement.

The core problem was the static nature of existing tools. Popups triggered by simple timers or exit intent often feel intrusive and are ignored by shoppers. The partner envisioned a system that could instead interpret a user’s specific behavior on the site-such as products viewed, session duration, or cart value-to present a relevant offer at the precise moment it would be most effective.

Robust Devs was engaged to design and build the Minimum Viable Product from the ground up. Our work involved creating a lightweight storefront script, an intuitive merchant-facing dashboard embedded within Shopify, and the back-end infrastructure needed to connect with Shopify’s APIs for a complete, market-ready application.

The challenge

  • The client-side script had to track numerous user interactions without slowing down the merchant's storefront, as site performance is a critical factor in e-commerce.
  • The administrative interface needed to allow non-technical merchants to build complex conditional rulesets (e.g., if X and Y happen, then do Z) through a simple, visual builder.
  • The system required a reliable, asynchronous workflow to generate unique Shopify discount codes and trigger third-party email sends in real time based on user actions.

How we solved it

  • We built a lean JavaScript engine that loaded asynchronously, using efficient event listeners to track user behavior with minimal impact on page load times and store interactivity.
  • Using React and the Shopify Polaris design system, we developed an embedded app with a custom rule-building component, ensuring a familiar user experience for merchants.
  • A Laravel back-end managed API communication through a job queue. This decoupled front-end triggers from back-end actions, ensuring discount and email requests were processed reliably without delaying the user.
Three behavioural conditions drawn as overlapping sets: the shopper has viewed three items in one collection, their cart is currently over one hundred pounds, and they are still actively browsing rather than idle or leaving. Each condition alone describes a shopper who should be left alone. Only the centre, where all three hold at once, triggers the popup and its discount code. A lightweight asynchronous script tracks the behaviour without slowing the storefront, and merchants build these rulesets visually rather than in code.

Technologies

What we built it with

Front-end
  • JavaScript
  • ReactJS
  • HTML5
  • CSS3
Back-end
  • PHP
  • Laravel
DevOps
  • Linux
  • Digital Ocean
Database
  • MySQL
Also used
  • Shopify Polaris
Integrations
  • Shopify
Project screen

Conditional Logic Engine

At the core of the application is an engine that connects shopper behavior to merchant-defined actions. Merchants can set specific triggers, like a customer viewing three products in a collection or having a cart value over $100, and define a corresponding outcome, such as displaying a popup with a targeted offer. This allows lead capture to function as a relevant, timely interaction rather than a generic interruption.

Embedded Shopify Administration

Merchants configure and manage the entire system from within their Shopify dashboard. By using the official Shopify Polaris design system, the interface feels like a native part of the platform. This removes operational friction, making it simple for a store owner to create campaigns, view captured leads, and adjust settings without navigating to an external website.

How we built it

Kept the storefront script tiny and asynchronous, and moved every consequence onto a job queue. A behaviour engine that slows the page costs more sales than it creates. So the tracking script loads asynchronously and listens for products viewed, session duration and cart value with minimal impact on load time, and nothing heavy happens in the browser. When a rule fires, the request goes to a Laravel job queue that creates the unique Shopify discount code and triggers the email send reliably and out of band. Merchants build the if-this-and-that-then rules in a React and Polaris app, so the logic is theirs to change without a developer.

In the client's words

“I hate popups. This one waits until someone has actually looked at three products. Merchants build the rules, which is what I asked for.”

NDA - Signed

Have a project like this in mind?

Tell us what you're building. We'll show you how we'd approach it and what it would take to ship.