How to use Shopify Customer Segments for Discounts and Campaigns

Get Laser Focused on Your Customers with Segments

If you're running a Shopify site and you're not using Shopify's Customer Segments, then you're missing a powerful tool to target your customers. This built-in feature helps you automatically break your customer list into smaller groups. You can then communicate directly to this subset of customers and focus on discounts or promotions that match their specific needs. Instead of blasting the same discount to everyone, you can send the right offer to the right people. That’s how you turn casual shoppers into repeat buyers. Creating segments is an important part of marketing to your customers. Treating every customer the same might seem easier, but it means you’re missing out on ways to make your marketing more effective. Using customer segments is the secret you need to make this happen.

A customer segment is a group of customers who share something in common. It could be how often they buy, how much they spend, where they live, or even what products they prefer. For example, using segmentation, you can automatically group your high-spending customers into an exclusive VIP group, or maybe create a group of people who haven’t bought anything in the past 90 days. Creating these segments gives you a focused audience, with specific needs–this makes your marketing efforts much easier. You’re then able to launch email campaigns featuring a message that resonates with just that segmented audience. Instead of sending one message to everyone, you can tailor your offers to match what each group cares about most. Whether you want to drive more sales, increase customer loyalty, or reduce abandoned carts, segments give you the ability to do it right from your Shopify store.

Let’s explore how you can create and utilize segments in your shop. We'll also talk about using AI to help with segmentation ideas.

Creating Segments in Shopify

Shopify makes it super easy to build customer segments right from your store admin. There are even some default templates you can use or change to suit your needs. If you’re not sure how to make your own segments, the templates are a great starting point because you’re able to edit any of them and learn as you tweak. And once you create a segment, they update automatically as new customers meet the rules you’ve set. You don’t have to keep uploading lists or exporting data, it updates in the background. 

To create a segment, go to your Customers section in the Shopify admin. This page will show any existing segments and give you the option to create a new segment. From there, choose “Create segment” to start working on your own custom segment. The “Segment Builder” uses ShopifyQL (Shopify Query Language) to create the rules for the segment. 

ShopifyQL is a special search language built into Shopify that helps you create customer segments by using simple rules. Think of it like telling Shopify what kind of customers you want to group together using plain instructions. You don’t need to be a developer or know any complicated code. ShopifyQL is designed to be easy and it helps you hit the right audience every time. The queries are basically a set of rules that create filters and variables to fetch data from your store. If you’re not familiar with creating queries, you may want to review the help documentation to get the hang of it:

https://help.shopify.com/en/manual/reports-and-analytics/shopify-reports/report-types/shopifyql-editor

As you start typing in the Segment Builder, Shopify will give you suggestions and hints for crafting the correct query. The hints provide access to predefined queries and filters to create things like total spend, number of orders, location, or even the date of their last purchase. Once you start typing (or using the templates) you’ll quickly see that it’s merely a series of logical commands. For example, let’s look at the query to create a segment of only customers in California. The query looks like this:

FROM customers

SHOW customer_name, note, subscription_status, location, orders, amount_spent

WHERE customer_regions CONTAINS 'US-CA'

ORDER BY updated_at 

If we analyze the syntax of the query, you can see the four main logical parts that make up the request. The FROM, SHOW, WHERE and ORDER BY. With these four parts, you can create rules to request any customer segment. Let’s breakdown each part:

  • FROM: This tells Shopify the source of the data. In this case, you want data “from” your customers.
  • SHOW: This is where you decide what fields you want to see in the results. In our example, we want the customer name, note, status, location, order count and total spent. You can adjust these values to retrieve only the data you want to see.
  • WHERE: This is the clause you will refine the most as it sets the rules for what data you actually want to extract. You want to extract data “where” the fields match this clause.
  • ORDER BY: This is where you set the field for sorting the data.

Let’s dissect another example. This time, let’s focus on customers who’ve purchased a specific product. The query looks like this:

FROM customers

SHOW customer_name, note, subscription_status, location, orders, amount_spent

WHERE products_purchased MATCHES (id = 9895705510072)

ORDER BY updated_at

You can see that everything is the same except for the “WHERE” clause. By simply changing the text in this section, you can request a whole different set of customers. If it still feels a bit daunting, start with the templates until you get the hang of it. You find yourself creating your own queries in no time.

So, once you’ve created the different segments, what can you do with them? Let’s review creating discounts and email campaigns targeted at your specific customer segments.

Using Segments for Discounts

Creating discounts targeted to specific customers is one of the smartest ways to use segmentation. It lets you offer the right deal to the right customer without giving away too much to everyone. Instead of sending a 20% discount to your entire list, you can limit it to high-value customers who are more likely to buy again. This strategy helps protect your profit margins while still giving your customers a reason to come back. It feels more personal as customers only see promotions that match their specific needs. Using segments in this way makes your marketing smarter. But did you know this actually helps you save money? 

