# Can you combine Shopify Functions with email capture and popups? Rules, timing and conflicts

Source: https://returnsift.com/blog/2026-12-04-can-you-combine-shopify-functions-with-email-capture-and-popups-rules-timing-and-conflicts.html

Pairing · 2026-12-04


Short answer: yes, Shopify Functions and email capture and popups can run on the same store, and most stores in this niche run both. The work is in the overlap: the popup's first-order code is a promise the checkout has to keep, and in the functions era that promise is kept or broken by discount combination settings.

## How Shopify Functions works

Functions are Shopify's server-side logic layer: code an app ships that Shopify runs when a cart or checkout is evaluated, covering discounts, bundle building through cart transforms, payment and delivery customisation, and validation rules that can block a checkout outright.

## How email capture and popups works

Capture tooling converts anonymous traffic into an owned audience: popups and embedded forms that trade a first-order incentive for an email address or phone number, feeding the welcome flow where the address starts paying for itself.

## What the evidence says about Shopify Functions

Discount functions follow the combination rules set in the admin: whether two discounts can combine is a store setting, not something the function decides on its own.

A function takes a GraphQL input query describing the cart and returns JSON instructions. It never touches the page, which is why it is upgrade-safe where script tags were not.

Shopify Scripts stopped running on June 30, 2026, so discount and shipping logic that lived in a store's Ruby scripts had to be re-expressed as functions, usually one function per app rather than one file per store.

## And about email capture and popups

Accessibility rules apply to the modal itself: focus has to move into the popup when it opens and back when it closes, and the keyboard cannot be trapped inside it. Most popup apps get this wrong out of the box.

Google has demoted mobile pages with intrusive interstitials since January 2017, and a popup that covers the main content on arrival is the named example. Timing and trigger are not cosmetic choices.

A first-order code handed out in a popup leaks to coupon sites within days, after which the store pays the discount to buyers who were already at checkout with a full basket.

## Where Shopify Functions goes wrong on its own

Carrying every Script-era rule into functions unchanged is the standard mistake. A decade of accumulated discount rules includes promotions nobody remembers approving, and the migration is the one natural moment to delete them. Stores that skip the audit rebuild the mess on better infrastructure.

## Where email capture and popups goes wrong on its own

Three interruptions in the first screen, popup, chat bubble, review widget sliding in, is the failure buyers describe when they call a store desperate. Each tested fine alone. Together they tax the visit before the product gets a hearing.

## Where they collide

The popup's first-order code is a promise the checkout has to keep, and in the Functions era that promise is kept or broken by discount combination settings. A code that used to stack with everything under Scripts-era rules can silently stop stacking when the store's discounts are rebuilt as functions.

## The order practitioners run them in

When discounts move to functions, re-test every live popup code against the new combination rules before the popup's owner notices in the capture numbers.

## A check you can run this week

Test functions the way they will fail: on the largest cart, the stacked-discount cart and the B2B cart, not the tidy three-item test cart every demo uses.

Related reading: [Does Shopify Functions help with reverse logistics cost? What the evidence and practitioners say](https://returnsift.com/blog/2026-12-02-does-shopify-functions-help-with-reverse-logistics-cost-what-the-evidence-and.md) and [Does email capture and popups help with reverse logistics cost? What the evidence and practitioners say](https://returnsift.com/blog/2026-12-03-does-email-capture-and-popups-help-with-reverse-logistics-cost-what-the-evidence-and.md).

## Frequently asked questions

### Can you combine Shopify Functions with email capture and popups?

Yes, with the overlap managed. The popup's first-order code is a promise the checkout has to keep, and in the Functions era that promise is kept or broken by discount combination settings. A code that used to stack with everything under Scripts-era rules can silently stop stacking when the store's discounts are rebuilt as functions.

### What breaks first when Shopify Functions and email capture and popups run together?

The popup's first-order code is a promise the checkout has to keep, and in the Functions era that promise is kept or broken by discount combination settings. When discounts move to functions, re-test every live popup code against the new combination rules before the popup's owner notices in the capture numbers.

### Which do you set up first, Shopify Functions or email capture and popups?

When discounts move to functions, re-test every live popup code against the new combination rules before the popup's owner notices in the capture numbers.

### What is the most common mistake with Shopify Functions in this pairing?

Carrying every Script-era rule into functions unchanged is the standard mistake. A decade of accumulated discount rules includes promotions nobody remembers approving, and the migration is the one natural moment to delete them. Stores that skip the audit rebuild the mess on better infrastructure.
