[ { "label": "Tag customers with the product types of items purchased", "trigger_type": [ "order_created" ], "object_type": "order", "app_id": "triggers", "settings": { "priority": 0, "condition_groups": { "1": { "conditions": [], "actions": { "1": { "type": "customer_add_tags", "settings": { "token_object_type": "order", "tags": "{% set tags =[] %}\r\n{% for line_item in order.line_items if not tags|contains(line_item.product.product_type) %}\r\n{% set tags = tags|merge([line_item.product.product_type]) %}\r\n{% endfor %}\r\n{{tags|join(\",\")}}", "wait": "0", "cw_timezone": "Africa\/Nairobi", "custom_wait": "" }, "weight": 999, "target_key": "order.customer" } } } }, "shared_workflow_id": 266051 }, "description": "When an order is placed, this workflow scans all purchased items and assigns customer tags based on product types. This automation is very helpful for merchants who want to categorize customers according to the types of products they buy, such as subscriptions and services. \r\nPro tip: To optimize customer tagging, ensure that products have the correct custom product types assigned." } ]