How to automate Shopify product categorization with AI: A smarter alternative to ChatGPT

Save hours of manual categorization while cutting costs by 80% compared to ChatGPT. Product Classifier delivers accurate, hallucination-free results with just 2 API calls per product—set up in 15 minutes.

Managing product categories in Shopify is a time-consuming challenge. With over 10,000 categories in the Shopify Product Taxonomy, manually classifying each product can become overwhelming.

Our Shopify app Cloudhooks, combined with Product Classifier, can automate this process, potentially saving hours of manual categorization work.

Unlike generic AI solutions that can sometimes hallucinate or provide inconsistent results, Product Classifier uses purpose-built classification algorithms while potentially reducing categorization costs by 80% compared to general-purpose AI solutions.

In this tutorial we'll show you step by step how to set up this automation, and how you can save both time and money by automating this process.

Time to complete: ~15 minutes
Difficulty level: Beginner

Prerequisites

This tutorial assumes that you have:

  • Cloudhooks installed in your Shopify store
  • A Product Classifier account (free trial available)
  • An email address for registration

Why Product Classifier is often better than generic AI for product categorization

Before diving into the setup, it's important to understand why Product Classifier can be a better choice for e-commerce categorization:

Specialized vs. General-Purpose AI

While OpenAI's ChatGPT is impressive for general tasks, it wasn't designed specifically for product categorization. This leads to several critical issues:

  1. Hallucination: ChatGPT often invents categories that don't exist in the taxonomy, creating inconsistent and unreliable results.
  2. Inconsistent formatting: Despite detailed instructions, ChatGPT may return responses in varying formats, breaking your automation.
  3. Higher costs: GPT-5 API calls are expensive, and the multi-step process (creating threads, sending messages, polling for results) multiplies costs.
  4. Slower processing: The assistant API requires multiple round trips and polling, adding latency to your categorization.

Product Classifier's advantages

Product Classifier solves these problems with:

  • Single API call: No threads, no polling, just faster results
  • Cost-effective: Typically 80% cheaper than GPT-5 API calls
  • Consistent output: Designed to return properly formatted JSON
  • Custom AI instructions: Tell the AI how to categorize like you'd explain to a human
  • Trial included: 50 free classifications to test the service

Set up Product Classifier

First, we'll create a Product Classifier account and generate API credentials for accurate product categorization.

Create your account

Visit https://productclassifier.com and click "Get Started":

Enter your email address on the sign-up page. You'll receive a confirmation code via email. Enter this code to create your account:

Your account includes a 7-day trial with 50 classification credits—perfect for testing the integration before committing.

Test and configure classification

Before generating an API key, let's test the classification in the Playground:

Navigate to the Playground page and enter a product description. Include:

  • Product name
  • Key features and specifications
  • Brand and manufacturer details

The more detailed your description, the more accurate the classification.

Classification typically takes a few seconds and returns the appropriate product category.

Click the settings button (top right) to customize classification behavior:

Custom AI Instructions: Your Secret Weapon

One of Product Classifier's most powerful features is the ability to provide custom AI instructions. Just like explaining to a human employee how to categorize products in your store, you can give specific guidance to the AI.

For example, if you sell vintage clothing, you might add instructions like:

  • "Always categorize vintage band t-shirts under 'Apparel & Accessories > Clothing > Shirts & Tops' rather than under collectibles"
  • "Handmade jewelry should be categorized based on the type of jewelry, not the fact that it's handmade"
  • "For our eco-friendly products, prioritize the product type over the sustainable aspect when choosing categories"

These custom instructions guide the AI toward your preferred categorization approach, helping it make decisions that align with your store's organization and improving consistency across your catalog.

Generate an API key

Navigate to the API Keys page and generate a new key.

Important: Copy and save this key immediately—it will only be displayed once:

Note: Your trial includes 50 classification credits. API requests will be rejected once these are exhausted. Upgrade your account to continue using the service beyond the trial.

Set up the hook in Cloudhooks

Now we'll create a hook in Cloudhooks that automatically triggers the AI categorization whenever a new product is added to your store. This hook will:

  1. Detect when a new product is added
  2. Send the product details to Product Classifier
  3. Receive the categorization response
  4. Apply the category to the product

Create the hook

Follow these steps:

