Building custom metrics or modelled data sources and looking for help? This article includes links to descriptive articles for several key services as well as tips on retrieving (querying) data.
Each service's API is unique. When you select a data view and columns and apply filters, you're specifying the data you want to retrieve (query) from a service. Because each service's API is unique, it may be difficult to understand how to effectively narrow down the data you're looking for. For example, it may be unclear that a particular data view includes required filters or in what format the operators and values need to be entered. You might notice some services here don't include tips. We'll keep updating this article and adding more tips as we investigate and resolve the intricacies of each service's API.
Query only the data you need. By filtering to pinpoint only the data you need, you optimize the volume of data being queried. This not only makes your data easier to understand and handle, it often makes the query run faster. Learn more about filtering for custom metrics.
This article includes links to resources and tips for requesting and filtering data for the following services:
- Facebook Ads
- Google Ads
- Google Analytics (Universal Analytics)
- Google Analytics 4
- Instagram Business
- LinkedIn Ads
- LinkedIn Pages
- X Ads (Twitter Ads)
- Data view: SimpleInsights
Tip: Under Data view filters > InsightName, you'll see a long list of items. The following insights are not displayed in the list but they are available for selection: "page_daily_follows", "page_daily_follows_unique", "page_daily_unfollows", "page_daily_unfollows_unique" , and page_follows".
- Data Views: AdInsights and AdInsightsActions
- Data view: All views that include a date column, when you want to retrieve data for a date range.
Tip: By default, the Google Ads API returns a single day of data. If you want to retrieve a range of data, under Columns, select Date and add the following filters: Add "On or after" as the first operator (and select the beginning of the date range). Then, add "On or before" as the second operator (and select the end of the date range).
Note that there are some exceptions, for example, "ClickView", which must be filtered to limit results to one day.
- Data view: All views that include a date column, when you want to retrieve data for a single day or when results are limited to a single day of data, for example, when selecting “ClickView”.
Google Analytics (Universal Analytics)
- Connecting to Google Analytics (with data sources)
- Adding Google Analytics metrics (with data sources)
- Why is my Google Analytics metric data off by one day when compared to my Google Analytics report data?
- Creating Google Analytics goal completion custom metrics (with data sources)
- Data view: All views that include "Metrics" or "Dimensions" as optional columns.
Tip: When applying filters for the columns "Dimensions" or "Metrics", if you apply multiple filters, the values will be returned as a comma separated list in a single column. You'll need to add a new column for each member and write a formula using SUBSTRING and INDEXOF to isolate the individual entries.
To explain this further, we'll use an example that selects Traffic as the data view and Date, Dimensions, and Sessions as the columns. We'll apply filters to the Dimensions column to see data by continent and by age group. (See below.)
After previewing your data and clicking Save and continue you enter the modeller. Here you will add a new column for Continent and a new column for Age. For each new column, you'll write a formula using SUBSTRING and INDEXOF.
- In the modeller, add a new column for Age, by clicking the + sign.
- In the formula bar, with the new column selected, enter the following:
- By entering the formula above, you refer to the "Dimensions" column and isolate the age related information by single entry. Next, select the column header row and change its name to Age. (See below.)
- Add a new column for Continent by following the same method as above but altering the formula slightly, as shown below:
Google Analytics 4
- Connecting to Google Analytics 4 (with data sources)
- Adding Google Analytics 4 metrics (with data sources)
- Example: Tracking Google Analytics 4 events in PowerMetrics (with data sources)
- Example: Tracking Google Analytics 4 custom events in PowerMetrics (with data sources)
- Data view: Engagement
Tip: To include a custom dimension created for your events in a data feed, in the query builder select Engagement as the data view and, under Columns, select EventName (filtered by the event name(s) you want to include in the data feed) and Dimensions, filtered to include the name of the custom dimension (in the example below it’s “customEvent:product”).
See the example below, where we also selected Date, EventCount, and TotalUsers as columns for the data feed.
- To narrow down the data being requested and speed up the retrieval process, when applying filters, you should select properties that are supported by HubSpot’s Search API. For example, with ”Contacts” chosen as the data view, when selecting columns, choose “Create Date” or “Last Modified Date” (supported by the Search API) instead of “Created At” (not supported). All of these column selections will return data but “CreateDate” and “Modified Date” will return it much faster! You’ll find all the information you need in the HubSpot API Search docs. (See below for an example.)
- Connecting to Instagram Business (with data sources)
- Adding Instagram Business metrics (with data sources)
- Example: Tracking Instagram Business Reels Insights in PowerMetrics (with data sources)
- Connecting to LinkedIn Pages (with data sources)
- Adding LinkedIn Pages metrics (with data sources)
- Example: Tracking LinkedIn Pages post performance in PowerMetrics (with data sources)
- LinkedIn Pages: Retrieving data for custom metrics and data sources (video)
- Data view: CompanyUpdateStatistics
Tip: Under Columns > TimeRangeEnd and Columns > TimeRangeStart, when applying filters to specify a date range for your query, you must use the "On or before" operator for TimeRangeEnd and the "On or after" operator for TimeRangeStart. You can optionally set the "TimeGranularity" query filter to "DAY" or "MONTH" to control the resolution of the data returned.
Note: If you don't specify a date range for your query, it will use the default (lifetime statistics).
- Data view: CompanyPageStatistics
Tip: Under Columns > ReportTimeRangeEnd and Columns > ReportTimeRangeStart, when applying filters to specify a date range for your query, you must use the "Is" or "On or before" operators for ReportTimeRangeEnd and the "Is" or "On or after" operators for ReportTimeRangeStart. You can optionally set the "TimeGranularity" query filter to "DAY" or "MONTH" to control the resolution of the data returned.
- Connecting to QuickBooks (with data sources)
- Adding QuickBooks metrics (with data sources)
- Retrieving QuickBooks data using the query builder (video)
- Creating a QuickBooks Current Assets metric (video)
- Connecting to Salesforce (with data sources)
- Adding Salesforce metrics (with data sources)
- Retrieving Salesforce data using the query builder (video)
- API access error message: If you see an error message containing
API_DISABLED_FOR_ORG: API is not enabled for this Organization or Partnerthis means you don't have access to the Salesforce API. Learn more in this Salesforce Help article. For more information on Salesforce requirements, see this Klipfolio Knowledge Base article.
- Data View: Subscriptions
X Ads (Twitter Ads)
- Connecting to X Ads (Twitter Ads) (with data sources)
- Adding X Ads (Twitter Ads) metrics (with data sources)
- Data view: TimeBasedReports and TopVideos
Tip: To get data for a specific playlist using either of these data views, under Data view filters:
- Click +Add filters (optional), select the checkboxes beside “IsCurated” and “Playlist”, and click Apply. Click the Click to add filter box for each one. For “Is Curated”, set Equals as the operator and true as the value. For “Playlist”, set Match All and Equals as the operators and enter your playlist Id as the value.
- Under Columns, select one or more of “AverageTimeInPlaylist”, “AverageViewDuration”, “EstimatedMinutesWatched”, “PlaylistStarts”, “Views”, and “ViewsPerPlaylistStart”.
- Data views: Tickets and TicketMetrics
Tip: When applying filters to specify a date range for your query (for example, “CreatedAt”) you must select the “After” or “On or after'' operators (along with the “Before” or “On or before” operators to further constrain the query to a specific date range). The “Is” operator for a single date is not supported and will not return data. For example, to get today’s data, try “On or after” and “Today”, instead of “Is” and “Today”.
- Data views: Any data view that can potentially retrieve a very large amount of data and to which you’ve added complex filter conditions. This example describes selecting the “Users” data view from Zendesk and applying the following filters to the “Role” column: “Role” = “agent” and “Role” = “admin”. Because the filter condition applies to two values (agent and admin) PowerMetrics needs to retrieve all of the users from your account and filter the results. Since Zendesk accounts typically include a large number of users this can result in a long running query that times out. By simplifying the filter condition to use only one value, such as "Role" = "agent" only, the query can be executed directly by Zendesk and returning results much quicker.
Tip: To resolve this issue, split your data by creating two separate data sources, in this case, create one data source for users with the agent role and one for users with the admin role. Then merge the two data sources into one that you can use for your metrics. Learn how to merge data sources in the modeller.