# Create a channel-specific coupon campaign

> Let's imagine that we are targeting a young audience and want to give a discount to customers who redeem a valid coupon code on our mobile app. The discount is not applied if the coupon is redeemed on our website. This is useful for segmentation purposes.

> For the complete documentation index, see [llms.txt](https://docs.talon.one/llms.txt).

To do it, let's [create a standard campaign](/docs/product/campaigns/create-and-manage-campaigns.md#create-a-campaign-from-scratch)
where we will use a [customer session attribute](/docs/product/account/dev-tools/manage-attributes.md)
to identify the channel where the coupon is redeemed.

:::note
The [**Coupons** feature](/docs/product/campaigns/settings/manage-campaign-features.md) has
to be enabled.
:::

Let's create:

1. A customer session attribute to store the purchase channel.
1. A [promotion rule](/docs/product/rules/overview.md#promotion-rules) to issue a $20 discount when
   a valid coupon is redeemed on the mobile app.

:::tip
We can also create campaigns to give discounts to customers who buy in a certain store
or on a given date, for example. We just have to change the attribute type.
Check out [our tutorial on setting and using a custom attribute](/docs/product/tutorials/coupons/custom-attribute.md)
and our [Use geolocation](/docs/dev/tutorials/use-geolocation.md) tutorial.
:::

## Store the channel

:::note
To create a custom attribute, you need **Admin** permissions.
:::

Let's [create a custom attribute](/docs/product/account/dev-tools/manage-attributes.md#create-a-custom-attribute)
to store the channel chosen by our customer:

- Associated entity: `Customer Session`
- Attribute type: `String`
- API name: `purchasechannel`
- Rule Builder name: `Purchase channel`
- Rule Builder description: `The purchase channel chosen by the customer.`
- Picklist Values: `mobile app`, `website`, `physical store`

  :::note
  The attribute is set to these values by the integration layer. You can learn more about
  it in [our dedicated tutorial](/docs/product/tutorials/coupons/custom-attribute.md).
  :::
- Available in our Application.

## Issue a discount on the session total

Let's [build a rule](/docs/product/rules/create-and-manage-rules.md#create-a-promotion-rule) for
the customers to receive a $20 discount on the total value of their session when they redeem
a valid coupon on our mobile app at checkout.

Let's name the rule `Discount on mobile app`. It has two conditions and one effect.

### Conditions

- **Coupon code is valid**.
- **Check attribute value**: **Purchase channel (Current Session)** is equal to `mobile app`.

### Effect

**Discount session total**: **Name** is `20 with coupon` and **Discount value** is `20`.

## Related pages

- [Use geolocation](/docs/dev/tutorials/use-geolocation.md)
- [Discount a session based on purchase location](/docs/product/tutorials/coupons/custom-attribute.md)
- [Redeem a coupon code to issue a discount](/docs/product/tutorials/coupons/basic-coupon.md)
- [Create a gift card campaign](/docs/product/tutorials/coupons/giftcard.md)
