Skip to end of metadata
Go to start of metadata

Generation rules

If YML / XML of your shop is more than 5 megabytes, and is generated by the script more than for 20 seconds, it would be better if, instead of specifying script generating YML, you set the task to generate YML into the schedule. Your script should generate static XML-file which will begin downloading immediately after referring to him, without time-consuming generation. This will give you the following advantages:

accelerating download of your YML by our servers - instead of waiting for the file generation for 10-15 minutes, REES46 immediately starts to download them which in turn will increase the relevance of your products base in the recommendation system

  • reducing server load at large YML (otherwise it will be very easy for malefactor to organize DDOS-attack, making 20-30 concurrent requests to this resource-intensive script);
  • accelerating download of your YML by our servers - instead of waiting for the file generation for 10-15 minutes, REES46 immediately starts to download them which in turn will increase the relevance of your products base in the recommendation system.

Example of schedule for "cron":

0 */2 * * * php /home/myuser/site/docs/yml.php > /home/myuser/site/docs/rees46.yml

Format

Format is based on YML (Yandex Market Language) - http://help.yandex.ru/partnermarket/yml/about-yml.xml

Example of 'offer':

<!-- id - ID of product in your shop. -->

<!-- available - product availability for recommendations. -->
<offer id="395532" available="true">
  
	<!-- Product's URL without additional parameters. -->
	<!-- Without 'utm_source' and other attributes for tracking traffic sources -->
	<url>http://example.com/items/395532</url>
  
 	<!-- Product base price. -->
	<price>50000</price>
 
    <!-- Relative marginality (priority) of product (from 0 to 100) -->
    <price_margin>67</price_margin>
	<!-- Product category. Can be several. -->  
	<categoryId>57</categoryId>
	<categoryId>32</categoryId>
	<categoryId>313</categoryId>
	
	<!-- Product barcode (if any). -->
	<barcode>123456</barcode>

	<!-- Product pictures, used in mailing. -->
	<picture>http://example.com/items/395532.jpg</picture>
  
	<!-- Product name, used in mailing. -->
	<name>Apple Iphone 6 128 gb</name>
 
	<!-- Structured data about manufacturer and model — used for cross-site behavior analysis -->
	<typePrefix>Smartphone</typePrefix>
	<vendor>Apple</vendor>
	<vendorCode>APPL</vendorCode>
	<model>iPhone 6 128Gb</model>
  
	<!-- Product description. Can be used in mailing. -->
	<description><![CDATA[The moment you use iPhone 6s, you know you’ve never felt anything like it. With a single press, 3D Touch lets you do more than ever before. Live Photos bring your memories to life in a powerfully vivid way. And that’s just the beginning. Take a deeper look at iPhone 6s, and you’ll find innovation on every level.]]></description>

</offer>

Geography and points of delivery

If your shop is more than one town or has several points of delivery within the same city, it is necessary to send information about your geography and the distribution of products in points of delivery and prices in these cities and points of delivery .

Geography information

List all your points of delivery in <shop> section:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE yml_catalog SYSTEM "shops.dtd">
<yml_catalog date="2015-04-01 17:00">
    <shop>
        <name>Shop</name>
        <company>Shop</company>
        <url>http://www.shop.com/</url>

        <locations>
          <location id="1" type="city" name="Moscow" />
          <location id="2" type="city" name="Saint-Petersburg" />
          <!-- ... -->
          <location id="145" type="store" name="Point of delivery on Arbat" parentId="1" />
        </locations>
        
        <currencies>...</currencies>
        <categories>...</categories>
        <offers>...</offers>
    </shop>
</yml_catalog>

 

Distribution of remainders between points of delivery and regions

For each item in a section <offer> specify the location in which the product is available and the price at which product is sold in this location:

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE yml_catalog SYSTEM "shops.dtd">
<yml_catalog date="2010-04-01 17:00">
    <shop>
        ...
        <offers>
            <offer ...>

                <url>http://example.com/items/395532</url>
                ...

                <!-- If your shop is in several cities: -->
                <locations>
                    
					<!-- Product at a price of '50300' is available in the city with ID '1' -->
                    <location id="1">
                        <price>50300</price>
                    </location>
                    
					<!-- If there is no price specified, it is considered equal to base price. -->
                    <location id="2"></location>
                    
					<!-- There is no block for city with ID '3', which means that the product is not available there. -->
                    <location id="4">
                        <price>49000</price> 
                    </location>
                </locations>
            </offer>
        </offers>
    </shop>
</yml_catalog>

Accessories

