New fundamentals: Google Trends data vs social media investors

With so much hype surrounding technology firms in today’s economy, its hard to use traditional valuation metrics to price a company. E.g. Analysts have trouble applying the lessons from the past to value a company with a billion users and no profit.

A great example is the story of Zynga, a game development company that road Facebook’s coat-tails and became — for a brief moment in time — one of the success stories of social media. Their most popular title was a game called Farmville which allowed players to cultivate a virtual farm. Crucial to it’s overnight success was its hosting of the game on Facebook’s platform. This allowed it to leverage the social network’s users and grow much faster than it could have on its own.

Wall Street scrambled to throw an IPO together, but as the next chart shows they were a bit late to the game. By the time the stock went public, searches for the game were in long term decline. The stock price experienced a euphoric rise after the IPO but was soon brought back to earth as earnings reflected what search volumes had said all along: everyday less people were using the game:

Declining search volumes were obvious... except to IPO investors

Declining search volumes were obvious… except to IPO investors

The following is adapted from our book which exports search data from Google Trends with Python. We can download the search volume with the gtrends class which we can import with the following:

from gtobj import gtrends

Then we should import the other packages necessary:

import pandas as pd
import as web
import datetime as dt

Now we need to log-in to Google Accounts to export the Google Trends data:

gt = gtrends(“<your_username>”, “<your_passwd>”)

Then we can grab the search data for the “farmville” term:

vol = gt.get_volume(terms = [‘farmville’], daily = False)

This will return a pandas dataframe with the average weekly search volume for “Farmville”. To use the timestamps properly, we need to convert them into ones pandas can recognize:

vol[‘date’] = 0
vol.index = [date.split(” – “)[1] for date in vol.index ]
vol.index = pd.to_datetime(vol.index)
del vol[‘date’]

Now the index for vol is a proper set of timestamps. We need them for merging the price and search data into one dataframe. Next, let’s grab the price data using pandas DataReader:

start = dt.datetime(2004, 1, 1)
end = dt.datetime(2015, 1, 26)
znga = web.DataReader(“ZNGA”, ‘yahoo’, start, end)

Finally we can merge the data together and compare:

combo = pd.merge(vol, znga[[‘Close’]], left_index = True, right_index = True, how = ‘outer’)
combo = combo.fillna(method= “ffill”)

We can also use Google Trends to search for multiple search terms at once. Just modify the list above to pass multiple as the term argument. This will return a dataframe with a column for each search term. They will all be normalized to the same scale. For more information on how to use the gtrends class, check out Intro to Social Data.

4 replies »

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s