We create digital solutions that work for businesses
A website can generate traffic and leads while the business still cannot identify which pages, buttons, and campaigns produced the result. A basic counter records page views but may not reveal successful forms, phone clicks, checkout starts, or completed purchases.
Google Tag Manager centralises analytics and advertising tags. A single container can manage Google Analytics 4, Google Ads, marketing pixels, and custom events; Preview mode helps test a draft before publishing, while versions create an audit trail. GTM does not replace analytics or create a measurement strategy automatically. A reliable implementation starts with business goals and an event plan.
If Analytics is not ready yet, begin with the guide to setting up Google Analytics 4 and then use this article to manage tags and events.
GTM is a tag management system. Its web container stores rules that deploy other tags.
| Component | Purpose | Example |
|---|---|---|
| Container | groups one site's configuration | GTM-XXXXXXX |
| Tag | sends data or loads an integration | Google tag, GA4 Event, Ads Conversion |
| Trigger | decides when a tag fires | page view, click, custom event |
| Variable | supplies a dynamic value | URL, button text, purchase value |
| dataLayer | passes structured site data | purchase, value, items |
| Workspace | holds unpublished changes | new form tracking |
| Version | records a container release | analytics release 1.2 |
GTM reduces repeated code edits for standard integrations, but it does not eliminate development. Reliable tracking for AJAX forms, authentication, carts, product variants, and payments often requires the application itself to push events into the data layer.
The products have separate roles:
GTM routes tags and controls firing conditions;
GA4 collects, processes, and reports analytics data;
Google Ads uses conversions for reporting, audiences, and bidding;
the website or data layer reports what the user actually did.
The website produces a signal, GTM routes it, GA4 analyses it, and Google Ads can use it for campaign optimisation. A fault at any stage changes the outcome.
Before creating the container, collect access to the domain, CMS, Analytics, and Ads. List domains, subdomains, forms, phone links, messengers, calls to action, booking flows, and checkout steps. Confirm who owns the accounts, who may publish changes, and how consent is handled.
A measurement plan connects actions to goals:
| Business goal | Event | Parameters | Conversion | Validation |
|---|---|---|---|---|
| Lead | generate_lead |
form_name, page_location |
yes | confirmed success |
| Phone interest | click_phone |
link_url, page_location |
optional | tel: click |
| Checkout start | begin_checkout |
value, currency, items |
no | checkout opened |
| Purchase | purchase |
transaction_id, value, currency, items |
yes | confirmed order |
Do not mark every interaction as a conversion. Primary conversions should represent meaningful business outcomes; otherwise automated campaigns may optimise towards easy but low-value actions.
Open tagmanager.google.com using a company-owned Google account.
Create an account for the organisation.
Create a container for the website and select Web.
Use the primary domain as a clear container name.
Grant staff and partners the minimum access required.
Google's current guidance recommends one container for each company website or app rather than one container per page. Keep administrative ownership with the business instead of a contractor's personal email.
GTM provides two snippets:
place the JavaScript block as high in <head> as possible;
place the <noscript> block immediately after the opening <body> tag.
The snippets must appear on every page that requires tracking. Avoid installing the same container twice.
Use a child theme, a trusted integration, or a controlled theme module. Make sure updates do not remove the code. Do not install GA4 simultaneously through a theme, plugin, Elementor, and GTM; duplicate Google tags can produce repeated page views and events.
The container alone does not create ecommerce tracking. Product, list, coupon, currency, price, quantity, and transaction values must be pushed at the right stages. A plugin can accelerate deployment, but its data layer must be tested with the site's theme, checkout, payment methods, and order-status flow.
Install both snippets in the global layout. Developers should push events when the application confirms a successful action. Single-page applications also need route-change and virtual-page-view logic.
Click Preview in GTM and connect Tag Assistant to the website. Confirm that:
the container loads on all important templates;
no duplicate or unknown container is present;
the Google tag fires once per intended page view;
consent state matches the visitor's choice;
events arrive in the correct order;
GA4 DebugView receives test data;
cache, CSP, or browser extensions do not block the test.
Official documentation states that Preview mode lets you browse with the current container draft as if it had been deployed and inspect which tags fired and in what order.
Create a Google tag using the G-XXXXXXXXXX Measurement ID and normally use All Pages for the base trigger. Then test several pages in Preview, check Realtime or DebugView, remove any duplicate hard-coded implementation, create a named version, and publish.
The IDs serve different purposes: GTM-... identifies the Tag Manager container, while G-... identifies the GA4 web data stream.
confirmed form submission;
phone, email, and messenger clicks;
quote, quiz, or calculator start and completion;
price list or presentation download;
consultation booking;
case-study interaction;
thank-you page visit when the URL is unique and protected from repetition.
view_item_list and select_item;
view_item;
add_to_cart and remove_from_cart;
view_cart;
begin_checkout;
add_shipping_info;
add_payment_info;
purchase;
refund when the integration supports it.
Use GA4 recommended event names and parameters where they match the action. This improves compatibility with standard reports and keeps naming consistent.
Track internal search, sign-ups, file downloads, useful video interactions, important outbound clicks, and content-to-commercial transitions. Scroll depth is normally a supporting engagement signal rather than a primary conversion.
Tracking the Submit button creates false leads when validation fails, the network request is rejected, or the visitor clicks repeatedly. The event should fire after a successful server response or a unique success state.
For an AJAX form, the application can push:
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'generate_lead',
form_name: 'project_request'
});
In GTM, create a Custom Event trigger for generate_lead, a Data Layer Variable for form_name, and a GA4 Event tag. Never send a visitor's email, phone number, name, or message text to Analytics.
Use tel: and mailto: links. A Just Links trigger can match Click URL starts with tel: or mailto: and send click_phone or click_email with link_url and page_location.
A phone-link click does not prove that a call connected. Accurate call reporting requires call tracking or a telephony integration.
The data layer is a global JavaScript array that passes structured events and variables from the site to GTM. It is more stable than scraping values from visible text or fragile CSS selectors.
window.dataLayer = window.dataLayer || [];
window.dataLayer.push({
event: 'purchase',
ecommerce: {
transaction_id: 'ORDER-1048',
value: 2490,
currency: 'UAH',
items: [{
item_id: 'SKU-15',
item_name: 'Product name',
price: 2490,
quantity: 1
}]
}
});
Fire purchase only after the order is confirmed and send a unique transaction_id to prevent duplicate revenue when a thank-you page is refreshed.
Google advises initialising with window.dataLayer = window.dataLayer || [] and using push() afterwards. Do not overwrite the array after GTM loads, and keep names and letter casing consistent.
The complete flow is:
the application sends a dataLayer.push();
GTM reads the event key;
a Custom Event trigger matches the exact name;
Data Layer Variables read parameters;
a GA4 Event tag sends the event;
GA4 processes it;
a valuable event is marked as a key event;
the conversion can be imported or sent to Google Ads.
Use descriptive names such as GA4 - Event - Generate Lead, Trigger - CE - generate_lead, and DLV - form_name. Naming conventions make audits and handovers substantially easier.
Create the conversion action in Google Ads, copy its Conversion ID and Conversion Label, and use the native Google Ads Conversion Tracking tag in GTM. For purchases, pass dynamic value, currency, and a transaction identifier when the implementation supports them.
Review Conversion Linker and consent settings. Avoid counting the same business action twice through both a direct Ads tag and an imported GA4 key event unless the reporting setup intentionally separates primary and secondary actions.
Conversion tracking must align with campaign structure, landing pages, and lead value. BB STUDIO includes this work in professional Google Ads management.
UTM parameters describe the source of a visit; GTM manages events after the page opens. Build consistent campaign links for ads, email, partners, and QR codes with the BB STUDIO UTM builder.
Standardise lowercase names. facebook, Facebook, and fb may split into separate report rows. Do not add UTM parameters to internal site links because they can overwrite acquisition information.
GTM is not a consent banner. A banner or CMP collects the visitor's choice, while Consent Mode communicates consent state to tags. Default consent must be established before dependent tags fire and updated after the visitor's choice.
Test acceptance, refusal, and preference changes. Connect tags to the relevant consent types and update privacy and cookie documentation. GTM does not remove the organisation's legal responsibilities; requirements depend on the market, data, and advertising technologies involved.
Run both positive and negative scenarios. Confirm that a valid form fires once and an invalid form does not. Refresh the thank-you page, return to checkout, test consent refusal, and click similar elements that should not match the trigger.
Check event names, parameters, tag status, DebugView, mobile and desktop behaviour. Then click Submit, publish and create a version with a useful name and description. Activity History and versions make troubleshooting and rollback easier.
GTM does not make every third-party script lightweight. A container with many pixels, chats, and Custom HTML tags adds requests and JavaScript work.
remove unused tags and variables;
limit triggers to relevant pages;
avoid duplicate integrations;
prefer native templates to arbitrary Custom HTML;
audit third-party impact;
load non-essential tools after consent or interaction;
review the container regularly.
If new tags slow the website or create errors, professional website support can diagnose the container and site together.
For a new project, plan measurement, dataLayer events, and consent before building forms, checkout, and user accounts. This is more reliable than attaching triggers to unstable CSS selectors afterwards. Analytics should be included in the acceptance checklist during website development.
For an existing site, first inventory current scripts, owners, duplicates, form behaviour, payment flows, and events used in reports. Do not migrate every script into GTM without deciding whether it is still needed.
Compare landing pages with leads, traffic sources with lead quality, form starts with confirmed submissions, and product views with checkout and purchases. Segment by device, market, campaign, and landing page.
If sessions are growing while enquiries are not, read why a website gets traffic but no leads. To diagnose navigation and form friction, use a structured website UX audit.
The container is missing from some templates.
GA4 is installed through several methods.
Button clicks are reported as successful leads.
Triggers rely on CSS classes that change during redesign.
Event names are inconsistent or duplicated.
Personal data is sent to Analytics.
Purchase events repeat after page refresh.
Changes are published without Preview and negative tests.
Consent state does not reflect the visitor's choice.
Versions lack names, descriptions, and ownership.
Ads conversions are counted twice.
Data is collected but never used in decisions.
company-owned account and web container created;
business owner has administrator access;
both GTM snippets are installed correctly;
legacy scripts are inventoried;
Google tag is not duplicated;
measurement plan is approved;
forms report confirmed success;
ecommerce events carry required parameters;
transaction_id is unique;
UTM naming is standardised;
consent acceptance and refusal are tested;
Preview and DebugView checks pass;
mobile and desktop scenarios are covered;
a named container version is created;
a production test is completed after publication;
a person owns future changes.
Google Tag Manager provides control over tags, but analytics quality comes from measurement logic. Start with business objectives, design the event plan, install the container without duplicates, use the data layer for critical actions, test positive and negative scenarios, and apply the resulting data to advertising and website improvements.
BB STUDIO can audit current tags, design a measurement plan, configure GA4, Google Ads, ecommerce events, and quality assurance. Contact BB STUDIO to prepare an implementation plan. Combine analytics with SEO services when the goal includes sustainable organic acquisition.
Let’s create something amazing together