How to connect Google Tag Manager on Hostinger
Connect Google Tag Manager to your Hostinger-hosted website by adding the GTM container code to your site's header and body sections. This can be done through the file manager, WordPress admin, or Hostinger's website builder depending on your setup.
Prerequisites
- Active Hostinger hosting account
- Google Tag Manager account
- Website already hosted on Hostinger
- Access to your website's HTML files or WordPress admin
Step-by-Step Instructions
Create Google Tag Manager Container
Access Hostinger Control Panel
Open File Manager
Add GTM Head Code
index.html or header.php for WordPress). Right-click and select Edit. Find the opening <head> tag and paste the first GTM code snippet immediately after it. Save the file by clicking Save & Close.Add GTM Body Code
<body> tag. Paste the second GTM code snippet (the noscript version) immediately after the <body> tag. Save the file again to ensure both code snippets are properly installed.Verify Installation Using Preview Mode
Publish GTM Container
Common Issues & Troubleshooting
GTM preview mode shows 'No container found'
Check that both GTM code snippets are correctly placed in the <head> and <body> sections. Clear your browser cache and try again with an incognito window.
Cannot edit files in File Manager
Ensure you have the correct file permissions set to 644 for files and 755 for folders. Contact Hostinger support if you're still unable to edit files.
WordPress site breaks after adding GTM code
Remove the code from header.php and instead use a WordPress plugin like Google Tag Manager for WordPress or add the code through Appearance > Theme Editor in WordPress admin.
GTM tags not firing on all pages
Verify that the GTM code is added to your main template file that's used across all pages. For WordPress, ensure you're editing the active theme's header.php file.