I wanted to add GTM to this website. Here are the steps using Claude to create the plugin I needed:
- Requested code for the plugin from Claude.
- Uploaded code to Github: https://github.com/adman54/simple-google-tag-manager
- Installation Instructions
- Save the file: Copy the code above and save it as
simple-google-tag-manager.php - Create a plugin folder:
- Create a folder named
simple-google-tag-manager - Place the PHP file inside this folder
- Create a folder named
- Upload to WordPress:
- Zip the
simple-google-tag-managerfolder - Go to WordPress Admin → Plugins → Add New → Upload Plugin
- Upload the zip file and activate
- Zip the
- Configure:
- Go to Settings → Google Tag Manager
- Enter your GTM Container ID (format: GTM-XXXXXXX)
- Click Save Settings
- Save the file: Copy the code above and save it as
Features
Simple interface: Clean admin page under Settings menu
Validation: Ensures GTM ID format is correct
Proper placement: Adds code to both and after as Google recommends
Security: Sanitizes and escapes all inputs/outputs
Quick access: Settings link appears directly on the plugins page

Leave a Reply