Majority of shops does not have enough sales to build a software link between all the products and their accessories, meanwhile such links  has been manually constructed in the personal office CMS earlier. You can send these links to YML to  improve the quality of personalized recommendation algorithms "Also bought" and "See also".

You should create the following section for this:

...
<offer ...>
	...
	<accessories>
		<!-- Product-accessory ID should be specified in the 'id' parameter -->
		<accessory id="5574" />
		<accessory id="131" />
		<accessory id="99444" />
		<accessory id="334411" />
		...
	</accessories>
	...
</offer>

Goods, listed as an accessory, must also be in the YML and be available for sale. In this case automatic gender determination will not work.

Barcode

Barcode is used to identify the product in different stores. This will improve the comparison of the interests of the customer and quality of recommendations.

Section 'barcode' is used for this:

...
<offer ...>
	...
	<barcode>123456</barcode>
	...
</offer>

Data for branch algorithm "Clothes and accessories"

This algorithm requires the following parameters:

Gender

Required parameter. Specified in  <fashion> section, wrapped in <offer>.

Parameter valueDescription
mMale
fFemale
XML Example
 ...
<offer ...>
    ...
	<fashion>
	    <gender>f</gender>
	</fashion>
</offer>
...

If you have no data about product's target gender, do not specify this parameter. In this case automatic gender determination will not work.

Clothes type

Required parameter. Specified in  <fashion> section, wrapped in  <offer>.

Parameter valueIncludes
shoeShoes
shirtShirts, blouses, dresses
tshirtT-shirts
underwearUnderwear
trouserTrousers, jeans, shorts, robes, swimsuits
jacketJackets, coats, fur coats
blazerJackets, vests, cardigans
sockSocks
beltBelts
hatHeadwear
gloveGloves
XML Example
 ...
<offer ...>
    ...
	<fashion>
	    <gender>f</gender>
	    <type>shoe</type>
	</fashion>
</offer>
...

Сlothing size

Required parameter. Placed inside the section <fashion>, wrapped in <offer>. Since there are many size charts, each size is prefixed with characterizing dimensional chart type:

