Skip to main content
233 Topics
Help Center

How to manually import historical event data

You will learn Learn how to manually import historical event data to Klaviyo. While we recommend using Klaviyo-built integrations with platforms such as Shopify, Magento, and BigCommerce, and our API for custom integrations, it's also possible to add this data manually. A common example of this is adding historical purchase data from a previous ecommerce platform that Klaviyo doesn't have a prebuilt integration for. Please note that there is a limit of 50 MB for CSV uploads.  Format your data The first step is to format your data correctly in a CSV file. Below is an example of Placed Order data, along with a description of the fields below. Each row in your CSV file should represent an action or activity someone performed, like "Purchased product" or "Signed up for webinar." If you have multiple actions to track, you should upload them as separate CSV files. Email address must come first when you're uploading your CSV. Here are some example event CSVs you can reference when formatting your data. Required fields The 2 required fields are a timestamp to identify when the event occurred, and a customer property (an email or a unique ID) to identify who performed the action. Timestamp: A timestamp showing the day and time of the event. The format is YYYY-MM-DD HH:MM:SS. For example, 1:30pm on November 14th of 2012 would be: 2012-11-14 13:30:00. If two or more events in your CSV file have the same timestamp, you must include a unique $event_id, or only one of the events will be imported and the rest will be skipped. See the section on $event_id below. Person//Email or Person//ID: Most likely, you will use an email to identify your customers. Some customers will also use an unique ID. You can use both if you would like. Optional fields There are 2 special fields to take note of. $event_id: This is a unique identifier for the event. In practice, you should send an $event_id if you have a unique identifier for each event (e.g., an order ID). You should also set the $event_id if you expect certain events to occur at the same point in time. This can happen when someone takes one action which you will split into multiple events. For example, if someone purchases multiple items, you may want to record 1 event for each item purchased.In the 2 sample data sets below there is 1 placed order event, along with 3 ordered product events (1 for each product in the placed order). All of these events have the same timestamp, but they will all be imported because they each have a unique $event_id. If the $event_ids were identical, or if they were absent, then only one of the events would be imported and the others would be skipped. $value: Use this field if the event you're importing includes a value. For example, if you're importing Placed Order event data, each order will have a value. You do not need to prefix your values with a $ or other currency symbol. If you have additional data about the person who did something, it should go in a column whose label starts with Person// and then the type of data that column has. For instance, if you had the company or organization each person belongs to, you'd want to label that column Person//Organization. The special prefix lets us know to associate the data in that column with each person rather than the activity. The following are special columns you can use to help you identify people: Person//First Name: first name Person//Last Name: last name Person//Phone: phone number Person//Organization: organization Person//Title: job title If you have additional data about each action, you can include it in extra columns with any labels you want. For instance, if someone purchases something and you want to include what item they bought, you could include that data in a column labeled Item Purchased. Below are some examples. Item Purchased Item Category Product Location If you don't have data for a particular column, leave it blank and we'll ignore it. For instance, if you don't know someone's organization, you can leave the column for Person//Organization blank and we'll skip tracking that property for that row in your data. Once you're done formatting your data, save it in a CSV file. Upload a CSV file of data After your data is properly formatted, head to Klaviyo.  Click your account name in the lower left. Select Integrations > Manage sources > Import via CSV. You'll be prompted to upload your CSV file, then click Next. You will have the opportunity to name the event. If you are attempting to map the imported data to an event metric that already exists in your account, make sure to type the event name exactly as it already appears. Once you've named your event you can preview your data below. When you're ready to import your data click Next. Your file will start to process, and you can navigate away from the page.  Note for ecommerce stores loading purchase data If you're uploading purchase data, you'll want to upload two files: one for the overall orde

Help Center

Getting started with Shift4Shop

