CSV feed format - item groups (categories)
Constructor accepts hierarchical item group (category) feeds as UTF-8 encoded CSV file titled item_groups.csv
. Each row representing a relationship between related item groups along with the name of the item group.
Items (products) are organized into groups - sometimes referred to as "categories." Users generally view these groups of items on browse result pages.
When creating CSV files, please use a standard CSV library in the programming language of your choice. The CSV specification is quite detailed, and is more complex than simply separating fields with commas. Some standard libraries we recommend for different languages are:
- Java: Apache Commons CSV
- JavaScript: Papa Parse
- Python: CSV
Each row in this file represents a single group (and corresponding browse page). A valid group hierarchy has a single top level group (generally named "All") that has a empty parent_ids
, and all other groups reference parent groups.
Any additional metadata that you would like to add to the item group can be passed as a JSON string in the data field as shown in the example below.
Item group definitions are encapsulated in a UTF-8 encoded CSV file item_groups.csv
with the data defined below:
Field Name | Required | Description |
---|---|---|
id | ✔ | A unique group ID that is available for the beacon to track (in the DOM or on the window object) for each browse result page. Limited to 250 characters. |
parent_id | DEPRECATED. Consider using parent_ids instead | |
parent_ids | ✔ | The IDs for the item groups this group belongs to (must be defined in the same file). Should be formatted as JSON array of strings. Each id is limited to 250 characters. |
name | ✔ | The name of the item group. Limited to 250 characters. |
data | JSON metadata associated with the item group. Limited to 5kb. |
The item_groups.csv
file must be included as part of a compressed archive file.
Example item groups file
parent_ids,id,name,data
"[]",all,All,"{ ""url"": ""/browse/all"" }"
"[""all""]",jackets,Jackets,"{ ""url"": ""/browse/jackets"" }"
"[""all""]",tops,Tops,"{ ""url"": ""/browse/tops"" }"
"[""tops""]",tops-athletic,Athletic Tops,"{ ""url"": ""/browse/tops/athletic"" }"
"[""tops""]",tops-casual,Casual Tops,"{ ""url"": ""/browse/tops/casual"" }"
"[""all""]",bottoms,Bottoms,"{ ""url"": ""/browse/bottoms"" }"
"[""tops"",""jackets""]",hybrid-top-jackets,Hybrid Tops & Jackets,"{ ""url"": ""/browse/hybrid-tops-jackets"" }"
"[""tops"",""bottoms""]",matching-sets,Matching Sets,"{ ""url"": ""/browse/matching-sets"" }"
"[""jackets"",""bottoms""]",outerwear-bottom-combos,Outerwear + Bottom Combos,"{ ""url"": ""/browse/outerwear-bottom-combos"" }"
An example item_groups.csv
file can be viewed and downloaded from GitHub.
Updated 29 days ago