How to add Google Analytics to my WordPress website in Directadmin
-
Google Analytics is an essential tool for understanding your website audience. Here are two ways to add Google Analytics to your WordPress website in Directadmin:
Option 1: Use Plugins
The easiest way to add Google Analytics to your WordPress website is by using plugins.
-
Install a Plugin: One of the most popular plugins for adding Google Analytics to your WordPress website is MonsterInsights. Search for it in the WordPress plugin repository, install and activate it.
-
Configure the Plugin: Once installed and in the plugin's settings, authenticate your Google account, authorize the website for tracking and follow a few easy steps. The plugin will automatically generate and install the Google Analytics tracking code for you by inserting the tracking code in the header section of your website.
-
Verify Tracking Code: Verify the plugin settings, and check Google Analytics to confirm that data is being tracked.
Option 2: Manually Add the Tracking Code to Header File
The alternative way is to manually add the Google Analytics tracking code to your website's header file. Here's how:
-
Access Directadmin FileManager: Open your control panel in Directadmin, navigate to the Files section, open File Manager, and navigate to the wp-content/themes folder.
-
Navigate to the Theme Folder: Select the theme folder that you're currently using, which contains the files of your selected theme.
-
Edit "header.php" file: Within that folder, open the header file, which displays the website header. Look for the tag and paste the Google Analytics tracking code before it.
-
Save Changes: Once you’ve added the tracking code to the header file, save it and exit.
-
Verify Tracking Code: Verify code correctness by checking Google Analytics to confirm the data is being tracked.
These are the two options for adding Google Analytics tracking code to a WordPress website in Directadmin. Choose the one that works best for you based on your preferences and technical expertise.
-