You will learn Learn how to integrate Shift4Shop (formerly 3dcart) with Klaviyo in order to personalize and target emails based on each customer's purchases and website activity. The data synced from Shift4Shop to Klaviyo includes: Data about orders your customers make, including sales, refunds, fulfilled orders, and cancelled orders Detailed customer information, including when and how often people visit your website Klaviyo only syncs information for customers who have placed an order within the last three years. Table of contents Add the Shift4Shop Integration Add Klaviyo onsite tracking Monitor the data sync Data synced from Shift4Shop Additional resources Add the Shift4Shop integration In Klaviyo, click your account name in the lower left corner and then select Integrations > Add integrations. Search for Shift4Shop and click the card, then click Install. To find your Shift4Shop store URL (also known as your secure URL), open your Shift4Shop account in a new tab. In Shift4Shop, go to Settings > General > Store Settings. Under Store Information, click on Manage Domain & Store URL. Copy the Store URL from beneath Domain Settings. Back in Klaviyo, paste your Store URL in the box and click Connect to Shift4Shop. Copy the Klaviyo Public API Key that appears on the next page. Click the Go to Shift4Shop button. On the REST API Apps page in Shift4Shop, click Add in the top right hand corner to add the Klaviyo API key. Paste the Klaviyo public API key (2bd83b00fcd7d56916a28c452d3d080c). Click Save. A popup window will appear, asking you to give Klaviyo authorization to pull the Shift4Shop data into our platform; click Authorize. You will be redirected back to your Klaviyo account and your data will begin to sync. A success callout will confirm that your data is syncing. Add Klaviyo onsite tracking There are two Klaviyo onsite tracking code snippets you can add to your Shift4Shop site. The first onsite tracking snippet allows you to track when cookied users are active on your site (the Active on Site metric) and the second onsite tracking snippet allows you to track what products they view (the Viewed Product metric). You can then use the Active on Site metric to create segments of known browsers who have visited your site but haven't purchased anything. The Active on Site snippet (also known as Klaviyo.js) also enables the use of Klaviyo sign-up forms.  Viewed Product tracking is most often leveraged to trigger a Browse Abandonment automated email flow. For more information, see our article on creating a browse abandonment flow. Log in to your Shift4Shop store admin and navigate to Content > Site Content. Click on the Edit button under Header & Footer. Click the + to the right of Global Header to open the header editor. Click the slider next to WYSIWYG Mode Off / On to toggle the view to the HTML editor. To add Active on Site tracking, paste the following script at the bottom of the HTML editor: <script type="text/javascript" async="" src="https://static.klaviyo.com/onsite/js/PUBLIC_API_KEY/klaviyo.js"></script> <script type="text/javascript"> //Initialize Klaviyo object on page load !function(){if(!window.klaviyo){window._klOnsite=window._klOnsite||[];try{window.klaviyo=new Proxy({},{get:function(n,i){return"push"===i?function(){var n;(n=window._klOnsite).push.apply(n,arguments)}:function(){for(var n=arguments.length,o=new Array(n),w=0;w<n;w++)o[w]=arguments[w];var t="function"==typeof o[o.length-1]?o.pop():void 0,e=new Promise((function(n){window._klOnsite.push([i].concat(o,[function(i){t&&t(i),n(i)}]))}));return e}}})}catch(n){window.klaviyo=window.klaviyo||[],window.klaviyo.push=function(){var n;(n=window._klOnsite).push.apply(n,arguments)}}}}(); </script> In the first line of the snippet, replace Public API Key with your Klaviyo Public API Key, found under Account name > Settings > API Keys in Klaviyo. To add Viewed Product tracking, add this script underneath the Active on Site script in the header: <script type="text/javascript"> var klaviyo = window.klaviyo || []; // Track each product view. if ('[price]' !== '[' + 'price]') { klaviyo.track("Viewed Product", { ProductID: "[id]", Name: "[name]", Description: "[description]", URL: [location.protocol, '//', location.host, location.pathname].join(''), Categories: "[catid]", ImageURL: [location.protocol, '//', location.host, '/[image1]'].join(''), Price: parseFloat("[price]".slice(1), 10) }); }</script>      8. In the top right hand corner of the page, click Save Monitor the Klaviyo sync To view your Shift4Shop integration data: In your Klaviyo account, navigate to Analytics > Metrics. Click on the Placed Order metric to verify that your data has started to populate. If you see data populating the chart, that means the Shift4Shop integration is successfully syncing to your account. When the sync is complete, y

