How to Set Up Google Tag Manager on Your Website
Google Tag Manager (GTM) is a free tool that lets you add, edit, and manage tracking code on your website without needing to modify the site’s code every time. Instead of asking a developer to add a new analytics script or advertising pixel, you do it yourself through GTM’s interface — and it goes live on your site within minutes.
Once set up, GTM becomes the central hub for all your tracking: Google Analytics, Facebook Pixel, LinkedIn Insight Tag, Google Ads conversion tracking, and any other script that needs to fire on your website. This guide walks you through setting it up from scratch.
Creating your GTM account and container
Go to tagmanager.google.com and sign in with the same Google account you use for Google Analytics and Search Console. Click “Create Account” and enter your account name (typically your company name) and your website’s URL. GTM uses “containers” — one container per website — so give the container a name that clearly identifies which site it belongs to.
Select “Web” as the target platform and click Create. Google will display your container code: two snippets of JavaScript that need to be installed on every page of your website. The first snippet goes in the head section, as high as possible. The second goes immediately after the opening body tag. This is the only time you’ll need a developer to touch the code — after this, everything else happens through the GTM interface.
If you’re using WordPress, the GTM4WP plugin or Insert Headers and Footers plugin makes it easy to add the container snippets without editing template files directly. For other platforms, most have a “custom code” or “header/footer scripts” section in settings where you can paste them.
Adding your first tag: Google Analytics 4
With your container installed, you can start adding tags. In GTM’s workspace, click “Tags” in the left menu, then “New”. Choose “Tag Configuration” and select “Google Tag” (previously called “GA4 Configuration Tag”). Enter your GA4 Measurement ID — found in GA4 under Admin > Data Streams > your web stream. Set the trigger to “All Pages” so GA4 fires on every page of your site.
Before publishing, use GTM’s Preview mode (the “Preview” button in the top right) to test your tag. Preview mode opens your website with a debugging panel showing which tags fire on each page. Verify that your GA4 tag fires correctly, then close the preview and click “Submit” in GTM to publish your changes live.
Once live, check Google Analytics 4’s Realtime report to confirm data is flowing in. Open your website in another tab and watch for your visit to appear in GA4’s Realtime overview. If it appears, your GA4 setup through GTM is working correctly.
Adding conversion tracking and other tags
The real value of GTM comes when you start adding event tracking and conversion tags without touching your code. To track a contact form submission, for example, create a new tag, set it to fire on a GA4 Event, and configure a trigger based on the “Form Submission” trigger type, filtering to the specific form on your contact page. Name the event something meaningful like “contact_form_submit” and you’ll see it in GA4’s Events report.
For advertising pixels like Facebook (Meta) Pixel or LinkedIn Insight Tag, GTM has built-in templates or you can paste the pixel’s base code as a Custom HTML tag firing on All Pages, then add separate event tags for specific actions like purchases or lead form submissions.
Keep your GTM container organised as it grows. Use consistent naming conventions for tags, triggers, and variables (for example: “GA4 — Contact Form Submit” for the tag, “Trigger — Contact Form Submit” for the trigger). Add notes to each tag explaining what it tracks and when it was added. A well-organised GTM container is far easier to maintain and audit over time.
Common questions.
Do I need GTM if I already have Google Analytics installed directly?
Will GTM slow down my website?
What’s the difference between GTM tags, triggers, and variables?
More on web design & ux.
Want a hand putting this into practice?
Book a free, no-obligation consultation with a Norwich-based specialist.
Let's put your business in a better light.
Book a free, no-pressure consultation. We'll talk through your goals and tell you honestly what we'd do — whether you work with us or not.