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
- Ruby: CSV
- 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 blank parent_id
, and all other groups reference a parent group.
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 | ✔ | The ID for the item group this group belongs to (must be defined in the same file). 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_id,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"" }"
An example item_groups.csv
file can be viewed and downloaded from GitHub.
Updated 11 days ago