If you are familiar with Shopify automatic discounts, you're likely aware of a key limitation. They can't target specific customer segments. This means that even though you can create discounts that automatically apply at checkout without the need for customers to enter a code, these discounts would apply to all customers in the database.
Unlike automatic discounts, Shopify (non-automatic) discount codes allow you to target tagged customers segments with a built-in setting. So, as a workaround, you can create one of these segment-specific discount codes and automatically push it to checkout with a code solution added to the theme. Making of it a sort of an automatic discount for tagged customers. As a condition for it to work, the customer will need to previously login and the segment you target will need to be based on an existing customer tag to create the liquid conditional.
customer_tags CONTAINS 'custom_tag'
Now add a code in the theme files that will automatically apply the code to checkout:
</body>
tag in the code editor and paste the below script just before it. Replace 'custom_tag' and 'CUSTOMCODE' with your actual values. This script applies the discount only to logged-in customers with the 'custom_tag' tag.
This Automatic Discounts For Tagged Customers solution pushes the discount code after the tagged customer logs-in and browse any page on your site. But it doesn't work if customers log in directly on the checkout page because Shopify restricts scripts on the checkout page. To help mitigate this issue, it's a good idea to nudge your customers to sign in and examine their account details before proceeding to checkout. Doing so can also provide them an opportunity to explore discounts and other profile information and tools you consider relevant.
Check our app, Customer Accounts, a comprehensive solution that replaces the account page with a widget that contain custom integrations and content. Including dynamic content based on customer tags (like tag-based discounts). It also features different plugins to upgrade the customer experience. Like a Loyalty Program to create a variety of discounts within a points-based system. Coupled with Custom Forms for collecting additional data that you can use to tag your customers. And many more: Social Login, Wishlist, Order Management,... Find more details in Shopify's App Store.