Can you use ChatGPT with Shopify?
Blog

Can you use ChatGPT with Shopify?

January 31st, 2023

Can the AI revolution help your ecommerce sales? We look at the revolutionary ChatGPT and use the API to integrate it into a Shopify store

Sunrise Integration
  by Sunrise Integration

What is ChatGPT?

 

It's probably safe to say that by now most people have probably heard about ChatGPT. If you haven't, let's just say it's this crazy Star Trek-ish artificial intelligence (AI) technology that magically generates text. You can ask it to write a story or answer any question, even create Shopify blogs for you. You can also build on the conversation as it remembers your previous queries and the answers it gives.

 

The results are natural-sounding language completely created by AI. It's fun, astonishing, and a bit scary. Does this signal the death knell for writers? Will computers start creating our sitcoms and trashy romance novels? No one knows for sure, however, the cat is out of the bag and the ride from here will be wild.

 

Of course, most people are plotting the financial angle. Is there a profit to be had by marrying artificial intelligence and ecommerce?

 

Can ChatGPT Enhance Ecommerce?

 

We wondered if there was a way for ChatGPT to help in the ecommerce space. If you're running a Shopify store for example, could something like this help your business? If you think about the quantity of text on any ecommerce store, the answer seems like a resounding, yes. This technology can really do wonders for your store. Here are some quick ideas that come to mind:

 

  • Write engaging and useful product descriptions

  • Generate benefits and perks of a product

  • Create blog posts

  • Write marketing copy to promote your service

  • Generate newsletter emails

 

That only scratches the surface of potential use cases. So, let's put ChatGPT to the test and see how it solves some of these common business issues.

 

Using ChatGPT and Shopify

 

Here's a typical problem for anyone who's running an ecommerce store. You have a huge list of products, but lack marketing copy and descriptions. You're tempted to just copy the title into the description and call it a day. This is a bad idea. You're missing out on a golden opportunity to gain valuable SEO. If you suck at writing text, what choice do you have? Let's turn to ChatGPT to save the day.

 

For our test, we'll create a new product in our Shopify store. Let's try something basic like a candle. The title is obvious, "Vanilla Candle", but what do we write for the description? You can only stare at that blank text box for so long before you go crazy:

 

Create a blank new product in Shopify

 

This sounds like the perfect time to turn to our friendly neighborhood AI friend and ask it to write the copy for us. Just open the ChatGPT site, enter the query and copy the results into your store. So let's try it:

 

Query:

"Write a product description for a Vanilla Candle with benefits"

 

Result from ChatGPT:

"This Vanilla Candle is the perfect addition to any home. Its warm, inviting scent will fill your home with a cozy, comforting aroma. Not only does it smell great, but it also has many benefits. The natural essential oils in the candle help to reduce stress and anxiety, while the calming scent of vanilla helps to promote relaxation. The candle also helps to purify the air, eliminating odors and creating a more pleasant atmosphere. With its long-lasting burn time, this candle is sure to provide hours of relaxation and enjoyment."

 

Wow, that was easy and the text looks pretty great. I'm sure that will sell some candles. If we repeat that process for all our products, our store will sounds like a Lands End catalog in no time. But wait, what happens when you have thousands of items in your shop? Is there a way to automate this process and loop through blank descriptions and automatically ask ChatGPT to generate text? This sounds like the perfect project for our API development team.

 

Let's Dive Into the API

 

The team behind ChatGPT (OpenAI) provides a powerful API that allows for programmatic access to their natural language services. An integration with their API allows us to automate our product description process and easily handle thousands of items at scale. If we combine the Shopify product API, with the Open AI text completion service, we can develop a background process to update the items in our store. This will involve writing some code so let's open our MacBooks, fire-up Visual Studio and create a Node JS API integration service.

 

Our goal is to use the Shopify API to GET products with blank descriptions, use the ChatGPT API to generate the product text, then PUT the new copy into our Shopify store. We'll utilize the OpenAI API reference to generate our results. The Completions endpoint returns the predictive text based on the given parameters. In our micro-app, we will create a service that extracts an array of Shopify products and uses the title as a variable that is inserted into our GPT query:

 

Basic example of Node.js code to loop for ChatGPT

 

During each loop, our service will send the generated query to our function that calls ChatGPT. The processes uses Fetch to make HTTPS calls to the API. An example of the final request is illustrated in the CURL call below:

 

curl https://api.openai.com/v1/completions \  

-H 'Content-Type: application/json' \  

-H 'Authorization: Bearer ###########' \  

-d '{      

"model": "text-davinci-003",      

"prompt": [generated query],      

"max_tokens": 30,      

"temperature": 0

}'

 

The ChatGPT API will return the JSON with the desired text completion:

 

Use ChatGPT to write product description

 

Our background service saves each text response and updates the product in Shopify. It cycles through all the items in our Shopify store. And like magic, each product gets an amazing description complete with user benefits. It sounds and looks professional. Your customers will be more engaged and see the benefits of your products:

 

Use ChatGPT to write the product description for Shopify

 

The best part is how quickly and easily you can add high-quality descriptive text to your site without having to write anything yourself. You can provide details and benefits for all of your products and even come up with cool marketing copy for your business. For example, let's say we want a cool tagline for our candle company:

 

Query:

"Write a marketing tagline for a candle company"

 

Result from ChatGPT:

Light up your life with our scented candles!

 

How about we create a company about page along with our mission statement and business brief:

 

Query:

"Write a company brief for a candle company"

 

Result from ChatGPT:

Welcome to [Company Name], a candle company that specializes in creating unique and luxurious scented candles. Our candles are made with the highest quality ingredients and are designed to bring a sense of warmth and comfort to any home. We offer a wide variety of scents, from classic favorites to unique blends, so you can find the perfect candle for any occasion. Our candles are hand-poured in small batches to ensure quality and consistency. We also offer custom candles for special occasions.

 

Wow, not bad, we sound like a big-time candle maker. Is any of that true? Does our candle business have a wide variety of scents? Are they really hand-poured? Who knows, it's all made up from the AI mind (if we can call it that) of ChatGPT.

 

 

The AI Help You Need for Your Store

 

ChatGPT can certainly help with any aspect of your ecommerce site that needs text. As we've illustrated, everything from product descriptions, blogs, to marketing copy can be auto-generated from ChatGPT. That is only the tip of the iceberg when it comes to AI and ecommerce. In our next blog, we will explore more use cases of ecommerce and AI.

 

Let us know if you need AI help with your ecommerce store. Contact us and let's chat about your needs:

RELATED ARTICLES

Tags:   ai   shopify   chatgpt