This guide explains how to set up goals in Google Tag Manager, send them to Google Analytics, and make the two platforms work together. Along with the general setup principles, you will learn how to track button clicks, form submissions, and scrolling to a specific element on your website.
Why set up goals in GA and GTM, and what types are there?
Goals in Google Tag Manager help you measure the quality of your website traffic, not just the number of visitors. They show which advertising channels bring in people who go on to buy. This data is also important when optimising paid search campaigns.
There are 2 types of goals:
- Conversion goals. These indicate that a conversion has taken place, such as submitting an enquiry, requesting a callback, or booking an online consultation. They are usually tracked through a visit to a specific page, a form submission, or a button click.
- Behavioural goals. These show how interested visitors are in the information on your website. You can measure session duration, pages viewed, and scroll depth. These actions and events count as micro-conversions and provide more data, particularly for businesses where primary conversions such as product purchases happen infrequently.
How to create a goal in Google Tag Manager
To create a goal in Google Analytics, open your account, go to Admin, and select Goals. Then follow these steps:
How I define a goal through the dataLayer
I avoid tying an important goal to a button colour, its text, or a fragile CSS selector. Instead, I ask the developer to push an event to the dataLayer only after the intended business action has been confirmed, along with any required parameters. A layout change will not create false conversions, and the tag logic will still be easy to understand during the next container audit.
Google’s official documentation explains how to pass events and variables through the dataLayer.
- Click Goal.
- Choose a custom setup rather than a template, then continue.
- Select the goal type. You can track:
- a visit to a URL;
- time on site;
- the number of pages viewed during 1 visit;
- events.
If someone submits an enquiry and is redirected to a thank-you page, tracking the page visit is straightforward. Enter the page path rather than the full address, leaving out the website domain.
Button clicks and scrolling to a particular section require additional goal setup in Google Tag Manager and event setup in GA. Google Tag Manager is also commonly integrated with Google Ads so you can track valuable actions taken by users who arrive through Google Ads campaigns.
How to track a click on a specific website element
First, decide which website element you want to track. To measure clicks on that element, create a trigger and then a tag in Google Tag Manager.
A trigger defines the condition that must be met before a tag fires. You can think of it as a tripwire that activates a device. The tag sends data to Google Analytics when the specified event occurs on the website and the trigger fires.
Creating a click trigger in GTM
Create a trigger in Google Tag Manager:
- Name the trigger “Button click” in the trigger settings.
- Select Click, All Elements as the trigger type. Click, Just Links is another option, but it will not always work because some buttons are not coded as links.
- Set the firing conditions. Do not select All Clicks, or the tag will be sent whenever a user clicks anywhere on the screen. Select Some Clicks and define the element you need. You can identify the button by its code class, link, ID, text, or page URL. Choose one of the built-in variables:
- Click Text is useful if you are not comfortable working with code. Copy the button text from the code and paste it into the Click Text field in Google Tag Manager. The trigger will fire when someone clicks a button with the specified text, such as take the tour.
- Click URL also offers a simple way to track a button if there is only 1 on the page. Paste the page address into the relevant Google Tag Manager field.
- Use the Click Classes and Click ID variables carefully because different buttons may share the same values. Ask a developer if you are unsure.
Creating a tag to track conversions
Create the tag in your Google Tag Manager container:
- Select the “Button click” trigger for this tag.
- Give the tag a clear name, such as “Button click”.
- Under Tag Configuration, select Google Analytics (GA4).
- Choose Event as the tracking type.
- Category: tour.
- Action: click.
- Label: take. Items 5, 6, and 7 are parameters, and you can choose their names. The important part is to copy them exactly into Google Analytics.
- Finish the setup in Google Tag Manager by clicking Save, Submit, Publish, and Skip. To check that the tag has been added correctly, open Preview mode.
Creating a goal in Google Analytics
At the same time, configure the event under goal setup in Google Analytics:
- Select the Event goal type.
- Name it “Button click”.
- Copy the category, action, and label from Google Tag Manager.
Finally, save the data in GA.
How to track forms with Google Tag Manager and Google Analytics
Most interactions between a website and a prospective customer happen through a form. If someone is automatically redirected to a thank-you page after completing the form, you can use a page visit goal. If you need to track the completed form submission itself, create a “Form submission” trigger and a matching tag in Google Tag Manager, then capture the event in Google Analytics.
Creating a “Form submission” trigger in GTM
Form submission tracking in Google Tag Manager starts with a new trigger:
- Select Triggers in the left-hand menu, then click New. Name the trigger “Form submission”.
- Select Form Submission as the trigger type.
- Under the firing conditions, select Some Forms rather than All Forms.
- You can identify the form with these variables:
- Page URL, if each page on the website contains no more than 1 form.
- Form ID or Form Classes. You can find these values in the form’s HTML. Ask a developer for help or use a different method if needed.
Creating a “Form submission” tag in Google Tag Manager
To track every form submission, create a tag for the event in GTM:
- Create a tag named “Form submission”.
- Under Tag Configuration, select Google Analytics (GA4).
- Choose Event as the tracking type.
- Category: form.
- Action: submit.
- Label: tour. You can choose a different name.
- Select the Google Analytics Settings variable.
Creating a goal in Google Analytics
Once the trigger and tag are configured in GTM, create a goal for the event in GA4:
- Choose Custom under goal setup.
- Name the goal “Form submission”.
- Select Event as the goal type.
- Copy the category, action, and label from Google Tag Manager.
Save the settings in GA and GTM. In Google Tag Manager, also click Submit, Publish, and Skip. Form submissions on the website will now be counted as conversions in your analytics.
Setting up scroll goals in GTM
To find out how many people reach a particular element on a page, you need to track scroll depth. If most visitors leave at a certain point, you can place a call to action there or give them a reason to continue to the end.
For this example, we will track everyone who reaches a specific element, such as a button labelled “Chat” near the bottom of the page. Follow these steps:
- Create a trigger in GTM and name it “View”.
- Under Trigger Configuration, select Element Visibility.
- Choose the element by CSS selector or ID. Inspect the element by right-clicking it, copy the selector, and paste it into Google Tag Manager.
- Set the trigger to fire once per page.
- Set the minimum percent visible. This determines how much of the element must be on screen before the system counts it as viewed. For a block, use 50%.
- Save the trigger.
- Create a tag with the same name in Google Tag Manager.
- Under Tag Configuration, select Google Analytics.
- Choose Event as the tracking type.
- Select the element view trigger.
- Choose names for the category, action, and label.
- Create an “Element view” goal in Google Analytics and copy the parameter values into GA.
Key points about setting up goals in Google Tag Manager
- Setting up goals through GTM makes your reporting more informative. An advertiser can track clicks on different buttons or a phone number, and can also set a timer. More metrics in the analytics report mean more events to analyse. You can identify effective traffic channels, choose stronger ads and audiences, and optimise Google Ads campaign budgets.
- Another benefit of setting up goals through Google Tag Manager is that you do not need to recreate triggers every time. If you later want to track events for social media advertising, you only need to create new tags that fire from the existing triggers.
31:15 Tracking clicks on a specific website button
35:34 Sending conversion goals from GTM to GA
36:48 Tracking scrolls to a specific website element
39:21 Creating new tags in Google Tag Manager

