Поддержка разных видов интеграции
Ниже приведены примеры трекинг-кода Product API для всех поддерживаемых типов интеграции.
С поддержкой региональности
<script type="text/javascript">
(window["rrApiOnReady"] = window["rrApiOnReady"] || []).push(function() {
retailrocket.products.post({
"id": <product ID>,
"name": "Example product name",
"price": 777,
"pictureUrl": "http://example.com/path/to/Photo.jpg",
"url": "http://www.example.com/path/to/productPage",
"isAvailable": true,
"categoryPaths": ["Women/Clothes/Skirts","Women/New Arrivals"],
"description": "Some text description",
"vendor": "Brand name",
"model": "Model name",
"typePrefix": "Product type",
"stockId": "Москва",
"oldPrice": 999,
"params": {
"<custom parameter 1 name>": "<custom parameter 1 value>",
"<custom parameter 2 name>": "<custom parameter 2 value>",
"<custom parameter N name>": "<custom parameter N value>"
}
});
rrApi.view(<product ID>);
});
</script>
<script type="text/javascript">
(window["rrApiOnReady"] = window["rrApiOnReady"] || []).push(function() {
retailrocket.productsGroup.post({
"groupId": <group ID>,
"name": "<string>",
"price": 777,
"pictureUrl": "http://example.com/path/to/Photo.jpg",
"url": "http://www.example.com/path/to/productPage",
"isAvailable": true,
"categoryPaths": ["Example/Category/Path","Another/Category"],
"description": "Some text description",
"stockId": "Москва",
"products": {
"<product id>": {
"isAvailable": <bool>,
"name": "<string>",
"color": "<string>",
"size": "<string>",
"url": "<string>",
"pictureUrl": "<string>",
"price": <decimal>,
"oldPrice": <decimal>,
"description": "<string>",
"params": {
"<custom parameter 1 name>": "<custom parameter 1 value>",
"<custom parameter 2 name>": "<custom parameter 2 value>",
"<custom parameter N name>": "<custom parameter N value>"
}
},
"<product id>": {
"isAvailable": <bool>,
"name": "<string>",
"color": "<string>",
"size": "<string>",
"url": "<string>",
"pictureUrl": "<string>",
"price": <decimal>,
"oldPrice": <decimal>,
"description": "<string>",
"params": {
"<custom parameter 1 name>": "<custom parameter 1 value>",
"<custom parameter 2 name>": "<custom parameter 2 value>",
"<custom parameter N name>": "<custom parameter N value>"
}
}
},
"vendor": "Brand name",
"model": "Model name",
"typePrefix": "Product type",
"oldPrice": 999
});
rrApi.groupView([<product IDs>]);
});
</script>
С поддержкой мультиязычности и мультивалютности, без региональности
<script type="text/javascript">
(window["rrApiOnReady"] = window["rrApiOnReady"] || []).push(function() {
retailrocket.products.post({
"id": <product ID>,
"name": "Example product name",
"price": 777,
"pictureUrl": "http://example.com/path/to/Photo.jpg",
"url": "http://www.example.com/path/to/productPage",
"isAvailable": true,
"categoryPaths": ["Women/Clothes/Skirts","Women/New Arrivals"],
"description": "Some text description",
"vendor": "Brand name",
"model": "Model name",
"typePrefix": "Product type",
"oldPrice": 999,
"params": {
"<custom parameter 1 name>": "<custom parameter 1 value>",
"<custom parameter 2 name>": "<custom parameter 2 value>",
"<custom parameter N name>": "<custom parameter N value>",
"languages": {
"<language1>": {
"description": "description in language1",
"name": "name in language1",
"url": "url to product in specific language",
"<custom parameter 1 name in language1>": "<custom parameter 1 value>",
"<custom parameter 2 name in language1>": "<custom parameter 2 value>",
"<custom parameter N name in language1>": "<custom parameter N value>"
},
"<language2>": {
"description": "description in language2",
"name": "name in language2",
"url": "url to product in specific language",
"<custom parameter 1 name in language2>": "<custom parameter 1 value>",
"<custom parameter 2 name in language2>": "<custom parameter 2 value>",
"<custom parameter N name in language2>": "<custom parameter N value>"
}
},
"currencies": {
"EUR": <price in EUR>,
"USD": <price in USD>
}
}
});
});
</script>
<script type="text/javascript">
(window["rrApiOnReady"] = window["rrApiOnReady"] || []).push(function() {
// Передача данных о товарах в группе
retailrocket.productsGroup.post({
"groupId": <group ID>,
"name": "<string>",
"price": 777,
"pictureUrl": "http://example.com/path/to/Photo.jpg",
"url": "http://www.example.com/path/to/productPage",
"isAvailable": true,
"categoryPaths": ["Example/Category/Path","Another/Category"],
"description": "Some text description",
"products": {
"<product id>": {
"isAvailable": <bool>,
"name": "<string>",
"color": "<string>",
"size": "<string>",
"url": "<string>",
"pictureUrl": "<string>",
"price": <decimal>,
"oldPrice": <decimal>,
"description": "<string>",
"params": {
"<custom parameter 1 name>": "<custom parameter 1 value>",
"<custom parameter 2 name>": "<custom parameter 2 value>",
"<custom parameter N name>": "<custom parameter N value>",
"languages": {
"<language1>": {
"description": "description in language1",
"name": "name in language1",
"url": "url to product in specific language",
"<custom parameter 1 name in language1>": "<custom parameter 1 value>",
"<custom parameter 2 name in language1>": "<custom parameter 2 value>",
"<custom parameter N name in language1>": "<custom parameter N value>"
},
"<language2>": {
"description": "description in language2",
"name": "name in language2",
"url": "url to product in specific language",
"<custom parameter 1 name in language2>": "<custom parameter 1 value>",
"<custom parameter 2 name in language2>": "<custom parameter 2 value>",
"<custom parameter N name in language2>": "<custom parameter N value>"
}
},
"currencies": {
"EUR": <price in EUR>,
"USD": <price in USD>
}
}
},
"<product id>": {
"isAvailable": <bool>,
"name": "<string>",
"color": "<string>",
"size": "<string>",
"url": "<string>",
"pictureUrl": "<string>",
"price": <decimal>,
"oldPrice": <decimal>,
"description": "<string>",
"params": {
"<custom parameter 1 name>": "<custom parameter 1 value>",
"<custom parameter 2 name>": "<custom parameter 2 value>",
"<custom parameter N name>": "<custom parameter N value>",
"languages": {
"<language1>": {
"description": "description in language1",
"name": "name in language1",
"url": "url to product in specific language",
"<custom parameter 1 name in language1>": "<custom parameter 1 value>",
"<custom parameter 2 name in language1>": "<custom parameter 2 value>",
"<custom parameter N name in language1>": "<custom parameter N value>"
},
"<language2>": {
"description": "description in language2",
"name": "name in language2",
"url": "url to product in specific language",
"<custom parameter 1 name in language2>": "<custom parameter 1 value>",
"<custom parameter 2 name in language2>": "<custom parameter 2 value>",
"<custom parameter N name in language2>": "<custom parameter N value>"
}
},
"currencies": {
"EUR": <price in EUR>,
"USD": <price in USD>
}
}
},
"vendor": "Brand name",
"model": "Model name",
"typePrefix": "Product type",
"oldPrice": 999
});
rrApi.groupView([<product IDs>]);
});
</script>
С поддержкой мультиязычности, мультивалютности и региональности
<script type="text/javascript">
(window["rrApiOnReady"] = window["rrApiOnReady"] || []).push(function() {
retailrocket.products.post({
"id": <product ID>,
"name": "Example product name",
"price": 777,
"pictureUrl": "http://example.com/path/to/Photo.jpg",
"url": "http://www.example.com/path/to/productPage",
"isAvailable": true,
"categoryPaths": ["Women/Clothes/Skirts","Women/New Arrivals"],
"description": "Some text description",
"vendor": "Brand name",
"model": "Model name",
"typePrefix": "Product type",
"oldPrice": 999,
"stockId": "Москва",
"params": {
"<custom parameter 1 name>": "<custom parameter 1 value>",
"<custom parameter 2 name>": "<custom parameter 2 value>",
"<custom parameter N name>": "<custom parameter N value>",
"languages": {
"<language1>": {
"description": "description in language1",
"name": "name in language1",
"url": "url to product in specific language",
"<custom parameter 1 name in language1>": "<custom parameter 1 value>",
"<custom parameter 2 name in language1>": "<custom parameter 2 value>",
"<custom parameter N name in language1>": "<custom parameter N value>"
},
"<language2>": {
"description": "description in language2",
"name": "name in language2",
"url": "url to product in specific language",
"<custom parameter 1 name in language2>": "<custom parameter 1 value>",
"<custom parameter 2 name in language2>": "<custom parameter 2 value>",
"<custom parameter N name in language2>": "<custom parameter N value>"
}
},
"currencies": {
"EUR": <price in EUR>,
"USD": <price in USD>
}
}
});
});
</script>
<script type="text/javascript">
(window["rrApiOnReady"] = window["rrApiOnReady"] || []).push(function() {
// Передача данных о товарах в группе
retailrocket.productsGroup.post({
"groupId": <group ID>,
"name": "<string>",
"price": 777,
"pictureUrl": "http://example.com/path/to/Photo.jpg",
"url": "http://www.example.com/path/to/productPage",
"isAvailable": true,
"categoryPaths": ["Example/Category/Path","Another/Category"],
"description": "Some text description",
"stockId": "Москва",
"products": {
"<product id>": {
"isAvailable": <bool>,
"name": "<string>",
"color": "<string>",
"size": "<string>",
"url": "<string>",
"pictureUrl": "<string>",
"price": <decimal>,
"oldPrice": <decimal>,
"description": "<string>",
"params": {
"<custom parameter 1 name>": "<custom parameter 1 value>",
"<custom parameter 2 name>": "<custom parameter 2 value>",
"<custom parameter N name>": "<custom parameter N value>",
"languages": {
"<language1>": {
"description": "description in language1",
"name": "name in language1",
"url": "url to product in specific language",
"<custom parameter 1 name in language1>": "<custom parameter 1 value>",
"<custom parameter 2 name in language1>": "<custom parameter 2 value>",
"<custom parameter N name in language1>": "<custom parameter N value>"
},
"<language2>": {
"description": "description in language2",
"name": "name in language2",
"url": "url to product in specific language",
"<custom parameter 1 name in language2>": "<custom parameter 1 value>",
"<custom parameter 2 name in language2>": "<custom parameter 2 value>",
"<custom parameter N name in language2>": "<custom parameter N value>"
}
},
"currencies": {
"EUR": <price in EUR>,
"USD": <price in USD>
}
}
},
"<product id>": {
"isAvailable": <bool>,
"name": "<string>",
"color": "<string>",
"size": "<string>",
"url": "<string>",
"pictureUrl": "<string>",
"price": <decimal>,
"oldPrice": <decimal>,
"description": "<string>",
"params": {
"<custom parameter 1 name>": "<custom parameter 1 value>",
"<custom parameter 2 name>": "<custom parameter 2 value>",
"<custom parameter N name>": "<custom parameter N value>",
"languages": {
"<language1>": {
"description": "description in language1",
"name": "name in language1",
"url": "url to product in specific language",
"<custom parameter 1 name in language1>": "<custom parameter 1 value>",
"<custom parameter 2 name in language1>": "<custom parameter 2 value>",
"<custom parameter N name in language1>": "<custom parameter N value>"
},
"<language2>": {
"description": "description in language2",
"name": "name in language2",
"url": "url to product in specific language",
"<custom parameter 1 name in language2>": "<custom parameter 1 value>",
"<custom parameter 2 name in language2>": "<custom parameter 2 value>",
"<custom parameter N name in language2>": "<custom parameter N value>"
}
},
"currencies": {
"EUR": <price in EUR>,
"USD": <price in USD>
}
}
},
"vendor": "Brand name",
"model": "Model name",
"typePrefix": "Product type",
"oldPrice": 999
});
rrApi.groupView([<product IDs>]);
});
</script>
Updated about 2 years ago