Overview: Query Builder for HubSpot Marketing (Website Pages)


How to access the Query Builder for HubSpot Marketing (Website Pages)

Navigate to  Metrics > Query Builder to access the Query Builder for HubSpot Marketing. Click the green + Create Custom Metric button and select your connected HubSpot Marketing Account from the Data Source drop-down list. Select the Website Pages button. 

Website Pages is a HubSpot Marketing add-on. If this add-on is not used in the HubSpot Account, Website Page data will not be returned from HubSpot's API. 

    Query Builder is available in Plus and Business Accounts. Agency Basic Accounts have access to Query Builder in the Agency Account only.  Request a trial of Query Builder by following these steps.  

How to use the Query Builder for HubSpot Marketing (Website Pages)

  Custom Query Name:  Enter a name for your Custom Metric. This Custom Metric name will be available in the Designer after saving.
  Metric: Select a Metric from your connected HubSpot Marketing Data Source, such as "Pageviews," "Avg Time on Page" or "CTA Clicks." 
  Dimension (Optional): The Dimensions parameter re-categorizes the returned Metric value based on common criteria. For the Query Builder for Website Pages, the Dimension field can be left blank or set as  Page Title. If no Dimension is selected, all results will be aggregated to produce a single Metric Value for each Date Range. If Page Title is selected as the Dimension, the Custom Metric will return a list of Metric Values split up by Website Page Title. 
Pro Tip:  Add the word "by" in between the Metric and Dimension in order to determine an appropriate Custom Metric Name. From the Metric and Dimension examples outlined above, we could create the Custom Metrics "Pageviews by Page Title," "Avg Time on Page by Page Title," or "CTA Clicks by Page Title."   

  Date Range: Select up to 8 Date Ranges that will be available for the Custom Metric. The Date Ranges selected are the only periods of time that data is synced for this Custom Metric. 

  Compare With(Optional) : Select a comparison period to measure each Date Range against, like "Previous Period" or "Same Period Last Year." Data for the comparison period will be synced for each Date Range that is selected. 
  Filter by(Optional): Filters restrict the data that gets included in the Custom Metric. All data that is returned is tested against the Filter(s). Multiple Filters can be combined using AND / OR boolean logic. Filters can be set based on Page Titles or Metric Values. 
If the data synced from the Metric and Dimension fields meet the Filter specifications, the data is retained and included in the Custom Metric value. If the data synced from the Metric and Dimension fields don't meet the Filter specifications, the data is excluded from the Custom Metric value.
  Data Preview: After clicking Run query, a Data Preview of the Custom Metric will be displayed. Daily Metric values are displayed in this section, along with the total Metric values for the Date Range in bold at the bottom. You can view the Data Preview for different Date Ranges by clicking on the tabs at the top of the Data Preview. 

If there is no data returned for the specified Date Range(s), no data will be displayed in the Data Preview. Only Website Pages with tracked data will be accessible through this Query Builder. 
Pro Tip : If you don't know which Filters to put in place for your use case, use the Dimension + Data Preview to troubleshoot and get more insight into the data that is returned from your HubSpot Marketing Account for each field. Learn more here.

How to create a Custom Website Page Metric [Example]

In this example, we'll create a Custom Metric to return a list of the Average Bounce Rate split up by Page for our Website Pages that contain "Red" in the Page Title. 

 Navigate to Metrics > Query Builder   
 Click the green + New query button
 Select the appropriate HubSpot Marketing Data Source and the Website Pages button
 In order to accurately explain what this Custom Metric is reporting on, we'll name the Custom Metric Avg Bounce Rate by Page Title (Red)
 We will select Avg Bounce Rate from the Metric dropdown list, since we want to track the total amount of CTA Views per Website Page
 Since we want to split up the Avg Bounce Rate based on the Website Page, we'll choose Page Title as the Dimension
 Next, we'll select the Date Range options for our Custom Metric. We set monthly Goals that are reviewed weekly, so we will choose Last Month, Month to Date, Last Week, and Week to Date as Date Range selections 
 We want to view our performance against the previous period, so we'll select Previous Period as the Compare With value
 Lastly, we want to restrict the Custom Metric to only retain data for Website Pages that have "Red" in the Page Title, so we'll add a Filter to the Custom Metric
First, click on the  Advanced Options hyperlink to open the Filter section of the Query Builder. Click on the Filter dropdown and select Dimension. Next, we'll set the  Dimension as Page Title , the  Operator as Contains and enter Red in the  Value textbox.
 Click Run query to generate a Data Preview of the Custom Metric
 Once we confirm that these are the results we're looking for, we'll click Save to save the Custom Metric

How to add a Custom Website Page Metric to a Databoard


 Open the selected Databoard in the Databox Designer, or create a new Databoard.
 Drag and drop a blank Datablock onto the Databoard from the Visualization Library. 
 Select the appropriate HubSpot Marketing Data Source from the righthand Datablock Settings panel. This must be the same HubSpot Marketing Account that was selected when creating the Custom Metric. 
 Select the  Custom tab at the top of the  Metric drop-down list. 
 Select the Custom Metric name to populate the Datablock.

Additional Information

  • Up to 36 months of historical data is accessible through this Query Builder.
  • Daily data is not available for Custom Metrics created through this Query Builder. Because of this, you will want to view your Custom Website Page Metrics on a Visualization Type that does not necessitate granularity options. Line Charts and Bar Charts will not be good Visualization Types for this data, but Tables, Pie Charts, and Number Blocks will be.
  • If a Website Page has 0 Pageviews during the selected Date Range, the Website Page will not be visible in the Data Preview.
  • "Page Title" refers to the Title of the Page on your Website, not the title of the Internal Website Page in your HubSpot Marketing Account.
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.

Still need help? Contact Us Contact Us