Running a Large Number of Campaigns with Shopify Functions

Multiple Functions

A Shopify function only can contain so much information. Once you exceed ~20 campaigns (active or inactive) we may need to use multiple Shopify Functions to accurately store all of your campaign data.

This means that you will have several functions operating independently. Each function will return its own result, and will apply stacking logic only to the campaigns stored within that function.

When configuring a campaign's stacking settings, you will see the names of the other campaigns it can stack with.

When the functions run on your store, Shopify will choose the single result with the maximum benefit, and apply that discount to the order.

For example:

  1. Function A holds campaign 1 (10% discount) and campaign 2 (15% discount). Both are set to stack

  2. Function B holds campaign 3 (30% discount) also set to stack

If a user is eligible for all the above campaigns, Function A will return a stacked discount (10% + 15%) and Function B will return a single discount (30%)

Because the result from Function B has a greater benefit (30% > 10% + 15%) only the result from Function B will apply to the order.

How many functions can I use?

If you are using checkout.liquid you can only have 1 active discount function with an 'automatic' application method (this is the type of function our campaigns use). Otherwise, Shopify allows for a maximum of 5.

However, this number isn't scoped to just the Intelligems app - every automatic discount, whether it's created by another app or Shopify, counts against this total.

If there are any campaign(s) that we couldn't find function space for, we'll highlight them in red. These campaigns will not run on your store. In order to make room so they will run, you can remove any non-Intelligems automatic discounts, or remove other Intelligems campaigns.

Last updated