Skip to main content
Contributor IV
September 13, 2024

Discount based on Segment in campaign

  • September 13, 2024
  • 5 replies
  • 165 views

I am looking for a way to set up a campaign that will send a different discount code based on the user list or segment membership.

 

so members of segment 1 get a 10% discount

members of segment 2 get a 20% discount

everyone else get a 5% discount

 

Thank you,

Steve 

    This topic has been closed for replies.

    5 replies

    JacobM
    Problem Solver I
    Problem Solver I
    September 13, 2024

    Hi @2002faq sounds great - what issue are you facing?

    If you’re wondering how to make sure each segment only receives one promotion, you can include and exclude each segment when you send the campaign

    E.g. 20% discount, include Segment 2

    10% discount, include Segment 1, exclude Segment 2

    5 % discount, exclude Segment 1 & Segment 2

    2002faqAuthor
    Contributor IV
    September 13, 2024

    I wondered if there was a way to include some conditions within the campaign that list a code based on the user membership. I already have segments built. 

    JacobM
    Problem Solver I
    Problem Solver I
    September 15, 2024

    Oh right!

    Check out this article: https://mailchimp.com/help/use-conditional-merge-tag-blocks/

    In particular there’s a header called “Present special offers to customers”, which I think will do what you’re looking for. It does require a bit of “coding”, but if you let me know your segment we can puzzle it through together.

    2002faqAuthor
    Contributor IV
    September 19, 2024

    So, I found this page that helps with if statements and syntax in Klavio 

    I have tried 

    Use your Discount Code
    {% if segment = Kugelfischer %}
    {% coupon_code 'Kugelfischer10' %}
    {% elif segment = Turbo %}
    {% coupon_code 'Turbo15' %}
    {% elif segment = Alpina %}
    {% coupon_code 'Alpina20' %}
    {% else %}
    {% coupon_code 'All5' %}
    {% endif %}

     

    I al so tried with a property 

    Use your Discount Code
    {% if person.primary_group_name = Kugelfischer %}
    {% coupon_code 'Kugelfischer10' %}
    {% elif person.primary_group_name = Turbo %}
    {% coupon_code 'Turbo15' %}
    {% elif person.primary_group_name = Alpina %}
    {% coupon_code 'Alpina20' %}
    {% else %}
    {% coupon_code 'All5' %}
    {% endif %}

     

    These were in the text box in the template, but neither worked.

    Your help with this issue is greatly appreciated. 

    2002faqAuthor
    Contributor IV
    September 19, 2024

    I also tried 

    {% if person|lookup: 'primary_group_name' == Kugelfischer %}
    {% coupon_code 'Kugelfischer10' %}
    {% elif person|lookup: 'primary_group_name' == Turbo %}
    {% coupon_code 'Turbo15' %}
    {% elif person|lookup: 'primary_group_name' == Alpina %}
    {% coupon_code 'Alpina20' %}
    {% else %}
    {% coupon_code 'All5' %}
    {% endif %}
    Use your Discount Code
    {% if 'Kugelfischer' person|lookup: 'primary_group_name' %}
    {% coupon_code 'Kugelfischer10' %}
    {% elif 'Turbo' person|lookup: 'primary_group_name' %}
    {% coupon_code 'Turbo15' %}
    {% elif 'Alpina' person|lookup: 'primary_group_name' %}
    {% coupon_code 'Alpina20' %}
    {% else %}
    {% coupon_code 'All5' %}
    {% endif %}

    per https://developers.klaviyo.com/en/v1-2/docs/use-conditionals-in-messages#if-else-conditionals