# Klaviyo: Email Marketing & SMS

### What is the Klaviyo integration?

The Klaviyo integration connects your Joy Subscription app with Klaviyo, a leading email and SMS marketing platform. This powerful integration automatically sends real-time subscription event data from Joy Subscriptions to Klaviyo, enabling you to create sophisticated automated marketing campaigns based on your customers' subscription behaviors.

### Why use this integration?

The Klaviyo integration helps you:

* **Automate transactional emails and SMS** for subscription events (renewals, cancellations, payment failures)
* **Segment your audience** using Joy's custom subscription properties
* **Send targeted campaigns** based on subscriber data and behavior
* **Improve customer retention** with personalized communication flows
* **Increase revenue** through automated win-back campaigns and upselling
* **Save time** by eliminating manual email management for subscription events

Common use cases include welcome sequences for new subscribers, payment failure notifications, cancellation prevention emails, and renewal reminders.

### Prerequisites

Before setting up the integration, ensure you have:

* An active Klaviyo account (free or paid)
* Joy Subscription installed
* Admin access to both your Shopify store and Klaviyo account
* Basic understanding of email marketing flows (helpful but not required)

### How to set up Klaviyo integration

#### Step 1: Connect to Klaviyo

1. From your Shopify admin, navigate to **Apps**
2. Click **Joy Subscription** to open the app
3. In the Joy Subscription dashboard, go to **Settings** in the left sidebar
4. Select **Integration** from the settings menu
5. Find the **Klaviyo** integration option
6. Click the **Connect** button

**Connection Process:**

1. You'll be redirected to Klaviyo's authorization page
2. Log in to your Klaviyo account if prompted
3. Review the permissions that Joy Subscription is requesting
4. Click **Allow** to grant access
5. You'll be redirected back to Joy Subscription with a "Connected" status

**If Connection Fails:**

* Ensure you're logged into the correct Klaviyo account
* Check that your Klaviyo account has the necessary permissions
* Try clearing your browser cache and attempting the connection again

#### Step 2: Get Started with Sample Events

Once connected, you'll want to test the integration with sample data:

1. In the Klaviyo integration section, locate **Step 2: Get started with sample events**
2. Click the **Trigger events** button
3. This sends test data for all Joy subscription events without creating actual subscriptions

**What This Does:**

* Creates sample events in your Klaviyo account for testing
* Allows you to see what data Joy sends to Klaviyo
* Helps you set up flows and segments before real customer data flows through
* Ensures the integration is working properly

**Verify Sample Events:**

1. Go to your Klaviyo dashboard
2. Navigate to **Analytics > Metrics**
3. Look for Joy Subscription events (they'll be prefixed with your app name)
4. Click on individual events to see the data structure and properties

#### Step 3: Sync Existing Customer Data

To sync your current subscribers with Klaviyo:

1. In the integration setup, find **Step 3: Sync existing customer data**
2. Click the **Sync data** button
3. Confirm that you want to sync existing subscriber information

**Important Notes:**

* The sync process may take **48 to 72 hours** depending on the number of profiles
* Existing customer profiles will be updated with subscription information
* New profiles will be created for subscribers not already in Klaviyo
* You can monitor sync progress in the integration dashboard

**During Sync Process:**

* New subscription events will continue to sync in real-time
* You can start building flows and segments while the historical sync completes
* Don't disconnect the integration while sync is in progress

### Setting Up Klaviyo Flows

After integration setup, create automated flows in Klaviyo:

#### Essential Flows to Create:

**1. Welcome Series for New Subscribers**

* Trigger: Subscription created event
* Content: Welcome message, subscription details, customer portal access

**2. Payment Failed Recovery**

* Trigger: Payment failed event
* Content: Payment update instructions, customer support contact

**3. Cancellation Prevention**

* Trigger: Subscription cancelled event
* Content: Win-back offer, feedback request, pause option

**4. Renewal Reminders**

* Trigger: X days before renewal date
* Content: Upcoming charge notification, manage subscription options

#### Setting Up a Flow:

1. In Klaviyo, go to **Flows > Create Flow**
2. Choose **Create from Scratch**
3. Set up your trigger using Joy Subscription events
4. Add email/SMS actions with your content
5. Configure timing and conditions
6. Test and activate the flow

### Segmentation and Targeting

Use Joy's subscription data to create targeted segments:

#### Useful Segments:

* **Active Subscribers:** Customers with active subscriptions
* **High-Value Customers:** Subscribers with high-frequency or high-value plans
* **At-Risk Subscribers:** Customers with recent payment failures
* **Long-Term Customers:** Subscribers active for 6+ months

#### Creating Segments:

1. In Klaviyo, go to **Lists & Segments > Create List/Segment**
2. Choose **Segment**
3. Add conditions using Joy Subscription properties
4. Name and save your segment
5. Use segments for targeted campaigns and flow conditions

### Monitoring and Optimization

#### Track Integration Performance:

**In Joy Subscription:**

* Monitor integration status in Settings > Integration
* Check sync completion progress
* Review event sending success rates

**In Klaviyo:**

* Analyze flow performance metrics
* Monitor email deliverability rates
* Track revenue attribution from subscription flows

#### Best Practices:

* **Start Simple:** Begin with basic flows before adding complexity
* **Test Thoroughly:** Use sample events to test flows before going live
* **Monitor Performance:** Regularly check flow metrics and optimize
* **Personalize Content:** Use subscription data for personalized messaging
* **Maintain List Hygiene:** Regularly clean your email lists for better deliverability

### Troubleshooting Common Issues

**Integration Shows "Not Connected":**

* Re-authorize the connection in Settings > Integration
* Check Klaviyo account permissions
* Contact support if issue persists

**Events Not Appearing in Klaviyo:**

* Verify integration status is "Connected"
* Check if events are being triggered in Joy
* Allow up to 15 minutes for events to appear in Klaviyo

**Sync Taking Too Long:**

* Large datasets can take up to 72 hours
* Contact support if sync exceeds this timeframe
* New events continue to sync in real-time during historical sync

### Summary and Next Steps

Your Klaviyo integration is now set up to automatically send subscription data and enable powerful email and SMS automation. The system will:

1. Send real-time subscription events to Klaviyo
2. Sync existing customer data (may take 48-72 hours)
3. Enable segmentation based on subscription behavior
4. Support automated flows for subscription events
