I'm terrible with numbers. Unfortunately, a big part of being a writer is knowing how to analyze blog metrics. Identifying which articles drive the highest engagements, activations, and upgrades can determine a lot about what I should be writing and whether or not I'm hitting those targets.
Fortunately for me, ChatGPT can help. One of the best things about it is that it can analyze complex performance data (like those pesky numbers)—then explain it to me in a way I actually understand.
Even better, when you pair ChatGPT with Zapier you can create an analysis assistant that connects to other apps you use. With a Zap—Zapier's automated workflows—you can automatically send Gmail attachments to ChatGPT for analysis, then receive a performance report in Slack.
New to Zapier? It's workflow automation software that lets you focus on what matters. Combine user interfaces, data tables, and logic with thousands of apps to build and automate anything you can imagine. Sign up for free.
Before you begin
Make sure you set up a free OpenAI account before getting started. Once you've opened your account, head over to https://platform.openai.com/api-keys.
Then, click the + Create new secret key button to generate your API key. Make sure to copy the key while you're here. You'll need it later when connecting your OpenAI account to Zapier.
You'll also need to create your assistant within OpenAI. To do this, head over to https://platform.openai.com/assistants. This is where all the assistants you create are stored, including the assistant ID, instructions, and date created. To create a new assistant, click +Create in the top-right corner.
Now it's time to configure your assistant. For the focus of this tutorial, I want to create an expert analysis assistant that can analyze important performance data related to my fictional blog, A day in the life of Winston. But you could also set up an assistant that analyzes all sorts of data, like KPIs, sales performance metrics, or website traffic metrics.
Give your assistant a name, like so:
Next, you should provide it with the specific instructions relevant to its role.
In my case, I will instruct my assistant to analyze things like page views, unique visitors, sign-ups, and activations. I'll also tell it to identify the most engaging content, determine which are the top pieces that drive activations and sign-ups, and to analyze the efficacy of the SEO strategies in place.
Here's my example:
Next, select the OpenAI model you want to use. Because we'll be using the file retrieval tool, we'll select gpt-4-1106-preview.
Note: The Retrieval tool requires gpt-3.5-turbo-1106 or gpt-4-1106-preview models.
Under Tools, you can select either a code interpreter or a retrieval function. The retrieval function allows your assistant to respond to users' questions with knowledge from documents or files you upload. The code interpreter function allows your assistant to analyze complex data, like from a CSV file. However, because my file will be in a PDF format, I'll enable the retrieval function.
Finally, you can upload the files to your assistant's knowledge base by clicking Add file. Because I'll be uploading the file directly from Gmail in my Zap, I won't need to add any files here. But you could, for example, add any files that explain your company's ideal KPIs or performance targets, so that your assistant has more context when analyzing the file you upload in your Zap.
Build an analytics assistant to analyze data
With Zapier, you can create automated workflows (we call them Zaps) that send information between different apps. You can create a Zap from scratch or use a template to get started quickly.
Getting started with a template is easy. Click on the Zap template below, which will take you to the Zap editor. You'll be prompted to create a Zapier account if you don't have one already. Once that's done, just follow the instructions below to set up your Zap.
Analyze data and metrics from Gmail attachments with ChatGPT and send to Slack
Multi-step Zaps—available on our paid plans—allow you to add multiple actions, filters, and even branching logic so you can do more, automatically. Learn how to use multi-step Zaps.
Set up your Gmail trigger
Time to set up your trigger—the event that starts your Zap. Choose Gmail for your trigger app and New Attachment as your event. If you're using the Zap template, this will already be selected for you.
Connect your Gmail account if you haven't already. Click on Choose an account… and click + Connect a new account, or select an account from the dropdown menu if you've connected Gmail to Zapier before. Click Continue.
Next, select which label or mailbox you'd like your Zap to trigger on.
Keep Inbox and All Labels selected if you want every email you receive to be checked for attachments. In my case, however, I only want it to trigger on emails labeled "blog performance", a label I previously set up in Gmail.
Leave Search String blank if you've set up an email label. Otherwise, enter any text you want to include (like from: David or subject: KPIs).
Click Continue.
Now you need to test your trigger. Zapier will find a recent email in your Gmail account that matches the label or inbox you selected earlier. If you don't have any email that matches the specifications you selected, you should send one to yourself now. This will be used to set up the rest of your Zap.
Click Test trigger. You should see a selection of recent emails in your inbox. Select a test record, then click Continue with selected record.
Set up your ChatGPT action
Now let's set up your action—the event your Zap will perform once it's triggered. Choose ChatGPT as your action app and Upload File as your action event. This action is what will upload your Gmail attachment to OpenAI—and your assistant. If you're using the Zap template, this will already be selected for you. Click Continue.
Next, a pop-up window will appear asking for the OpenAI API key that you copied earlier. Paste it into the API Key field, and click Yes, Continue to ChatGPT.
Now it's time to set up your action. You can pull data from your Gmail step by clicking inside the File field and picking an option from the Insert Data dropdown. In our case, we'll want to pull in the Gmail attachment file and the file name, so we can easily find it later on.
Under Purpose, select assistants from the dropdown, so the Zap knows it will need this file in the next step.
Click Continue.
Next, you'll test your action. Click Test & Review or Test & Continue, and Zapier will upload the file to ChatGPT.
If you're not using the Zap template, click the + button below your action step.
Set up your second ChatGPT action
Now let's set up the second action. Choose ChatGPT as your action app and Conversation with Assistant as your action event. If you're using the Zap template, this will already be selected for you. Click Continue.
Once again, connect your OpenAI account and click Continue.
Now it's time to set up your action. You can pull in data from your previous steps by clicking inside the Message field and picking an option from the Insert Data dropdown. In our example, I'll type in a brief description of what I want it to do and the file's name for context:
Now it's time to select the assistant you previously set up in OpenAI. Click inside the Assistant field and pick the right one from the Insert Data dropdown.
Leave the fields Assistant Name, Assistant Instructions, and Model blank, as you've already configured this information within OpenAI. You'd only fill out these fields if you want to create a new assistant every time your Zap runs or if you want specific instructions to override the existing assistant you created in OpenAI.
Next, under Tools, select the Retrieval functionality from the dropdown.
Now scroll down to the Existing Files field. Here you'll want to pull in the data file pulled in by your previous ChatGPT step. Click inside the field and select your uploaded file from the dropdown menu.
Once you've finished customizing these fields, click Continue.
Next, you'll test your action. Click Test & Review or Test & Continue, and Zapier will pull the response from your assistant according to how you customized your instructions.
Finally, click on the +icon beneath your second action step.
If you're using the Zap template, this will already be added for you.
Set up your Slack action
Now, you'll set up the step that sends your ChatGPT response to Slack. Choose Slack for your action app and Send Direct Message for your action event. Again, if you're using the Zap template, this will be set up for you.
You'll be asked to connect your Slack account. Connect the Slack account where you want the message to be posted.
Click Continue.
Now it's time to set up how the message from your ChatGPT assistant will look in Slack and where it'll be posted.
In my case, I want to set up a direct message that gets sent directly to myself (and no other users), so I'll select No under Send Multi Message. Under To Username, select your Slack username from the dropdown menu.
Add any other context you want to the Message Text field, and make sure to include Full Response from the data dropdown, as that contains your response from ChatGPT.
You can also customize where the message comes from, such as from a bot or yourself. If you choose a bot, you can customize things like the bot name and the icon that appears next to it.
You can also include a link to the Zap, attach an image by URL, auto-expand links, and link usernames and channel names.
Once you've customized your message, click Continue.
Now it's time to test your action. Click Test action. Zapier will send you a direct message in Slack to make sure your Zap is working.
If everything looks good with your Slack message, then your Zap is ready to use. If something looks off or your test fails, go back and adjust until your message looks how you'd like it to.
Bring the power of AI-assisted analysis into your workflows
Now, whenever you receive a new email attachment in Gmail, your Zap will send it straight to ChatGPT for analysis. Finally, you'll receive a full breakdown of the numbers—that make actual sense—directly in Slack.
Building assistants in your Zaps lets you get a detailed overview of previously murky areas, helping you identify patterns to improve performance over time. What's not to love?