Size chart typeDescriptionExample
rRussian size chartr44
eEuropean size charte38
no prefixUS size chartXS
bUK size chartb6
no prefixno size chart (applicable for all)null
hGrowth (for children's products)h89-95

One product may be of several sizes, so the list of sizes is sent:

XML Example
 ...
<offer ...>
    ...
	<fashion>
	    <gender>f</gender>
	    <type>shoe</type>
		<sizes>
			<size>e40</size>
			<size>e42</size>
			<size>e44</size>
			<size>e48</size>
		</sizes>
	</fashion>
</offer>
...

Features

Optional parameter. Specified in <fashion> section, wrapped in <offer>

Parameter valueDescription
pregnantFor pregnant
XML Example
 ...
<offer ...>
    ...
	<fashion>
	    <gender>f</gender>
	    <type>upper</type>
		<feature>pregnant</feature>
	</fashion>
</offer>
...

Brand

Optional parameter. Specified in <vendor> section, wrapped in <offer>

Data for branch algorithm "Cosmetics"

This algorithm requires the following parameters:

 

Gender

Optional parameter. Specified in <cosmetic> section, wrapped in <offer>

Parameter valueDescription
mMale
fFemale
XML Example
 ...
<offer ...>
    ...
	<cosmetic>
	    <gender>f</gender>
	</cosmetic>
</offer>
...

If you have no data about product's target gender, do not specify this parameter.

Hypoallergenicity

Optional parameter. Specified in <cosmetic> section, wrapped in <offer>

Parameter valueDescription
1Hypoallergenic product
0Non-hypoallergenic product
XML Example
 ...
<offer ...>
    ...
	<cosmetic>
	    <hypoallergenic>1</hypoallergenic>
	</cosmetic>
</offer>
...

Use (different body parts)

Optional parameter. Specified in <cosmetic> section, wrapped in <offer>

Parameter valueDescription
hairfor hair
facefor face, makeup, for mouth
bodyfor body, perfume
intimintimate hygiene
handfor hands
legfor feet
XML Example
 ...
<offer ...>
    ...
	<cosmetic>
		<part_types>
		    <part_type>hair</part_type>
		    <part_type>body</part_type>
		    <part_type>face</part_type>
		</part_types>
	</cosmetic>
</offer>
...

Use (different skin type)

Optional parameter. Specified in <cosmetic> section, wrapped in <offer>

Parameter valueDescription
drydry
normalnormal
oilyoily
combycomby
XML Example
 ...
<offer ...>
    ...
	<cosmetic>
        <skin_types>
            <skin_type>normal</skin_type>
            <skin_type>oily</skin_type>
        </skin_types>
	</cosmetic>
</offer>
...

 

Use (skin/hair condition)

Optional parameter. Specified in <cosmetic> section, wrapped in <offer>

Parameter valueDescription
coloredcolored
damageddamaged
wavedwaved
seboreaseborea
akneAcne and other defects
lossagainst hair loss
growfor hair growth
dehydrateddehydrated
sensitivesensitive
problemproblem
fadingfading
XML Example
 ...
<offer ...>
	...
	<cosmetic>
		<conditions>
			<condition>colored</condition>
			<condition>problem</condition>
		</conditions>
	</cosmetic>
</offer>
...

Volume

Optional parameter. Measured in milliliters. Specified in <cosmetic> section, wrapped in <offer>

XML Example
 ...
<offer ...>
    ...
	<cosmetic>
		<volumes>
			<volume>
				<value>200</value>
				<price>1000</price>
			</volume>
			<volume>
				<value>400</value>
				<price>2000</price>
			</volume>
		</volumes>
	</cosmetic>
</offer>
...

Periodicity

Optional parameter. May have a value from 0 ( for occasional use ) to 1 ( for occasional use ). Specified in <cosmetic> section, wrapped in <offer>

XML Example
 ...
<offer ...>
    ...
	<cosmetic>
		<periodic>1</periodic>
	</cosmetic>
</offer>
...

 

Brand

Optional parameter. Specified in <vendor> section, wrapped in <offer>

Data for branch algorithm "Children's products"

Gender

Required parameter. Specified in <child> section, wrapped in <offer>

Parameter valueDescription
mMale
fFemale
XML Example
 ...
<offer ...>
    ...
	<child>
	    <gender>f</gender>
	</child>
</offer>
...

If you have no data about product's target gender, do not specify this parameter. In this case automatic gender determination will not work.

Product type

Required parameter. Specified in <child> section, wrapped in <offer>

Parameter valueDescription 
clothClothes 
shoeShoes 
sockSocks, pantyhose 
toyToys 
educationEducational toys, building kits 
food
building kit
 
nappyNappy 
hygieneHygiene items 
furnitureFurniture 
schoolSchool accessories 
transportTransportation means (wheelchairs, car seat, kick scooter, bikes etc) 
XML Example
 ...
<offer ...>
    ...
	<child>
	    <gender>f</gender>
	    <type>shoe</type>
	</child>
</offer>
...

Clothing size

Required parameter. Measured in milliliters. Specified in <child> section, wrapped in <offer>.  Since there are many size charts, each size is prefixed with characterizing dimensional chart type:

Size chart typeDescriptionExample
no prefix or 'r'Russian size chartr44, 44
eEuropean size charte38

no prefix if size is alphabetic, otherwise 'u'

US / international size chartXS, u30
bUK size chartb6
no prefixNo size (applicable for all)

null

hGrowth (for children's products)h89-95

One product may be of several sizes, so the list of sizes is sent:

XML Example
 ...
<offer ...>
    ...
	<child>
	    <gender>f</gender>
	    <type>shoe</type>
		<sizes>
			<size>e40</size>
			<size>e42</size>
			<size>e44</size>
			<size>e48</size>
		</sizes>
	</child>
</offer>
...

 

Age

Optional parameter. Specified in <child> section, wrapped in <offer>.  Minumum and maximum age sent.

XML Example
 ...
<offer ...>
    ...
	<child>
	    <gender>f</gender>
		<age>
			<min>0.25</min>
			<max>1.25</max>
		</age>
	</child>
</offer>
...

 

To verify the age, if the product is intended for children who are less than 2 years, the number of months passed as the fractional part of a decimal:

AgeValue
0-3 mo0
3-6 mo0.25
6-9 mo0.5
9-12 mo0.75
12-18 mo1
18-24 mo1.5

Products for children of this age have their own size chart.

Periodicity

Optional parameter. May have a value from 0 ( for occasional use ) to 1 ( for occasional use ). Specified in <child> section, wrapped in <offer>

XML Example
 ...
<offer ...>
    ...
	<child>
		<periodic>1</periodic>
	</child>
</offer>
...

 

Brand

Optional parameter. Specified in <child> section, wrapped in <offer>

Support for archived files

In order to speed up downloading large XML-files, you can archive them with GZIP archiver. REES46 automatically determines the archive file, decompresses and processes it. Archive format - GNU Gzip.

 

  • No labels