- DarkLight
Product Tagging User Guide
- DarkLight
Product Tagging refers to the association of a tag to a specific product in the Yotpo database. These tags are used in Custom Questions which can include user or product-related questions and can be located in the data-product-tags field in the Yotpo Main Widget div. You can assign tags in the Widget upon order creation, through API endpoints, or by importing or modifying your product catalog.
In this article, you'll learn how to assign tags to the products in your product catalog.
Shopify users
You can use Shopify's own tagging system to tag products. Learn more
Adobe Commerce users
You can use Adobe Commerce's own tagging system to tag products. Learn more
Before you start
We highly recommend defining your product tags prior to creating new Custom Questions.
To get the most out of this feature, make sure you check the Custom Questions Requirements
Assigning tags using the product catalog
Product tags may be assigned to products via catalog import and updated via catalog update.
When updating product tags via catalog update, values replace the existing values.
- For information on adding product tags using product catalog Import, click here.
- For information on adding product tags using product catalog Update, click here.
Assigning tags by API endpoint
- Create Mass Orders within the Yotpo System
- POST: https://api.yotpo.com/apps/:app_key/purchases/mass_create.json
- Create an Order within the Yotpo System
POST https://api.yotpo.com/apps/YOUR_APP_KEY/purchases
{
"validate_data": true,
"platform": "general",
"utoken": "YOUR_UTOKEN",
"email": "client@abc.com",
"customer_name": "bob",
"order_id": "order_1",
"order_date": "2010-10-14",
"currency_iso": "USD",
"products": {
"SKUaaa12": {
"url": "http://example_product_url1.com",
"name": "product1",
"image": "http://images2.fanpop.com/image/photos/13300000/A1.jpg",
"description": "this is the description of a product",
"price": "100",
"specs": {
"upc": "USB",
"isbn": "thingy"
},
"product_tags": "book"
}
}
}
Editing tags by API endpoint
To edit tags using the Create an Order within the Yotpo System endpoint, simply re-submit the product tag again in the same order, replacing the tag you wish to change.
Deleting tags by API endpoint
To delete a tag using the Create an Order within the Yotpo System endpoint, simply replace the product tag you wish to delete with "".
Example:
POST https://api.yotpo.com/apps/DsVSLp1V2hR7I61HkTFYFdASd/purchases
{
"validate_data": true,
"platform": "general",
"utoken": "5KS69gfxtymYGa8RYF27WT1tbnASAze8rkhLVglZ",
"email": "client@abc.com",
"customer_name": "bob",
"order_id": "order_1",
"order_date": "14-10-2010",
"currency_iso": "USD",
"products": {
"aaa12": {
"url": "http://example_product_url1.com",
"name": "product1",
"image": "http://images2.fanpop.com/image/photos/13300000/A1.jpg",
"description": "this is the description of a product",
"price": "100",
"product_tags": ""
}
}
}
Creating tags using the widget
If multiple tags are assigned to a product in the widget, all tags assigned to that product will be ignored. A product tag will only be accepted when a single tag is assigned to a product in the widget.
To assign a product tag using the Yotpo Main Widget:
- Open the main widget on your product page.
- Add the data-product-tags field to the div.
<div class="yotpo yotpo-main-widget"
data-product-id="{PRODUCT_SKU}"
data-name="{PRODUCT_NAME}"
data-url="{PRODUCT_URL}"
data-image-url="{IMAGE_URL}"
data-description="{PRODUCT_DESCRIPTION}"
data-product-tags="{TAG}">
</div>
Example:
To add the tag “paper” to PROD1234, refer to line 7:
<div class="yotpo yotpo-main-widget"
data-product-id="PROD1234"
data-name="75 GSM US Letter White Printer Paper"
data-url="http://www.gkstore.com/paper/75GSMUSLWPP.html"
data-image-url=" http://www.gkstore.com/paper/75GSMUSLWPP.JPG"
data-description="Plain white paper for laser printers. 75 GSM"
data-product-tags="paper">
</div>