Our Google Analytics Goal Completions instant metric tracks data for ALL of your goal completions. But, what if you want to create a goal completion metric for a single goal? This article walks you through how to do just that using our query builder!
This article contains the following sections:
- What is a goal completion metric and why is it important?
- Accessing dimensions and metrics in the Google Analytics API
- How do I create a Google Analytics goal completion custom metric?
- Finding the Goal ID you want to track
- Defining and finalizing the query
- Refining data in the modeller
- Choosing custom metric settings
- Video example
- Learn more
What is a goal completion metric and why is it important?
In Google Analytics, you define the user actions you want to track as “Goals”. When a user completes a goal, it’s recorded as a conversion.
The goal completion metric measures the number of conversions (completed actions) within a specified date range. Tracking this kind of data is important because goal completions (such as subscribing to a newsletter or signing up for a trial account) show true intent on the part of the user - potentially one of the most important indicators of your product’s success or failure.
Want to learn more about metrics? Check out MetricHQ, the world’s largest online resource for metrics and KPIs!
Accessing dimensions and metrics in the Google Analytics API
The Google Analytics Dimensions & Metrics Explorer lists the dimensions and metrics that are available via their API. Click the + button beside Goal Conversions to see information directly related to goals. In this article, the example instructions use the “Goal Completions” data view in our query builder and the “Goal XX Completions” metric. (See below.)
Google Analytics API dimensions and metrics can also be used to query data in PowerMetrics, where they’re available for the following Google Analytics data views: AdSense, AdWords, Ecommerce, Events, GoalCompletions, SiteContent, SiteSearch, SiteSpeed, and Traffic.
How do I create a Google Analytics goal completion custom metric?
The example described in the following set of instructions will result in a custom metric for Google Analytics that tracks the goal completions for a single goal (Trial Registration), segmented by a dimension (Channel Grouping), for a specified time period.
When creating a Google Analytics goal completion custom metric, you will:
- Find the Profile ID and the Goal ID
- Define and finalize the query
- Refine data in the modeller
- Choose custom metric settings
Finding the Goal ID you want to track
Don’t know the ID for the goal you want to track? In the following procedure, you'll query the Profiles data view to get a list of your Profile IDs. You'll select the Profile ID you want to get data for. Next, you'll query the Goals data view and apply a filter to see only the Goal IDs for the Profile ID you selected. Finally, you'll note the specific Goal ID you want to track.
To find the Goal ID:
- In the left navigation sidebar click the + button beside Metrics.
- On the Where is your data? page, select Google Analytics.
- Click Create a custom metric.
- To connect to your Google Analytics data, choose an Account and Account settings and click Get data.
- On the Choose data for your metric page, under Data view, click the drop-down and select Profiles.
- Under Columns, select the checkboxes beside Id and Name and click Preview data.
A list of all of your Profile IDs and Names displays in the data preview table. (See below.)
- In the Id column, copy the Profile ID that you want to use for the custom metric. You’ll need it in step 10. For this example, we’ll copy 5290053.
- Next, on the Choose data for your metric page, under Data view, click the drop-down and select Goals.
- Under Columns, select the checkboxes beside Id, Name, and ProfileId.
- Add a filter to the ProfileId column by clicking the filter button and then the Click to add filter box. Next, select Match All and Equals as the operators, and paste the Profile ID you copied in step 7 as the value. Click the + button and then click Apply. (See below.)
- Click Preview data.
The data preview displays all of the goals for the Profile ID we chose in step 7.
- In the Id column, note the Goal ID for the goal you want to track. In this example, we want to track “Goal 12” - “Trial Registration”.
- Remain in the query builder and follow the next set of instructions “Defining and finalizing the query”.
Defining and finalizing the query
Now, we’re ready to define and finalize the query for our custom metric. In our example, we want to access: Goal 12 (Trial Registration) completions, segmented by Channel Grouping, for a specific date period. To query and get the right data, we’ll select the GoalCompletions data view, choose a few columns, and apply some filters.
To define and finalize the query:
- On the Choose data for your metric page, under Data view, click the drop-down and select GoalCompletions.
- Under Columns, select the checkboxes beside Date, Dimensions, GoalCompletionsAll, and Metrics.
- Add a filter to the Dimensions column by clicking the filter button and then the Click to add filter box. Next, select Match All and Equals as the operators, and enter the dimension you want to segment your custom metric by as the value. (In this example, we entered ChannelGrouping.) Click the + button and click Apply.
- Add a filter to the Metrics column by clicking the filter button and then the Click to add filter box. Next, select Match All and Equals as the operators, and enter Goal12Completions as the value. Click the + button and click Apply.
We only want to track data for “Goal 12 - Trial Registration”. By adding, and filtering on, the “Metrics” column, we further define our query to get data for the single goal we want to track.
When entering the filter “value”, make sure you use the correct form, as shown in the Google Analytics Dimensions & Metrics Explorer list. The Google Analytics API format is “ga:goal1XXCompletions”, however, for our filters, we need to remove “ga:” at the beginning. In our example, “GoalXXCompletions” becomes “Goal12Completions”.
- Click Preview data.
The Data preview table includes columns for the GoalCompletionsAll, Date, Dimensions (channel grouping), and Metrics (Goal 12 Completions). Right now the column header names aren’t very descriptive but we’ll fix that and make a few more tweaks in the next step - the modeller.
- Click Save and continue to go to the modeller, where you will refine your data.
Refining data in the modeller
To refine data in the modeller:
- Select the column called Dimensions. Click in the column header and change its name to Channel Grouping.
- Select the column called Metrics. On the right side of the modeller, under Column Properties > Data Format, change the data format to Number. Click in the column header and change its name to Goal 12 Completions.
- Click Save and continue.
Almost done! Next up - “Choosing custom metric settings”.
Choosing custom metric settings
It’s time to choose the display settings for your Google Analytics goal completion custom metric.
To choose custom metric settings:
- In the Select a metric value step, choose Goal 12 Completions.
- In the Segment metric value by category step, select Channel Grouping.
- In the Select a date column step, select Date.
- In the Tell us about your data step, select Periodic summary.
- In the Connect to your data step, leave the settings as is.
- Click Save.
You’re done! Find your custom Google Analytics Goal Completions metric in your metric list by clicking Metrics in the left navigation sidebar. Select it from the list to open it in its Explore View. From here you can also add it to a dashboard by clicking the 3-dot menu in the upper-right corner of the page and selecting Add to dashboard.
In the following video, we create a goal completions metric and then take it up a notch, using a simple formula in the modeller, to include more than one dimension:
Want to learn more about our Google Analytics metric options?
Check out these related articles: