Google Analytics provides essential insights into your website’s traffic, user behavior, and performance. This guide shows you how to set up a Google Analytics account and connect it to your website hosted on the 10Web platform by adding the tracking code.
Create a Google Analytics property
- Visit analytics.google.com and log in with your Google account.
- Click the Admin gear icon (bottom-left).
- Under the Account column, click Create Account.
- Complete the account details and proceed to Next.
- Set up a Web property by entering your website name and domain.
- Configure business settings and accept the Terms of Service.
- Once the property is created, choose Web stream and enter your site URL.\
- Copy the Global Site Tag (gtag.js) script shown under Install manually.
Insert the tracking code into the Header using a plugin
If you prefer not to edit theme files, use a lightweight script injection plugin:
- In your WordPress dashboard, go to Plugins > Add New.
- Search for Insert Headers And Footers plugin.
- Click Install Now, then Activate.
- Go to Settings > WP Headers And Footers.
- Paste the Google Analytics script into the Header section.
- Click Save Settings.
Note:
This method keeps the code persistent even when switching themes.
Add tracking code manually via header.php
- In your 10Web dashboard, go to My Websites and click Manage.
- Open Hosting Services > connect via SFTP.
- Navigate to wp-content/themes/your-active-theme/.
- Open header.php.
- Paste the Google Analytics script right before the closing </head> tag.
- Save the changes.
Important:
This method requires re-adding the code if you change or update your WordPress theme.
Confirm tracking is active
- Return to Google Analytics.
- Navigate to Reports > Real-Time.
- Open your website in a separate window or device.
- You should see real-time activity if tracking is correctly installed.
With Google Analytics integrated into your 10Web-hosted website, you'll start receiving valuable data to better understand your audience and improve your site's performance.