Zapier — Twitter Sentiment Tool

District Soup
Entrepreneurship Technology Class Blog
11 min readMar 25, 2019

A visual how-to guide to creating a sentiment analysis tool to predict consumer confidence in your brand

Photo by rawpixel on Unsplash

Other Team Members: Jacqueline Dowhanik, Micheal Friesen

The Problem

Social media is a standard marketing tool for companies to engage with their customers and build a consumer brand. However, according to CB Insights, social media can also have the opposite effect when the wrong post is created and shared. Examples of corporate social media fails include mishandled responses and misguided campaigns that are completely out of touch with the attitudes in the marketplace.

An example of a social media fail

Solution

We created a sentiment analysis tool for Twitter that will evaluate the consumer confidence of a product or service. This tool can help companies adjust their social media marketing campaigns to be in alignment with market opinions and attitudes.

Twitter is being chosen as the medium to conduct the sentiment analysis because it is considered as the best channel for word-of-mouth consumer advocacy and the most likely platform a consumer will express negative attitudes towards a brand.

Hypothesis

We believe that by combining the following tools, we can create a sentiment analysis tool that will help marketers to create the appropriate social media content to improve sales.

We will be using four primary tools to analyze Twitter data and the University of Calgary will be our test subject.

  • Twitter — The source of our customer opinion
  • Google Account- The platform used to store our data, as well as create our dashboard
  • MonkeyLearn — The platform used to categorize the sentiment and keywords of our Twitter data
  • Zapier — The piece used to connect everything together

Steps to Create the Sentiment Analysis Tool:

Section 1 — Creating Accounts

Twitter Account Sign-up

Step 1.1: Set up a Twitter account

Follow instructions on the Twitter ‘Sign up’ page to create an account. The Twitter account will be used to search for Twitter posts. You can use your own Twitter account if you already have one.

  • Note:* This user account will not be analyzed. The account is only being used to gain access to Twitter.

Step 1.2. Create a Google Sheet

This will be the place of storage for all of our Twitter data.

Create a sheet with two tabs —Twitter Data and Analyzed Data.

In red are the headers to copy, and in yellow are the two worksheets

These sheets will allow use to store our data, so the headers need to be copied exactly. Ensure these spreadsheets remain blank.

Step 1.3: Create a Monkey Learn account

Follow the instruction on Monkey Learn ‘Login’ page to create an account.

Monkey Learn is a text analysis tool that can analyze raw text and turn it into meaningful data. Learn more about Monkey Learn here

Step 1.4: Create a Zapier Account Follow instructions on Zapier ‘Sign Up’ page to create an account.

Section 2 — Get Zappy!

Zapier is a powerful tool. It allows us to connect applications, essentially leveraging the code other people have written to build functions called Zaps. Our goal is to take some searched term on Twitter, deposit it into a Google sheet, then analyze the data, allowing users to make better decisions!

Zap 1 — Twitter to Google Sheets

This is a two-step Zap with a simple goal. When someone tweets @(insert our social media page here), we want to capture it and save it in a google sheet.

Step 2.1 — Make a Twitter trigger

Step 2.1) To begin, select Twitter as our trigger app like so.

Step 2.2 — Select a search mention trigger

Step 2.2) After this, we need to select a search mention trigger. In Zapier jargon, a trigger tells Zapier when to start our Zap.

Step 2.3 — Authenticate your Twitter account

Step 2.3) After selecting search mention as our trigger, we must log in with the Twitter account from our initial setup. You can use any twitter account for this purpose, as it will be the one searching twitter.

*Note*: This account may require phone verification, as Twitter will only allow for a small number of queries for unverified accounts. If you notice something going wrong in your zap, try logging into Twitter. It will walk you through the verification process.

Step 2.4 — Choose a search term

Step 2.4) After authenticating your Twitter account, we now need to add our search term! For our purposes we used @UCalgary, to see what people thought about our University, but this could be any company. This tool is designed for use for your own company.