Help Center

Getting started with Boulevard

You will learn Learn how to integrate with Boulevard, a tool that assists salon and spa brands with booking, scheduling, marketing, payments, reporting, and more. Boulevard is not listed on the integrations tab in Klaviyo. Part of the integration setup process requires you to reach out to Klaviyo directly. See the Integrate Boulevard with Klaviyo section below for more details. Before you begin Confirm that you have access to the Boulevard API. This integration relies on Boulevard Webhooks and APIs, which require a subscription to the Boulevard API package. If you are unsure if you have this package, contact your Boulevard CSM to confirm. In Klaviyo, obtain the list IDs for the lists to which you’d like to sync your email and SMS subscribers. Integrate Boulevard with Klaviyo In the Boulevard console, navigate to Manage Business > App & Integration. Scroll to Custom Apps and click Install. Enter the Klaviyo Application id: 0d2168f5-934c-4586-85b0-03ef0f5c54be In Klaviyo, click your company name in the bottom left corner and navigate to Settings > Account > API Keys. Under the Public API Key / Site ID section, copy your account's public API key. Send an email to wellness@klaviyo.com and include: Subject: Boulevard Integration setup Please include: Your Klaviyo public API key Your email subscriber list ID Your SMS subscriber list ID You will hear back from the Klaviyo team within 1 business day. Make sure to only include your public API key in the email to Klaviyo and not your private API key. Emails containing private API keys will not be accepted. Understand your Boulevard data Klaviyo syncs many different events from Boulevard related to appointments and membership. When you integrate, we sync all historic data stored in Boulevard and then sync ongoing data in real time.  To view your Boulevard data in Klaviyo: Click the Analytics dropdown in the left-hand navigation sidebar. Select Metrics. Here, you can view all of the metrics in your account. The metrics with a Boulevard icon represent all of the metrics synced from your Boulevard integration.  Filter this view to see only Boulevard metrics by using the filter selector next to the search bar. Learn more about your Boulevard data. Segment customers using Boulevard data You can use Boulevard’s metrics to segment customers and target them with a campaign. For example, you can create a segment of everyone who has completed an appointment in the last 30 days and send a campaign to that segment. To create the example segment shown above: Click the Audience dropdown in the left-hand navigation sidebar. Click Lists & Segments. Click Create List / Segment in the top right. Select Segment. Name your segment and select tags if desired. Under Definition, select What someone has done (or not done) > Completed Appointments > at least once > in the last > 30 > days. If you have multiple integrations, make sure to choose the Completed Appointments metric with the Boulevard logo. Click Create Segment. For this example, if you’d like to make sure the segment only includes people who completed an appointment for the first time: Click AND to add a new exclusive condition. Add the condition What someone has done (or not done) > Completed Appointments > equals > 1 > over all time. This will exclude anyone who has completed an appointment more than once. Use Boulevard data in flows You can use Boulevard metrics to trigger flows. For example, use the Completed Appointments metric to trigger a flow to send messages to someone immediately when they complete an appointment. If you are using Boulevard to send email and SMS notifications, make sure to turn off messages that you would rather send through Klaviyo flows so that your customers aren’t receiving repetitive messages. See Boulevard’s support documentation for more information on how to disable email and SMS notifications. To create a flow using Boulevard metrics: Navigate to the Flows tab from the left-hand navigation sidebar. Click Create flow in the top right. Click Create from scratch in the top right. Name your flow and select tags if desired. Click Create Flow. In the flow builder, choose Metric as the trigger. From the dropdown, select a Boulevard metric, such as Completed Appointments, indicated by the Boulevard icon. Click Done. Add a message relevant to the triggering action, such as a thank you message. Once your content is ready, click Update Action Statuses in the top right of the flow builder to set the flow live. Outcome You've now integrated Boulevard with Klaviyo and learned about Boulevard data in Klaviyo, segmenting customers using Boulevard data, and using Boulevard data in flows. Why am I seeing the notification “Your account is calling a retired revision”? Are you seeing a notification in Klaviyo that reads “[ACTION Required] Your account is calling a retired revision”, like the one below?  Please ignore this notification; no action i

