> For the complete documentation index, see [llms.txt](https://because.gitbook.io/because/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://because.gitbook.io/because/the-because-platform/campaign-setup/how-to-use-dynamic-text-tokens.md).

# How to Use Dynamic Text Tokens

With these tokens, you can automatically display:

* **Live inventory counts**
* **Personalized visitor details**
* **Current cart totals**
* **Dynamic discount codes**
* **Real-time pricing & promotions**

***

### **Where to Find Dynamic Text Tokens**

1. **Go to the Campaign Text Editor** in Because.
2. **Highlight any text** where you want to insert dynamic content.
3. In the **text editor toolbar**, click on the **{D} button**.
4. A dropdown menu will appear, showing all available **Dynamic Text Tokens**.
5. Click on a token to insert it into your campaign text.

🚀 **Because will automatically update the text in real-time** based on the visitor, product, or cart data!

***

### **Available Dynamic Text Tokens & What They Do**

#### **Inventory & Pricing Tokens**

* **Inventory Left** → \*\*\*\*`{|product.inventory|}` \*\*\*\*Displays current stock levels (e.g., “Only **5 left in stock!**”).
* **Product Price** → `{|product.price|}` \*\*\*\*Shows the product’s live price (e.g., “$49.99”).
* **Compare at Price** → `{|product.compare_at_price|}` Displays the original price before a discount (e.g., “Was **$79.99**”).
* **Discounted Price** → `{|product.discounted_price|}` \*\*\*\*Shows the final price after a discount is applied.
* **Compare at Price Discount** → `{|product.compare_at_price_discount|}` \*\*\*\*Displays the discount amount based on the original price.

#### **Visitor & Cart Tokens**

* **Visitor Country** → \*\*\*\*`{|viewing_user.country|}` \*\*\*\*Displays the visitor’s country (e.g., “Hey there, shopper from **Canada!**”).
* **Current Cart Total** → `{|viewing_user.cart_total|}` \*\*\*\*Shows the visitor’s cart total in real-time (e.g., “Your cart total: **$85.00**”).
* **Close to Free Shipping** → `{|round(50 - viewing_user.cart_total)|}` \*\*\*\*Displays how much more the visitor needs to spend to qualify for free shipping (e.g., “You’re **$10 away** from free shipping!”). Simply replace the “50” with your Free Shipping minimum.
* **Discount Code** → `{|discount_code|}` \*\*\*\*Inserts a discount code dynamically (e.g., “Use code **WELCOME10** at checkout!”).

#### **Klaviyo Profile Tokens (Beta)**

* **Klaviyo Person First Name** → `{|klaviyo.first_name|}` \*\*\*\*Displays the visitor’s **first name** if available. (e.g., “Welcome back, **Sarah**!”)
* **Klaviyo Person Last Name** → `{|klaviyo.last_name|}` \*\*\*\*Displays the visitor’s **last name**.
* **Klaviyo Custom Property** → `{|klaviyo.custom.{property_name}|}` \*\*\*\*Pulls in **custom data** from Klaviyo. To use it, replace `{property_name}` with the Klaviyo field name (e.g., “You have **300 points** to redeem!”).

***

### **Caveat: Where Tokens Can Be Used**

It’s important to know where each type of token is supported:

#### **Product-Specific Tokens (PDP Pages Only)**

Product-specific tokens are designed to pull details about a specific product and are only supported on Product Detail Pages (PDPs). These tokens **cannot** be used in campaigns that appear on other page types, such as badge campaigns.

For example, you cannot use the `{|compare_at_price|}` token in a badge campaign because it relies on data from a specific product page.

The following tokens are **PDP-only**:

* **Inventory Left**
* **Product Price**
* **Compare at Price**
* **Discounted Price**
* **Compare at Price Discount**

  *Example Use*:

  *“Hurry! Only {|inventory\_left|} left in stock for {|product\_title|}, now at {|product\_price|}!”*

#### **Tokens That Work on All Page Types**

The following tokens can be used on **any page** of your site, including in badge campaigns:

* **Visitor Country**
* **Current Cart Total**
* **Close to Free Shipping**
* **Discount Code**

  *Example Use*:

  *“Hello, shopper from {|visitor\_country|}! Spend {|close\_to\_free\_shipping|} more to unlock free shipping.”*

***

### **How Dynamic Text Tokens Enhance Your Campaigns**

* ✅ **Increase urgency:** “Hurry! Only **3 left in stock!**”
* ✅ **Encourage spending:** “You’re **$5 away** from free shipping!”
* ✅ **Personalize promotions:** “Hey **John**, use code **SAVE10** for 10% off!”
* ✅ **Boost conversions:** “Your cart total is **$85**—checkout now to claim your discount!”

#### **Pro Tip: Style Matching for Seamless Integration**

By default, Because **automatically matches your site’s theme styling** so these tokens blend in naturally. However, you can **customize any design setting** inside the editor to fit your brand.

💡 **Need Help?** Contact us at [**support@trybecause.com**](mailto:support@trybecause.com) for assistance! 🚀


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://because.gitbook.io/because/the-because-platform/campaign-setup/how-to-use-dynamic-text-tokens.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
