> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lantern.is/llms.txt
> Use this file to discover all available pages before exploring further.

# Klaviyo Integration

> Learn how to integrate Lantern with Klaviyo to sync customer data and trigger events

Lantern provides a rich integration with Klaviyo that pushes properties to customer profiles and triggers Metrics when events happen within Lantern.

## Getting Started

### Step 1: Generate a Klaviyo API Key

Generate a private API key in Klaviyo following [their instructions](https://help.klaviyo.com/hc/en-us/articles/7423954176283#h_01HDKDXQA1ZGSRCGM041B507KG):

* Give it a name like **"Lantern"** to remember what you generated it for
* Select **Full Access** under **Access Level**
* Make note of the generated key

### Step 2: Configure the Integration in Lantern

1. Go to the Lantern Admin in Shopify
2. Go to **Settings** → **Integrations**
3. Enter the API Key you generated into the field under the **Klaviyo** heading and save

### Step 3: Test the Integration

1. Click the **Send test events to Klaviyo** button to verify the integration
2. Check the Metrics Activity Feed in Klaviyo to see examples of each Metric Lantern triggers

## Customer Profile Properties

Lantern syncs the following properties to customer profiles in Klaviyo:

### General Properties

| Property           | Description               |
| ------------------ | ------------------------- |
| `LanternBirthDate` | The customer's birth date |

### Loyalty Properties

| Property                                   | Description                                                            |
| ------------------------------------------ | ---------------------------------------------------------------------- |
| `LanternEnrolledAt`                        | When the customer was enrolled in the loyalty program                  |
| `LanternPotentialLoyaltyPoints`            | The potential points a customer can earn if they signup for an account |
| `LanternLoyaltyPoints`                     | The customer's current loyalty points balance                          |
| `LanternLoyaltyTier`                       | The customer's current loyalty tier                                    |
| `LanternLoyaltyCurrentTierSpendThreshold`  | Spend threshold for current tier                                       |
| `LanternLoyaltyCurrentTierSpendRemaining`  | Spend required to maintain current tier                                |
| `LanternLoyaltyCurrentTierSpendPercentage` | Percentage progress to maintain current tier                           |
| `LanternLoyaltySpend`                      | Current period spend amount                                            |
| `LanternLoyaltyNextTierName`               | Handle of the next available tier                                      |
| `LanternLoyaltyNextTierSpendThreshold`     | Spend threshold for next available tier                                |
| `LanternLoyaltyNextTierSpendPercentage`    | Percentage progress towards next tier (0-100)                          |
| `LanternLoyaltyNextTierSpendRemaining`     | Spend remaining to reach next tier                                     |
| `LanternLoyaltyTierResetDate`              | Date that the tier will be recalculated                                |
| `LanternLoyaltyPointExpirationDate`        | Date that the user's points will expire                                |

### Wishlist Properties

| Property               | Description                                                  |
| ---------------------- | ------------------------------------------------------------ |
| `LanternWishlistItems` | A list of all product variant IDs in the customer's wishlist |

> **Note:** Lantern also syncs any customer properties you collect using earn event forms.

## Available Metrics

### General Events

#### `Lantern Account Created`

Triggered when a customer signs up for an account.

#### `Lantern Account Invite`

Triggered when a customer checks the `Account Sign Up` extension in Checkout.

**Parameters:**

* `potentialPoints` - The points the customer will earn when they finish activating their account
* `activationLink` - The unique link to activate the account

#### `Lantern Account Activate`

Triggered when a customer account invite is sent from Shopify.

**Parameters:**

* `activationLink` - The unique link to activate the account

#### `Lantern Earn Event Awarded`

Triggered when a customer earns an Earn Event.

**Parameters:**

* `handle` - The handle of the Earn Event earned
* `points` - The number of points earned
* `awardType` - The type of award earned
  * Possible values: `points`, `reward`, `none`
* `rewardType` - The type of reward earned
  * Possible values: `Discount Code`, `Gift Card`, `Product`, `Custom`, `Store Credit`
* `code` - The code associated with the reward (Gift Card code or Discount Code)
* `discountCode` - The discount code associated with the reward
* `giftCard` - The gift card associated with the reward
* `rewardValue` - The value of the reward
* `rewardValueType` - The type of value of the reward
  * Possible values: `Percent`, `Amount`
* `productVariantId` - The product variant ID associated with the reward

### Loyalty Events

#### `Lantern Loyalty Opted In`

Triggered when a customer opts into the loyalty program.

#### `Lantern Tier Change`

Triggered when a customer moves to a new loyalty tier.

**Parameters:**

* `tier` - The new tier the customer is now in

#### `Lantern Tier Increase`

Triggered when a customer moves up a loyalty tier.

**Parameters:**

* `tier` - The new tier the customer is now in

#### `Lantern Tier Decrease`

Triggered when a customer moves down a loyalty tier.

**Parameters:**

* `tier` - The new tier the customer is now in

#### `Lantern Points Awarded`

Triggered whenever a customer earns loyalty points.

**Parameters:**

* `points` - The number of points awarded

### Referral Events

#### `Lantern Referral Invite`

Triggered when an advocate uses the email invite to send a referral.

**Parameters:**

* `advocateFirstName` - First name of the advocate
* `advocateLastName` - Last name of the advocate
* `message` - The message the advocate wants to include with the invite
* `referralLink` - The advocate's unique referral link

#### `Lantern Referral Awarded`

Triggered on an advocate's profile when their friend is successfully referred.

**Parameters:**

* `code` - The unique code for the discount or gift card that was awarded

#### `Lantern Referred`

Triggered on a friend's profile when they successfully complete a referral.

**Parameters:**

* `code` - The unique code for the discount or gift card that was awarded

### Wishlist Events

#### `Lantern Back In Stock`

Triggered when a product variant that a customer has added to their wishlist becomes back in stock.

**Parameters:**

* `productVariantId` - The ID of the product variant that is now back in stock

#### `Lantern On Sale`

Triggered when a product variant that a customer has added to their wishlist goes on sale.

**Parameters:**

* `productVariantId` - The ID of the product variant that went on sale
