|
| 1 | +import { InProductAction, getOsShortcut } from "docs-ui" |
| 2 | + |
| 3 | +export const metadata = { |
| 4 | + title: `Klaviyo Integration`, |
| 5 | +} |
| 6 | + |
| 7 | +# {metadata.title} |
| 8 | + |
| 9 | +Add [Klaviyo](https://www.klaviyo.com/) to build email lists and send marketing campaigns to your customers. |
| 10 | + |
| 11 | +Klaviyo lets you send automated emails for abandoned carts, order confirmations, and marketing campaigns. Bloom sets it up for you in minutes. |
| 12 | + |
| 13 | +{/* TODO: Add screenshot of Klaviyo email campaign dashboard */} |
| 14 | + |
| 15 | +## When to Integrate Klaviyo |
| 16 | + |
| 17 | +Integrate Klaviyo if you want to: |
| 18 | + |
| 19 | +- Build email lists and grow your marketing audience. |
| 20 | +- Sync your products with Klaviyo for dynamic email content. |
| 21 | +- Send campaigns and automated emails from Klaviyo. |
| 22 | + |
| 23 | +## Prerequisites |
| 24 | + |
| 25 | +Before adding Klaviyo, you need a [Klaviyo account](https://www.klaviyo.com/) and API keys. |
| 26 | + |
| 27 | +### Klaviyo Private API Key |
| 28 | + |
| 29 | +Your Klaviyo Private API Key allows Bloom to send data from your store to Klaviyo. To get your Private API Key: |
| 30 | + |
| 31 | +1. Log in to your Klaviyo account. |
| 32 | +2. Click your profile icon in the bottom left, then choose "Settings." |
| 33 | +3. Click "API Keys" in the left sidebar. |
| 34 | +4. Click "Create Private API Key." |
| 35 | +5. Give your key a name (like "Bloom Store") and give full access to List and Profiles. |
| 36 | +6. Copy your Private API Key. |
| 37 | + |
| 38 | +### Klaviyo List ID |
| 39 | + |
| 40 | +Your Klaviyo List ID is where Bloom will add subscribers from your store. To get your List ID: |
| 41 | + |
| 42 | +1. In your Klaviyo dashboard, go to "Audience" > "Lists & Segments." |
| 43 | +2. Click on the list you want to use (or create a new one). |
| 44 | +3. In the URL, find the List ID (a string of letters and numbers after `/list/`). For example, if the URL is `https://www.klaviyo.com/lists/abc123`, your List ID is `abc123`. |
| 45 | +4. Copy your List ID. |
| 46 | + |
| 47 | +--- |
| 48 | + |
| 49 | +## Add Klaviyo to Your Store |
| 50 | + |
| 51 | +To add Klaviyo using the <InProductAction product={"bloom"} type={"MEDUSA_AI_OPEN_PANE"} data={{ pane: "integrations" }}>Integrations</InProductAction> panel: |
| 52 | + |
| 53 | +1. Press <Kbd>{getOsShortcut()}</Kbd> + <Kbd>k</Kbd> to open the preview tab switcher. |
| 54 | +2. Select the "Integrations" tab from the list. |
| 55 | +3. Find the Klaviyo card in the available integrations. |
| 56 | +4. Click "Build" on the Klaviyo card. |
| 57 | + |
| 58 | +Bloom will start setting up Klaviyo and ask you questions about which features you want to enable. |
| 59 | + |
| 60 | +{/* TODO: Add screenshot of Klaviyo card with "Build" button highlighted */} |
| 61 | + |
| 62 | +--- |
| 63 | + |
| 64 | +## Answer Bloom's Questions |
| 65 | + |
| 66 | +After you click "Build," Bloom asks questions to configure Klaviyo: |
| 67 | + |
| 68 | +1. **Where should the newsletter form appear?** Choose from options like footer, popup, or homepage section. Bloom may skip this question if your store already has a newsletter form. |
| 69 | +2. **Do you want to generate a product feed?** A product feed allows you to sync your products with Klaviyo for dynamic email content. Answer "yes" to enable this feature. |
| 70 | + |
| 71 | +After you answer these questions, Bloom asks for your Klaviyo credentials: |
| 72 | + |
| 73 | +1. **Klaviyo Private API Key:** Paste the Private API Key you copied from your Klaviyo dashboard. |
| 74 | +2. **Klaviyo List ID:** Paste the List ID where you want to add subscribers. |
| 75 | +3. **Storefront URL:** This will only be required if you enabled the product feed. It will be used for the URLs in your product feed. You should use the live URL of your store if you have it, or the preview URL if you don't. |
| 76 | + |
| 77 | +After you provide this information, Bloom will complete the Klaviyo integration setup for you. |
| 78 | + |
| 79 | +<Note title="Technical Information"> |
| 80 | + |
| 81 | +Bloom stores your Klaviyo credentials as environment variables in your store. They're never exposed in your code or logs. See [Environment Variables](../../../../developers/environment-variables/page.mdx) for more details. |
| 82 | + |
| 83 | +</Note> |
| 84 | + |
| 85 | +{/* TODO: Add screenshot of Bloom asking configuration questions */} |
| 86 | + |
| 87 | +--- |
| 88 | + |
| 89 | +## Test Subscription with Klaviyo |
| 90 | + |
| 91 | +After Bloom finishes the setup, test Klaviyo in your preview store: |
| 92 | + |
| 93 | +1. Open your <InProductAction product={"bloom"} type={"MEDUSA_AI_OPEN_PANE"} data={{ pane: "store" }}>store</InProductAction> preview. |
| 94 | +2. Subscribe using the newsletter form. |
| 95 | +3. Check that the subscriber is added to your Klaviyo list. |
| 96 | + |
| 97 | +--- |
| 98 | + |
| 99 | +## Add Product Feed to Klaviyo |
| 100 | + |
| 101 | +If you enabled the product feed, Bloom will share the URL to that feed (for example, `https://your-store.com/product-feed?currency_code=usd&country_code=us`) in the chat after setup. |
| 102 | + |
| 103 | +The product feed will include your product information for a specific currency and country. You can use this feed in Klaviyo to create dynamic email content that shows your products. |
| 104 | + |
| 105 | +To add the product feed to Klaviyo: |
| 106 | + |
| 107 | +1. Copy the product feed URL that Bloom shared in the chat. |
| 108 | +2. In your Klaviyo dashboard, go to "Content" > "Products" |
| 109 | +3. Click the "Add Custom Products" button. |
| 110 | +4. Click the "Add Source" button. |
| 111 | +5. In the form, enter a name for the source (like "Bloom Product Feed") and paste the product feed URL. You don't need to add username and password for the source. |
| 112 | +6. Click "Define Source" to add the product feed to Klaviyo. |
| 113 | + |
| 114 | +You can now use the product feed in your Klaviyo email templates to show dynamic product content. |
| 115 | + |
| 116 | +--- |
| 117 | + |
| 118 | +## Publish Klaviyo Integration |
| 119 | + |
| 120 | +Once you've tested Klaviyo and it's working correctly, publish your store to make it live with production credentials. |
| 121 | + |
| 122 | +To publish your Klaviyo integration: |
| 123 | + |
| 124 | +1. Click the "Publish" button at the top right of your project. |
| 125 | +2. If you haven't published before, Bloom asks for details about your store. |
| 126 | +3. Bloom will ask you to enter your live Klaviyo credentials (Private API Key and List ID). Enter the same credentials you used for the preview since Klaviyo doesn't differentiate between environments. |
| 127 | +4. Click "Publish" to make your changes live. |
| 128 | + |
| 129 | +Your Klaviyo integration is now active on your live store. You can track real customer events and send marketing campaigns. |
| 130 | + |
| 131 | +{/* TODO: Add screenshot of publish dialog */} |
| 132 | + |
| 133 | +### Update Product Feed URL |
| 134 | + |
| 135 | +After publishing, make sure to update the product feed URL in your Klaviyo source to use your live backend URL instead of the preview URL. This ensures that your product feed continues to work correctly after publishing. |
| 136 | + |
| 137 | +The backend URL is your admin URL without the `/app` path. For example, if your admin URL is `https://your-store.com/app`, your backend URL is `https://your-store.com`. Update the product feed URL in Klaviyo to `https://your-store.com/product-feed?currency_code=usd&country_code=us`. |
| 138 | + |
| 139 | +--- |
| 140 | + |
| 141 | +## Need Help? |
| 142 | + |
| 143 | +If you face any issues while adding Klaviyo to your Bloom store, [contact support or submit feedback](../../../../help-and-feedback/page.mdx). |
0 commit comments