1) From your Cloudhooks dashboard, click "Create hook" in the top-right corner:

2) Configure the trigger:

  • Open the "Trigger" tab
  • Navigate to the "Product" category
  • Select "A product is added"
  • Click "Select trigger"

3) Add the hook code - navigate to the "Hook" tab

Copy the template code from:
https://gist.github.com/cloudhooks/996157f0717bb67bd4df4922f3f5f6e7

Paste the code into the editor.

4) Configure authentication and environment variables

To set up the authentication credentials and other configuration values, navigate to the "Environment Variables" section in your hook settings:

Configure the following environment variables:

  • API_URL: Set this to the Product Classifier API URL (typically https://api.productclassifier.com/api/v1/products/categorize)
  • API_KEY: The API key you generated in Product Classifier (from the earlier step)
  • CATEGORIZATION_TAG: A tag that will be added to categorized products to prevent infinite loops (eg., ai-categorized)
  • CUSTOM_INSTRUCTIONS (optional): Any specific instructions for how the AI should categorize your products (e.g., "Always prioritize material type over color when categorizing clothing")

These environment variables keep your sensitive data secure and make your hook more maintainable. The CATEGORIZATION_TAG prevents products from being categorized multiple times (avoiding infinite loops). Products with this tag won't be processed again. To re-categorize a product, simply remove this tag and save.

5) Configure and test

On the Settings tab, name your hook and save it (don't activate yet):

Return to the Hook tab and click "Run Test". This will:

  • Process a test payload (T-shirt data)
  • Call Product Classifier without modifying your store
  • Display the classification results in the "Test" tab

6) Activate the hook

Once testing is successful, return to the Settings tab and activate your hook:

Testing categorization in Shopify

Create a test product

In your Shopify Admin, navigate to Products and click "Add Product":

Add product details

Fill in the product information:

  • Title: Product name
  • Description: Details including:
    • Product characteristics and features
    • Target use cases or audience
    • Any relevant specifications

Remember: More detailed descriptions result in more accurate categorization.

Verify the results

After saving the product:

  1. Shopify triggers a webhook to Cloudhooks
  2. The hook processes the product data through Product Classifier
  3. The product category is automatically updated
  4. A categorization tag is added to prevent reprocessing

Refresh the product page to see the assigned category and tag:

Review the logs

Check the Cloudhooks logs for detailed classification information:

Understanding the hook

How it works

When a new product is added to Shopify, this hook:

  1. Receives the product data from Shopify
  2. Sends product information to Product Classifier's API
  3. Receives immediate categorization results
  4. Parses the response and formats tags
  5. Updates the product tags in Shopify

Simplified Process

The hook's streamlined process:

  1. Checks if the product has already been categorized (via a special tag) and exits if it has
  2. Calls Product Classifier API with product details (1 action)
  3. Updates the product's tags in Shopify, including a tag to mark it as categorized (1 action)

This efficient process consumes only 2 Cloudhooks actions per product—a 67% reduction compared to the OpenAI approach.

Customizing and optimizing

Tips for more accurate categorization

Product Classifier is designed to provide accurate results, but you can further improve categorization by:

  1. Providing detailed descriptions: Include brand, model, materials, and use cases
  2. Writing custom AI instructions: Add specific rules for your unique product catalog—tell the AI exactly how you want certain products categorized, just as you would train a human employee

Best Practices

Follow these guidelines for optimal results:

Testing

  • Test with various product types
  • Monitor categorization accuracy
  • Review and adjust as needed

Maintenance

  • Product Classifier automatically uses the latest taxonomy versions
  • Monitor API usage and costs
  • Keep API keys secure and updated

Conclusion

You've successfully set up automated product categorization! The system will now automatically classify all new products added to your store with reliable, accurate categories from the Shopify Product Taxonomy.

Why Product Classifier can be a better choice

After implementing both solutions, Product Classifier offers several potential advantages:

  • Reliability: No hallucinations or invented categories
  • Speed: Single API call vs. multi-step polling process
  • Cost: 67% fewer Cloudhooks actions, 80% lower API costs
  • Simplicity: No assistant configuration, no prompt engineering
  • Accuracy: Purpose-built for e-commerce categorization

Next steps

  • Monitor your credit usage in Product Classifier
  • Review categorization accuracy in your logs