Supermetrics Functions can now access Twitter & pivot your data

Today we’re releasing version 2.3 of Supermetrics Functions for Windows Excel and Google Sheets. We’ve heard your feedback and have added several powerful new features:

New getTweets function for searching tweets

In addition to the five data sources we had (Google Analytics, AdWords, Bing Ads, YouTube & Facebook), Supermetrics Functions can now access Twitter to fetch lists of tweets. Just get an authentication token from, paste that to sheet, and specify a keyword for searching tweets. The function will fetch the most recent tweets that match your query. There are many additional parameters you can specify, such as the language of the tweets, and which columns you want to see. The available columns are:

  • TIME Time of tweet
  • TWEET Tweet content
  • LINK Link to tweet
  • TWITTER_NAME User Twitter name
  • NAME User real name
  • LOCATION User location
  • FOLLOWERS User follower count
  • LANGUAGE Tweet language
  • RETWEETS Times the tweet has been retweeted

The Twitter API let’s you make 180 queries in a 15 minute window (if you set max results to more than 100, then each 100 results will count as one query). If you exceed this limit, the function will wait until the next 15 minute window starts. Thus if you run a large number of queries in a short time, data fetching will slow down.

GetData function is now Supermetrics

In the new version, we’ve added a new data feching function called Supermetrics. So now instead of typing “=getData(…”, you can use “=Supermetrics(…”. We decided to create a new function because we’re adding some new parameters (more on these below) and removing old ones, and we also wanted to rearrange the parameter order. The new version is still fully backward-compatible, so you can add the new code to your existing reports that use getData or getGAdata, and everything will work as before. The parameters for the new function are Supermetrics(token, profileID, metrics, startDate, endDate, dimensions, pivotDimensions, filters, segment, sort, settings, maxResults, maxCategories). You can find further information on the parameters here

Supermetrics Functions can now automatically create pivot tables of your data

We’re adding a super-powerful new feature, a pivotDimensions parameter that you can use to get pivot tables of your data. You can use this in combination with the dimensions parameter to split your data both into rows and columns. This makes it much easier to do many kinds of analyses that would have previously require using lookup functions to pivot the data, like plotting the developments of several items over time as in the attached example. The new maxCategories parameter can be used to control how many columns will be fetched.

Even using the older version of the functions, you can immediately start using the pivoting feature by suffixing any dimension name with “_pivot”. For example, to split by year and month and pivot by medium, type “yearmonth&medium_pivot”.

Use the new settings parameter to customize your query

In the new version, we’ve removed the old includeHeaders and includeDimensionColumns parameters and replaced these with a new settings parameter, which can be used to control many aspects of the query. Below is a list of currently available values for this new parameter, you can use multiple values by combining with commas:

  • SAMPLING_NOTE displays whether Google has sampled the results (only relevant for Google Analytics queries)
  • AVOID_SAMPLING tries to avoid Google’s sampling, will slow down data fetching significantly so should be used sparingly (only relevant for Google Analytics queries)
  • NO_DIMENSIONS splits by the specified dimensions but doesn’t display them (replaces the old includeDimensionColumns parameter)
  • COMBINE_DIMENSIONS concatenates dimension values when multiple dimensions have been specified
  • SUM_ALL when specifying multiple profile/account IDs, this setting will sum all results together
  • INCLUDE_HEADERS will include headers in the data (replaces the old includeHeaders parameter)
  • NO_HEADERS won’t include headers in the data (replaces the old includeHeaders parameter)

More reliable data feching in Google Sheets

Supermetrics Functions version 2.3 for Google Sheets contains several improvements which will make data fetching much more reliable. However, due to the limitations of Google Sheets, you may still encounter errors when running a large number of queries in a short time.

Get Started Now

To get started using the new version, see the Getting Started section here. Like always, if you have a license for Supermetrics Functions, this is a free upgrade (see instructions for upgrading your existing workbooks). However, if you want to use the new getTweets function, you will need to buy a license for Twitter (you can of course test it for free first).

Leave a Comment

  • (will not be published)