- Create a GTM Account:
- Go to Google Tag Manager, sign in, and create your container.
- Copy the two code snippets GTM provides.
- Install the Code in WordPress:
- Method 1 (Plugin):
- Install a plugin like “Insert Headers and Footers.”
- Paste the
<script>code snippet in the header section and the<noscript>code snippet in the body section. - Save your changes.
- Method 2 (Theme Edit):
- In your WordPress dashboard, go to “Appearance > Theme File Editor.”
- Add the
<script>snippet before the closing</head>tag in your header.php. - Add the
<noscript>snippet immediately after the opening<body>tag in your theme’s header or body file. - Update the files.
- Method 1 (Plugin):
- Verify Installation:
- Use the “Preview” mode in GTM or a browser extension like Tag Assistant to ensure GTM is firing correctly.
Once done, you can start adding tags and triggers in GTM—no more code edits in WordPress!