Help Center

How to integrate with Qgiv

You will learn Learn how to integrate Qgiv with Klaviyo. After completing these steps, you'll be able to personalize and target emails based on each Contributor's donation and website activity. Here's some of the data we sync from Qgiv: Amount of each contribution Contributor information including first and last name, location, and how they found your site Whether each contribution is recurring and if so, how often in will occur First, you'll need to generate an API token in Qgiv, and then enable the integration in Klaviyo. Generate your Qgiv API token Log in to your Qgiv account. Click on Settings in the left sidebar of your account then click on API Access. Click Create API Token. You will then be prompted you to create a token name and establish a token type. Under Token Type, select "Permanent". Once you select "Permanent" as the Token Type, select the forms that you want to make accessible in Klaviyo. If you want all your donation data, select all your campaigns.  Qgiv will then provide you with your API Token located on the left hand side under Combination. This is what you will need in the next step to integrate Qgiv with Klaviyo. Add the Qgiv integration in Klaviyo In Klaviyo, select your account name in the lower left corner, then click Integrations. Select Add integrations, search for Qgiv, and click the card.  Then, click Install. Enter your API Token and click Connect to Qgiv. You should receive a success message. Monitor the Klaviyo sync and verify data To check on your Qgiv integration: Click the Analytics dropdown in Klaviyo and select Metrics. Click on the Made Contribution metric to verify that there is data populated for this metric. If there is data, all you need to do is wait until your initial Qgiv integration sync has completed; this process can take up to a couple hours depending on how much data you have in your account. Klaviyo will import all of your historic Qgiv data. To verify this, you can compare the number of orders on a particular day in Klaviyo with what's in your Qgiv interface and confirm they match. For example, when exploring the Made Contribution metric in Klaviyo, you can mouse over yesterday's data point or look at the table of data below the chart to see how many orders were reported yesterday. Compare that number to what's stored in Qgiv from yesterday and you should see they match exactly. If they don't, the issue is most likely that your Klaviyo account's timezone doesn't match your Qgiv timezone. To check your timezone setting in Klaviyo: Click your account name in the lower left. Select then clicking Settings > Organization. Scroll down to Time zone. Data synced from Qgiv There are two metrics captured by Qgiv and synced to Klaviyo: Made Contribution and Registered for Event. Made Contribution This event is tracked when a donor makes a contribution in Qgiv. You can filter and target Made Contribution events based on the following criteria:  DonationSource Restriction OptedIn Type IsAnonymous FormName FormID $value Registered for Event This event is tracked when a peer-to-peer event registration form is submitted. You can filter and target Registered for Event events based on the following criteria:  FormID RegistrationID TransactionID Title FundraisingGoal DonationSource TeamCaptain $event_id $value Customer data In addition to the metrics Klaviyo syncs from Qgiv, there are also custom properties that are added to each Klaviyo profile. You can use these properties in segments and in flows. The following properties are built-in Klaviyo fields that will be automatically synced: Email First Name Last Name City State/Region Zip Code Country Phone Number Frequency of the Qgiv sync Metrics and profile properties from Qgiv are synced using webhooks. This means that Qgiv indicates to Klaviyo when an event has occurred and Klaviyo will then pull all data. This occurs almost instantaneously.  Add Klaviyo onsite tracking The final step here is adding Klaviyo's Active on Site tracking code to your website footer. This Klaviyo tracking code will allow us to track an Active on Site metric for you so that you can see and leverage data related to site visits and visitor behavior. Through this metric, Klaviyo will track website activity for known browsers. For example, you can use the Active on Site metric to create segments of people who have visited your site (while logged in), but haven't yet made a donation.  To enable onsite tracking: In Klaviyo, click your account name in the lower left corner, then select Integrations. Selct Manage sources > Set up web tracking. Copy the code under Step 1 and paste it in your website's main template, before the </body> tag. Make sure you paste it on the website associated with the Klaviyo account you're in. After you've pasted the code snippet, click Confirm under Step 2 to test the tracking setup. You should receive a success message if it's working correctly. Outcome You have now integrated with Qg

