How to email / text Discount Code to a customer who made his first purchase

Hi,

We like to give a 10% discount to a customer who already completed the first purchase.

Hope we can create a discount in the Discounts section of Shopify.

Is it possible to show the discount code as a Pop Up / on Screen on the Thank you Page?

How can we send an email / text message with the same discount code?

Thanks,

Hey @paulson1 ,

Offering a 10% discount to customers who have completed their first purchase is an excellent strategy to encourage repeat business. Here’s how you can implement this in Shopify:

  1. Create a Discount Code:

-In your Shopify admin panel, navigate to Discounts and click on Create discount.

-Choose Discount code and enter a memorable code, such as WELCOME10.

-Set the discount type to Percentage and specify 10%.

-Under Applies to , select Entire order.

-In the Customer eligibility section, choose Specific customer segments and select the segment that includes first-time purchasers.

-Define the Usage Limits and Active dates as per your preference.

-Save the discount.

  1. Display the Discount Code on the Thank You Page:

To show the discount code directly on the Thank You page:

-Go to Settings in your Shopify admin, then select Checkout.

-Scroll down to the Order status page section.

-In the Additional scripts box, you can add custom HTML or JavaScript to display the discount code. For example:


  ## Thank You for Your Purchase!
  

As a token of our appreciation, here's a 10% discount on your next order:

  ### Use Code: WELCOME10

Save your changes.

By implementing these steps, you can effectively encourage repeat purchases and build stronger relationships with your customers.

If I was able to help you, please don’t forget to Like and mark it as the Solution!
Best Regard,
Rajat Sharma

Thank you for the solution.

This discount code will be displayed to everyone.

We want to display the discount code only to first time customers.

I was wondering how we can modify the code to identify the logged in user is a first time buyer.

Thanks

Hey @paulson1 ,

To display the discount code only to first-time customers on the Thank You page, you can use Shopify’s customer.order_count Liquid attribute. This attribute allows you to check if the logged-in customer has placed only one order, indicating a first-time buyer. Here’s how you can set this up:

1.Use Liquid Code on the Thank You Page to Identify First-Time Buyers:

In Shopify, you can edit the Order status page to add custom scripts that will only display the discount code to customers who have placed their first order.

-Go to Setting > Checkout in your Shopify admin.

-Scroll down to the Order status page section.

-In the Additional scripts box, add the following code:

{% if customer and customer.orders_count == 1 %}
  
    ## Thank You for Your First Purchase!
    

As a special gift, here’s a 10% discount on your next order:

    ### Use Code: WELCOME10
  

{% endif %}

This code checks if:

-The customer is logged in (customer).

-They have only completed one order (customer.order_count)

  1. Sending the Discount Code via Email or SMS:

To send the discount code to first-time customers only, follow these steps:

-Use Shopify Email or an app like Klaviyo to create an automated email campaign targeting customers who have just made their first purchase.

-For SMS, apps like PostScript allow you to set up automated messages for specific segments (e.g., first-time buyers).

This setup ensures that only first-time customers see the discount code on their Thank You page and receive it through email or SMS.

Could you please send me a message via email so we can discuss this further?

Thanks

Thank you so much @rajweb

@paulson1 ,

Thank you for your feedback! I’m thrilled to hear the solution worked well for you. If there’s anything more I can assist you with, please don’t hesitate to reach out—your satisfaction is my priority. Feel free to contact me via email anytime. And if you found this information helpful, a Like would be greatly appreciated. Thanks again!