# Award loyalty points for share a social media post

> You can reward your customers with loyalty points for different actions, such as following your company profile on social media or sharing a blog post. We can use custom events to represent those actions.

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

Let's imagine that we are an outdoor gear brand and want to involve our clients in a campaign
to strengthen our brand on social media. To do this, we [create a standard campaign](/docs/product/campaigns/create-and-manage-campaigns.md#create-a-campaign-from-scratch)
to give customers 25 loyalty points if they share one of our posts on a given social network.
Customers will only be able to use the points within 14 days of receiving them.

This campaign can be useful to gain visibility and increase sales and customer engagement.

Let's create:

1. A custom event to capture the sharing of the social media post.
1. A [promotion rule](/docs/product/rules/overview.md#promotion-rules) to award 25 loyalty points
   to customers who share the social media post. The points will be valid for 14 days.
1. A promotion rule for customers to spend their loyalty points in our online store when their
   point balance is equal to or greater than the session total.
1. A promotion rule for customers to spend their loyalty points in our online store when their
   point balance is less than the session total.

:::note
Create at least one [profile-based loyalty program](/docs/product/loyalty-programs/profile-based/create-pb-programs.md),
and the [**Loyalty** feature](/docs/product/campaigns/settings/manage-campaign-features.md)
has to be enabled.
:::

## Share a social media post

All incoming data in Talon.One is connected to an event. Talon.One provides [default events](/docs/dev/concepts/entities/events.md)
to capture customer profile and session updates.

In our case, we want to capture the action of a customer clicking the **Share** icon of
the social media post.

Because this action is not related to a customer session or profile, we cannot use a default
event to capture this action. Let's [create a custom event](/docs/dev/concepts/entities/events.md#create-an-event)
instead:

- Associated entity: `Event`
- Event type: `Post sharing`
- Attribute type: `Boolean`
- API name: `post_sharing`
- Rule Builder name: `SM post sharing`
- Rule Builder description: `A customer shares a social media post.`
- Available in our Application.

When the customer clicks the **Share** button, the website sends a request to the [Track event V2](/integration-api/#tag/Events/operation/trackEventV2) endpoint.

## Award loyalty points to customers who share the post

Let's [build a rule](/docs/product/rules/create-and-manage-rules.md#create-a-promotion-rule) for
our customers to receive a 25 loyalty points if they share the social media post.

Let's name it `Points for sharing`. It has one condition and one effect.

### Rule 1: Condition

**Check for event types and custom event values:**

- **Event type** is `post_sharing`.
- `SM post sharing` is `True`.

### Rule 1: Effect

**Add loyalty points**:

- We select the loyalty program we have created. Let's imagine that it is called `Social media loyalty`.
- **Recipient** is `Current Customer`.
- **Reason** is `Post sharing`.
- **Amount of points** is `25`.
- **Points settings** > **Expiry date** is **Custom**: `14 day(s) after the start date`.

## Pay for an entire order with loyalty points

Let's build a rule for our customers to use their loyalty points on new orders in our online
store when their loyalty point balance is equal to or greater than the total value of the
session.

Let's name it `Paying with loyalty points`. It has one condition and one effect.

### Rule 2: Condition

**Check attribute value**: **Current balance (`Social media loyalty`) is greater than or
equal to** `Session total (current session)`.

### Rule 2: Effect

**Discount session total**: **Name** is `Pay with points` and **Discount value** is `[Session.Total]`.

## Pay part of an order with loyalty points

Let's build a rule for our customers to use their loyalty points on new orders in our online
store when their loyalty point balance is less than the total value of the session.

Let's name it `Spend loyalty points`. It has one condition and one effect.

### Rule 3: Condition

**Check attribute value**: **Current balance (`Social media loyalty`) is less than**
`Session total (current session)`.

### Rule 3: Effect

**Discount session total**: **Name** is `Discount for points` and **Discount value** is
`Current balance (Social media loyalty)`.

## Related pages

- [Create a point-based loyalty campaign](/docs/product/tutorials/loyalty/loyalty-points-program.md)
- [Incentivize share of product links](/docs/product/tutorials/referrals/incentivize-product-link-share.md)
