Code Snippets
Add analytics IDs and manage custom code snippets in the head, body, footer, or an inactive staging area without editing theme files.
Overview
Code Snippets gives you a central place to manage analytics and custom tracking code without editing your theme. It is useful for marketers, agencies, and site owners who want more control over script placement.
Admin path: Airygen SEO -> Settings -> Code Snippets
The module includes built-in fields for Google Analytics 4 and Google Tag Manager, plus a drag-and-drop manager for your own custom snippets.
Settings
The screen includes a built-in tracking section and a custom snippet section.
Built-in tracking
- Google Analytics 4 has an enable toggle and a Measurement ID field.
- The Measurement ID usually starts with G-.
- Google Tag Manager has an enable toggle and a Container ID field.
- The Container ID usually starts with GTM-.
Custom
- Add Snippet opens a modal for creating a reusable custom snippet.
- Head places snippets in the <head> area.
- Body places snippets right after <body>.
- Footer places snippets before </body>.
- Disabled snippets staging area stores snippets you do not want rendered right now.
- The snippet modal includes Status, Description, Code, and Injection position.
- Description is for internal reference only and is not shown on the frontend.
- Code expects the snippet content only.
- The help text tells you not to include <script> tags.
- Injection position supports Head, Body, Footer, and Inactive.
- Snippets can be dragged between zones and reordered inside a zone.
- Inactive snippets can also be deleted when they are no longer needed.
How to Use
- Open Airygen SEO -> Settings -> Code Snippets.
- If you use Google Analytics 4, turn on Google Analytics 4 and paste your Measurement ID.
- If you use Google Tag Manager, turn on Google Tag Manager and paste your Container ID.
- In Custom, click Add Snippet to create a reusable custom code item.
- In the modal, choose the snippet Status, add a Description, paste the Code, and select an Injection position.
- Save the snippet and drag it into Head, Body, Footer, or the Disabled snippets staging area as needed.
- Reorder snippets inside a zone if output order matters for your setup.
- Save the module and inspect your page source or browser tools to confirm the code appears in the correct place.
Check these items after saving:
- The GA4 and GTM IDs are entered correctly.
- Custom snippets appear in the intended output zone.
- Inactive snippets are not rendered on the frontend.
- Another plugin or theme is not already outputting the same analytics code.
SEO Benefits
This module does not directly improve rankings, but it makes analytics and tracking setup more reliable. That helps you measure organic performance, validate SEO changes, and keep tag placement consistent.
User Cases
Marketers who need a cleaner analytics setup
Before: A marketer depends on theme edits or several separate plugins just to add GA4 and GTM.
After: Code Snippets keeps the main tracking IDs and custom tags in one place, which makes setup easier to review and maintain.
Agencies managing temporary campaign scripts
Before: An agency has launch or campaign snippets that need to be paused without being lost.
After: The Disabled snippets staging area lets the team keep those snippets ready for later without outputting them on the live site.
FAQ
Can I disable a snippet without deleting it?
Yes. Move it to Inactive or switch its Status off in the snippet editor.
Should I paste full <script> tags into the Code field?
No. The help text tells you to paste the code only and not include <script> tags.
What is the difference between Head, Body, and Footer?
They control where the snippet is injected in the page output: inside the head, right after the body opens, or before the body closes.