When you send a discount to your entire customer list, you’re offering a deal to people who might have bought at full price anyway. That means you’re giving away revenue you didn’t need to. But when you limit a discount to a specific segment, you’re focusing on people who are more likely to need an extra incentive to come back. You’re not wasting margin on loyal customers who would have shopped without a discount. Instead, you're using your marketing budget where it has the highest return. This type of targeted discounting helps you drive conversions while protecting your bottom line. Now that we know the benefit of these discount segments, let’s create some in your Shopify admin. 

Shopify lets you make discount codes that apply to specific customer segments. This means only that specific group can take advantage of the discount. You can simply choose any of your segments when crafting the discount code. It’s important to note that segment targeting is not available for all discount types. You’ll need to experiment with the different types of discount options in the admin. For example, you cannot apply a segment to “automatic discounts.” Shopify requires a discount code in order to set the eligibility options for customer segments. 

When you set up a new discount code in Shopify, you’ll see an Eligibility option to “Limit to specific customer segments.” By selecting this option, Shopify will limit the usage of that code to only the customers who match the selected segment. You will see a drop-down list of all the segments in your system. Pro tip: create your segments before you create the discount code otherwise you won’t see it in your list. 

One of the best things about using customer segments for discounts is that only the customers who match the criteria will be able to use the code. Even if someone else sees the code, like if it’s shared on social media or in a group where it doesn’t belong, Shopify will automatically block it at checkout for anyone who isn’t in the approved segment. That means you don’t have to worry about the wrong people using your offer or abusing the discount. It protects your promotions from leaking. This gives you full control over who can actually redeem the discount. Run more secure campaigns and ensure your margins are safe.

Segmentation isn’t just for discounts, you can use it to create smart email and promotional campaigns. Let’s focus on this use case next.

Using Segments for Email Automations and Campaigns

These same segments can also be used in your email campaigns, especially if you’re using Shopify Email or an integrated marketing tool like Klaviyo. That means you can send promotions to just one segment instead of your full list. Now your messages can speak directly to that group’s behavior. Instead of writing one generic email that tries to speak to everyone, you can create a message tailored to that group. By using segments, you’re sending less emails and better emails. This leads to higher open rates, more clicks, and more conversions, because people are only getting messages that actually matter to them. That’s why segmentation is a key part of building stronger relationships and making campaigns work for your business.

So what type of segments should you create to pull off this marketing magic? Let’s say you're trying to bring back customers who haven’t ordered in a while, you can send them a win-back message with a limited-time offer. Or, if you’re reaching out to VIP customers, you can give them early access to a new product launch. You can also target customers in specific regions and send details about products that make sense for their geographic weather needs. 

Shopify features an “Automations” tool that uses your customer segments to send personalized messages. With automations, you can reach specific customers using the segments you’ve already set up. There are a ton of great pre-existing Automation templates that will generate the Shopify Flow workflows to manage the emails. You can choose one of the templates or modify one to make it your own. 

Go to the Marketing tab in your Shopify admin and click on Automations. This is where you’ll set up workflows based on triggers and conditions using different templates. Once you’ve picked your template, you’ll go into the automation editor. Here you’ll see the trigger (what starts the automation) and the actions (what happens next). Click on the trigger step to set it to start when someone enters a specific customer segment. Finally, select the segment you created earlier. This means that anytime a customer enters that segment, based on your defined rules, the automation will begin for them.

Can AI Help?

It wouldn't be a blog article in 2025 if we did mention AI somehow (ha ha) so, what can AI do to help with segmentation? Actually, AI is great for this type of pattern and analysis. Use AI to create customer segments by analyzing customer behavior, purchase history, demographics and engagement data. You can then build dynamic groups for your targeted marketing.

Analyze Purchase Behavior

AI can scan order history and spot patterns like customers who buy certain products regularly, spend above a threshold, or purchase seasonally. You can then group these people into meaningful segments like “high spenders,” “repeat buyers,” or “holiday shoppers.”

Demographic and Location Targeting

AI is perfect for finding demographics or geographic data based on IP or shipping info. You can do a real time analysis or review your order history to find geographic data. This helps you create location-based segments (like city or state) without needing customers to fill out forms.

Automate With Shopify Flow or Apps

You can use apps like Shopify Flow or Klaviyo that use AI under the hood to auto-generate smart segments. These apps monitor real-time behavior and adjust segments dynamically, so your targeting evolves with your customers. Using Shopify's native Flow app, you use some the existing templates to generate the groups.

Become a Marketing Pro with Shopify Segments 

Hopefully by now you can see how powerful Segments can be for your Shopify store and marketing. We’ve only touched on a few of the most obvious examples. You will probably quickly see how segments can be tailored for your specific store and industry. Show your customers that you understand who they are and what they need. This kind of connection builds loyalty and keeps people coming back.

So, if you’ve been sending the same offer to everyone, now’s the time to change that. Start building your segments in Shopify, create a few exclusive discount codes just for them, and try a personalized email campaign. You’ll see how much more effective your marketing can be when it speaks directly to the right people.

Contact us if you need help with your Shopify Customer Segments.