# Apply code to get gift

With this feature, you can let customers unlock gifts by entering a **discount code directly in the cart page or cart drawer**. When the code is applied and the campaign conditions are met, the gift is **automatically added to the cart**.

> Note: This option is currently supported only for stores using the **Horizon theme**. If your theme does not support discount code entry in the cart drawer, the option will be disabled and please contact us for integration

### Applicable Campaign Type

* Buy X Get Y

### How to Set It Up

#### Step 1. Create a Campaign

1. From your app dashboard, click **Create Campaign**.
2. Choose **Buy X Get Y** as the campaign type.

#### Step 2. Configure Gift Code

1. In the display settings, scroll to **Gift selection method**.
2. Select **Apply code to get gift**.
3. You’ll see a **gift trigger code** (default is `AOVAI_XXXXXX`).
4. Edit this code if you want to customize it (e.g., change to `SPRINGSALE`).

#### Step 3. Save Campaign

1. Click **Save campaign**.
2. You’ll see a success message:

   > “Campaign saved successfully. Gift code is now active.”
3. The system will display instructions showing your active gift code and how to use it.

<figure><img src="https://1289686769-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMo81Ak7Ig0Z6bLRmWpSA%2Fuploads%2FZRlfgjoAQWpnNJAo6rE5%2Fimage.png?alt=media&#x26;token=d21e0131-b5e5-41c7-ab28-e5e0a3e88417" alt=""><figcaption></figcaption></figure>

***

### Customer Experience

1. Customer adds qualifying products to their cart.
2. In the cart drawer/cart page, the customer enters your gift code (e.g., `SPRINGSALE`) in the discount code field.
3. If the code is valid and the conditions are met, the gift will **automatically appear in the cart**.

***

### Theme Compatibility

* **Horizon theme**: Supported. Customers can enter codes directly in the cart drawer.
* **Other themes**: Not supported.
  * The option will be disabled in settings.
  * You will see a tooltip:

    > “This option is not supported on your current theme. Please chat with our support team to connect with technical expert team.”

***

### Best Practices

* Use simple and memorable codes (e.g., `FREESHIRT`, `WINTERGIFT`).
* Share the code clearly in your marketing campaigns so customers know how to unlock their gift.
* Test the feature on your store before going live to make sure the gift is applied correctly.

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.aov.ai/advanced-settings/apply-code-to-get-gift.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
