getAccountData(token, dataType, includeHeaders) | token | The token obtained from supermetrics.com/functions-login |
dataType | The kind of account data you want to fetch. There are three possible values: 'profiles', 'goals' and 'segments'. If you leave this out, profiles will be fetched. | |
includeHeaders | Whether to include column headers. Use boolean values (TRUE or FALSE in the English Excel | |
Supermetrics(token, profileID, metrics, startDate, endDate, dimensions, pivotDimensions, filters, segment, sort, settings, maxResults, maxCategories) | token | The token obtained from supermetrics.com/functions-login. Note that the token defines which data source is accessed. |
profile ID | A numeric ID for the profile/account/video/page you want to access. You can see this number in your browser's address bar when looking at the profile's data in GA, or you can use the getAccountData function to fetch a list of all your entities and their IDs. For Google Ads queries, input the customer ID of the Google Ads account. For YouTube, enter the video ID or "TOTALS" to fetch channel totals. | |
metrics | A list of metrics you want to fetch, separated by ampersands. You can find a list of metrics via these links: Example: "visits&pageviews&bounces" | |
start date | The start date of the time period for which you want to fetch data. Either insert a reference to a cell with a date, or type a value. In version 2.31 and newer, the value can be anything accepted by PHP's strtotime function, meaning a date like "2014-01-01" or a relative date reference like "first day of last month". In older versions, you need to use either a reference to a cell with an Excel date, or type the value in the YYYY-MM-DD format. | |
end date | The end date of the time period for which you want to fetch data. Either insert a reference to a cell with a date, or type a value. In version 2.31 and newer, the value can be anything accepted by PHP's strtotime function, meaning a date like "2014-01-01" or a relative date reference like "first day of last month". In older versions, you need to use either a reference to a cell with an Excel date, or type the value in the YYYY-MM-DD format. | |
dimensions | Determines how the data is split into rows. You can split by up to 10 dimensions. List of dimensions can be found via these links:
| |
pivotDimensions | Determines how the data is split into columns. See the "dimensions" parameter for links into list of possible values. By default, categories are sorted in descending order by the first metric, unless the pivot dimension is a time dimension, in which case it's sorted chronologically. If you want the categories sorted alphabetically, you can add PIVOT_SORT_ALPHABETIC to the settings parameter. | |
filters | You can specify a Google Analytics segment here. You can either use segments created through the GA web user interface, or "on-the-fly" segments - see full instructions here. To use a predefined segment, you can simply type the number of the segment in quotation marks (you can fetch a list of your segments and their numbers with the getAccountData function). You can include multiple segments by posting this parameter as a JSON array that includes the segment ID and name. For example, this JSON specifies two custom segments:
| |
sort | If you omit this parameter or mark it as FALSE, the results are sorted alphabetically by the included dimensions. If you set this as TRUE, then they will be sorted by the first metric, in descending order. You can also type a name of a metric or dimension to sort by that field, eg. "visits" will sort by visits in ascending order, and "visits_desc" or "-visits" will sort by visits in descending order. | |
settings | Special settings for the query, separate with comma. Some possible values:
| |
maxResults | Specifies the maximum number of rows that will be fetched. Default is 10000. Setting a lower value will make the functions work faster. | |
maxCategories | Number of pivot dimension categories to fetch | |
This function was previously called getData. If you prefer, you can still use getData instead of the Supermetrics function. The parameter order with the getData is slightly different: | getData(token, profileID, metrics, startDate, endDate, filters, dimensions, segment, sort, includeHeaders, includeDimensionColumns, maxResults) | |
getTweets(token, searchTerm, columns, maxResults, includeHeaders, resultType, languageCode, untilDate, locale, timeZone) | token | The token obtained from supermetrics.com/functions-login |
searchTerm | Function will search for tweets matching this value | |
columns | Specify which columns you want to include in the results. Combine columns with commas. Available columns are
| |
maxResults | Max number of rows to fetch. Over 100 will slow down data fetching and will use up your quota faster (the quota is 180 queries of 100 rows per 15 minutes). | |
includeHeaders | Use TRUE or FALSE to specify whether headers should be included in the first data row. | |
resultType | Specifies what type of search results you would prefer to receive. Possible values: mixed, recent, popular | |
languageCode | Filter tweets to the given language. See list of language codes here: http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes (use the two-letter ISO 639-1 codes). | |
untilDate | Filter tweets generated before the given date. Date should be formatted as YYYY-MM-DD | |
locale | Specify the language of the query you are sending (only ja is currently effective). This is intended for language-specific consumers and the default should work in the majority of cases. | |
timeZone | Specify time zone for displayed tweet time, for example "PST" or "Europe/Paris". See list of available values here. |