Step 2.5) Test the step. This is very straight forward, and will simply test if you have followed the instructions properly. If something goes wrong, try to fix the error as described. Zapier is a very friendly tool to use so it should walk you through what you need to fix.

Step 2.6

Step 2.6) (Optional) Create a filter to remove retweets from results.

We created this filter after our analysis. MonkeyTest only provides 300 total queries per month in the free version plan.

Retweets don’t add much new information, so we decided to omit them to save calls.

Add a new step, and choose the filter app.

Select Only Continue if… so that we only store the results from Twitter if we confirm Retweeted is false.

The last step is to check if Retweeted is false. Once this is complete, test and continue to add the final step for this Zap

Step 2.7 — Create a new Google Sheets action

Step 2.7) Create a new entry in Google Sheets

Now we are going to select Google sheets as the last app for this Zap.

Step 2.8 — Create a spreadsheet action selection

Step 2.8) After selecting Google sheets, select create spreadsheet row. This will allow us to store the information grabbed from Twitter.

Step 2.9) Authenticate your Google account. This is straightforward and exactly like the authentication process in step 2.3.

Step 2.10) Fill in your google sheet with the Twitter data.

Select the Spreadsheet you created in the initial setup, then select the worksheet of Twitter Data. Then select the twitter information that is associated with each field as seen below. This will show different data, as your search term would be different then UCalgary.

Step 2.10 — The template used for storing Twitter data

Your Zap should now look like this!

Pat yourself on the back! You are finished your first Zap! Don’t turn it on yet, we will do that once we have finished the second Zap.

Section 3 — Zap Number Two, the return of the Zapier

Now that we have all the data we want to analyze going into a spreadsheet, we need to create a zap that will take that data, analyze it, and put it into the other worksheet.

Step 3.1

Step 3.1) Select Google Sheets as a trigger

Step 3.2

Step 3.2) Select “New Spreadsheet Row” as the trigger.

Step 3.3 and 3.4

Step 3.3) Authenticate with the same account used in the first Zap

Step 3.4) Select the Sheet that was used in Zap one. All of this together means that when there is a new tweet that matches our search query, it will start this other Zap.

Step 3.5

Step 3.5) Add a new step and choose Monkey Learn as the action app. This is the platform that will be used to analyze our Twitter data.

There are a few options here, but we went for the most simple approach for implementation, and reliability. You can opt to train your own learning model, by feeding in a large amount of data to MonkeyLearn, but we chose one of the premade sentiment analyzers.

Step 3.6

Step 3.6) Select the “Classify Text” Action

Step 3.7

Step 3.7) Select the MonkeyLearn (1.2.4) model. This is one that has already been trained, meaning it should be ready to go!

Step 3.8

Step 3.8) Chose what is being classified. In this case, we want the text that we pulled from Twitter to be classified! Add it in to the template provided, as shown.

Step 3.9) Test the step! Once it passes, you are ready for the second MonkeyLearn step!

Step 3.10) Create another MonkeyLearn action like in step 3.5.

Step 3.11

Step 3.11) This time we are going to select “Extract Text”, so we can try to find some patterns among our data. These will be the keywords we use to analyze our data.

Step 3.12

Step 3.12) Complete the remaining steps as we did before with our last Monkey Learn action. Once we get to the ‘edit template’ step, we will choose “KeywordExtractor” as shown below.

Once you have tested this action, we have one final action and we are finished!

Step 3.13) Create a new Google Sheets action. This is done in the same way as step 2.8–2.10.

This includes selecting the “create spreadsheet row” action but, instead of storing this data in the Twitter Datasheet, we will store it in a template shown below:

Step 3.13 — Template for input part 1
Step 3.13 — Template for input part 2

After this is completed, and tested, we have finished! We can now turn on the zaps and watch the data roll in!

What did we learn?

Results: In one day, we captured 128 results and used the entire quota for Monkey Learn. Some of the results are ‘retweets’ of the original post as we did not use the optional filter process.

