This article provides an introduction and steps to be able to sync products with Klaviyo if the JSON file is more than 50MB.
📅Drafted on August 10, 2023
As Klaviyo states in its Documentation, they don’t support files larger than 100MB, and 50MB files are recommended, so we created a pagination option for large files. This pagination can be achieved by adding certain parameters after the Klaviyo feed URL
Table of Contents
Kinds of JSON Feeds
How to determine how many paginations needed for Klaviyo
How to determine the current size of the JSON Feed for Klaviyo
The Formula to determine the number of paginations needed
Loading the paginated custom Catalog in Klaviyo
Kinds of JSON Feeds
https://sitename.com/klaviyo_feed.json (without Pagination)
The entire product data in a single JSON feed
https://sitename.com/klaviyo_feed.json?page=1&products=20000 (with Pagination)
The product data is divided into multiple JSON feeds
The number after the "?page=" tells us which page.
The number after the "&products=" tells us how many products per page.
How to determine the number of paginated feeds needed for Klaviyo
To find out, we would need the total number of products that are not hidden and how large the current JSON file for the Klaviyo feed
To determine the number of products
1) With your browser, go to https://sitename.com/admin/?view=product.list and click the "Advanced" button
2) Set the Hide option to "No"
3) Click on the "Search" button
4) Looking at the top right of the next page, this shows you the number of total products that don't include Hidden parts.
How to determine the current size of the JSON Feed for Klaviyo
To find out the current size of the JSON feed for Klaviyo
1) On the backend of your site, go to Data and then Data Feeds
2) On the bottom of the page, click on the Product Feed Klaviyo link to download the JSON file and find out the size
The Formula to determine the number of paginations needed
💬 Note: The numbers below are just an example EXCEPT size per page in MB (30MB) as we want to divide the JSON file into smaller feeds that are less than 50 MB.
The total size of the JSON file that we downloaded (i.e. 153.2MB) DIVIDED by the intended size per page in MB (30Mb) = Number of pages
💬 Tip: we can stretch from 30MB to a maximum of 50MB
Number of products DIVIDED by Number of pages = Number of URLs to load in Klaviyo
153,2MB Divided by 30MB = 6 pages
69112 Products Divided by 6 Pages = 11519 Products per page
Then our entire Feed would be divided into paginated feeds and would look like this:
https://sitename.com/klaviyo_feed.json?page=1&products=11519
https://sitename.com/klaviyo_feed.json?page=2&products=11519
https://sitename.com/klaviyo_feed.json?page=3&products=11519
https://sitename.com/klaviyo_feed.json?page=4&products=11519
https://sitename.com/klaviyo_feed.json?page=5&products=11519
https://sitename.com/klaviyo_feed.json?page=6&products=11519
- Always add one page to account for the potential growth of the product catalog.
- The number of products per page should always be the same.
Loading the paginated custom feed in Klaviyo
1) Go to https://www.klaviyo.com/catalog/sources and click on Add New Source button
2) Define a name for this custom feed
3) Place your paginated feed on the Source URL field
3) Click on the Define Source button
4) You will be redirected back to the Custom Sources page and your new custom feed will have the following status and give it time to progress to a new status
💬 You have to refresh your browser to see the change in status
5) If the paginated custom feed is valid, the status will change to this
6) Click on the name of your custom feed
7) On the bottom of the page, click on the Complete Feed Setup button
8) The status will now change to "Sync in Progress" which means it started doing its expected task
💬 Repeat the process as many pages as needed.
The size of any one feed file should not exceed 100 MB; for optimal performance, we recommend each feed file not exceed 50 MB. If your file exceeds this amount, please split the feed into multiple files.
All files used as sources will feed into the same catalog in Klaviyo.