Help Center

How to integrate with DonorPerfect

You will learn Learn how to integrate DonorPerfect with Klaviyo. After completing these steps, you'll be able to personalize and target emails based on each Contributor's donation and website activity. Here's some of the data we sync from DonorPerfect: Amount of contribution Contributor information, including first and last name, location, and how they found your site Whether the donation is recurring and, if so, how often in will occur Whether the contributor wants to be anonymous First, you'll need to find your DonorPerfect API key, then you'll enable the integration in Klaviyo. Find your API key You can retrieve your API Key from your DonorPerfect Account Manager. Send your account manager an email requesting your API Key and they will send it to you shortly.  Add the DonorPerfect integration in Klaviyo In Klaviyo, click your account name in the lower left corner, then select Integrations. On the next page, click Add integrations, search for DonorPerfect, and click the card. Then, click Install. Add your DonorPerfect API Key and click Connect to DonorPerfect. On the next page, choose to Add all DonorPerfect donors to a Klaviyo list, and then select a list from the dropdown that appears. Click Complete setup. Monitor the Klaviyo sync and verify data To check on your DonorPerfect integration once you've integrated: Click the Analytics dropdown in Klaviyo and select the Metrics tab. Click the Made Contribution metric to verify that there is data populated for this metric. If there is data, all you need to do is wait until your initial DonorPerfect integration sync has completed; this process can take up to a couple hours depending on how much data you have in your account. Klaviyo will import all of your historic DonorPerfect data. To verify this, you can compare the number of contributions on a particular day in Klaviyo with what's in your DonorPerfect interface and confirm they match. For example, when exploring the Made Contribution metric in Klaviyo, you can hover over yesterday's data point or look at the table of data below the chart to see how many contributions were reported yesterday. Compare that number to what's stored in DonorPerfect from yesterday and you should see they match exactly. If they don't, the issue is most likely that your Klaviyo account's timezone doesn't match your DonorPerfect's account timezone. To check your timezone setting in Klaviyo:  Click your account name in the lower left. Select then clicking Settings > Organization. Scroll down to Timezone. DonorPerfect data There is 1 major metric that is captured by DonorPerfect and loaded into Klaviyo: Made Contribution. The Made Contribution metric This event is tracked when a supporter makes a contribution in DonorPerfect. The event Klaviyo tracks includes all of the information DonorPerfect collects, including the contribution amount, whether the donation is recurring and, if so, how often the donation will recur. You can filter and target Made Contribution events based on the following criteria: Value Campaign First Gift Gift Type In Memory Of Is Recurring (True of False) Here is an example of the data we receive along with a Made Contribution event: Customer data In addition to the metric Klaviyo syncs from DonorPerfect, there are also custom properties that are added to each Klaviyo profile. You can use these properties in segments and flows. Here are the properties that are automatically synced from DonorPerfect: Email First Name Last Name City State/Region Zip Code Country Phone Number How often DonorPerfect data syncs Metrics and profile properties from DonorPerfect are synced using webhooks. This means that DonorPerfect indicates to Klaviyo when an event has occurred and Klaviyo will then pull all data for the event. This occurs almost instantaneously.  Add Klaviyo onsite tracking The final step here is adding Klaviyo's Active on Site tracking code to your website footer. This Klaviyo tracking code will allow us to track an Active on Site metric for you so that you can see and leverage data related to site visits and visitor behavior. Through this metric, Klaviyo will track website activity for known browsers. For example, you can use the Active on Site metric to create segments of people who have visited your site (while logged in), but haven't yet made a donation.  The following tracking script can be found in Klaviyo by clicking your account name in the lower left corner, selecting Integrations, then clicking Manage sources > Set up web tracking in the upper right corner. We've also included the Klaviyo Active on Site tracking script here, which you can paste into the main template of your app before the </body> tag. Remember to add your own API key, found under Account name > Settings > API keys, where you see 'Public API Key': <script type="application/javascript" async src="https://static.klaviyo.com/onsite/js/klaviyo.js?company_id=Public API Key"></script> You will