Of the 128 results:

  • 85 posts were tagged as ‘neutral’
  • 28 posts were tagged as ‘positive’
  • 15 were tagged as ‘negative’.

However, confidence levels of the tagged results provide more accurate information. Sentiment tags with a confidence level above 0.90 are very accurate, whereas confidence levels below 0.90 are less accurate in that some posts tagged as ‘neutral’ should actually be ‘positive’ or ‘negative’. Additionally, retweeted posts did not always receive the same confidence level as the original post.

Datastudio Report of our analyzed data

Analysis

The results show that this combination of tools is effective at capturing keywords in a Twitter post and analyzing the sentiment associated with the words being used when the confidence level is above 0.90. Any post that is analyzed with a confidence level below 0.90 should not be relied upon.

@UCalgary can use the results as a method to create responses that are in-line with the sentiment being expressed. As an example, this post tagged with a negative sentiment with a confidence level of 0.945 can be immediately flagged for remedy:

@UCalgary I am extremely disappointed with U of C Parking Services and the way I was treated… I recently received a mail indicating “Right to Park suspended” and I had to pay 80$, after attempting to login to my account it said 360$

Whereas this post that was tagged as positive with a confidence level of 0.959 could be flagged to reinforce the company’s brand:

Shoutout to my mother on #InternationalWomansDay who at 73, just received her PhD in Classics from @UCalgary !! She is one of only a handful of scholars with expertise in Homeric Greek AND Vedic Sanskrit, both of which she learned in her 60s. It’s never too late y’all ❤️🔥

Although, the majority of sentiment tags are ‘neutral’, which indicates that Ucalgary has room to be more engaging with its audience to create more positivity around its brand. These ‘neutral’ posts were mostly related to content promoting events. As such, the University of Calgary can look at the posts that its followers are talking about and relate its events to fit the topics being expressed in the marketplace, instead of just promoting events.

Analyzed Data

Monkey Learn is the keystone in this sentiment analysis tool. However, it’s capabilities are limited in the free version. We were only able to capture 128 results before we reached our quota for the month.

This will not be enough data for larger companies to change their marketing strategy. As such, it will be necessary for a company to purchase a Team or Business plan which will provide at least 10,000 queries per month but will only provide 5000 results and cost $300/month.

This may not be enough data for a large company to use effectively. It would be better to find a cheaper sentiment tool that will allow for more queries.

It is also worth mentioning that to build this tool, you require a Zapier Pro account. This costs $20/month, bringing our total cost to $320/month

Future Work

There are numerous improvements that can be made to this tool.

Another Natural Language Processing Tool

The major problem with this tool today is the lack of content that is able to be analyzed. Due to the constraint of MonkeyLearn being the only Zapier compatible API, we were somewhat forced to use MonkeyLearn. Hopefully, in the near future, Zapier will increase the breadth of tools available in this category.

Better Reporting

Another downfall to the platform is the lack of variety in reports. Although Google Data Studio was excellent in building the basic reports that are shown above, there was some issue utilizing the date functionality. Along with this, the lack of data made it challenging to get live data, allowing for marketing strategies to change on the fly.

Scheduling

Hopefully, in the future, we could also take in a schedule of tweets and analyze the content before it gets posted, and provide warnings if the tone is mismatched with your customer base. This was not possible with the small quantity of MonkeyLearn calls that were available.

Conclusion:

We hope that this post reflects just how easy it can be to do powerful things with tools like Zapier. We were able to create a basic sentiment analysis tool that is useful for companies to understand some of the attitudes about its brand in the marketplace.

The tool is most effective at flagging ‘positive’ and ‘negative’ sentiment that should be responded to. However, this tool does not fully address the corporate social media fails as it still requires a person to use good judgment to create the content being posted.

We hope you learned something in this post! Thanks for reading :)

--

--

District Soup
Entrepreneurship Technology Class Blog

Entrepreneurship + Lessons learned through Lean Startup Methodology + Philosophical meanderings.