# PHP Applications & CMS Setup

# How to Install Redmine

- Create database and a database user
- The next step navigate cPanel interface in the `Setup Ruby App` menu, and select the Ruby version (2.1), and setup the application folder, and type the app URI. **The URI can’t contain any special chatacters example (“/” “.” “,” etc,)**. When you fill all datas, please click the **Setup** button.
- Then install the neccessary Ruby on Rails application modules. In the modules row click the **show** label. It may get informed about the full module list in the system requirements of an application. The setup may take up longer shorter time (in Redmine case this his testing 07:48.96 were minutes) <ins>Installing the following Redmine modules:</ins>
    
    
    - bundle
    - i18n#0.6.11
    - builder#3.0.4
    - rails#3.2.19
    - mime-types#1.25.1
    - mocha#1.0.0
    - jquery-rails#3.1.2
    - coderay
    - fastercsv
    - request\_store
    - rbpdf
    - mysql2
    - selenium-webdriver
    - rmagick
    - shoulda#3.3.2
    - ruby-openid#2.3.0
    - request\_store#1.0.5
    - capybara#2.1.0
    - net-ldap#0.3.1
    - rack-openid
    - shoulda-matchers#1.4.1
    - redcarpet#2.3.0
    - yard
    - rake#10.4.2
    - bigdecimal

- Type the module name and click the **Add** button. If we add all neccessary mudules click the **Update** button in the top of the page Then the installer compile and installing the modules, please wait to be patient, if the proccess complete we get a following message: **`Extensions set successfully updated`** .
- click the **Restart** button.
- Then download the Redmine package in SSH: ```
    wget url http://www.redmine.org/releases/redmine-x.x.x.tar.gz
    ```
- Then extract it: ```
    tar xzf redmine-x.x.x.tar.gz
    ```
- In the next step copy the content ind the earlier created folder ```
    cp -R ~/redmine-x.x.x/* ~/redmine
    ```
- Copy or rename the database.yml, and fill up the mySQL connectios details, then save it. ```
    cp ~/redmine/config/database.yml.example ~/redmine/config/database.yml
    ```
    
    ```
    nano ~/redmine/config/database.yml
    ```
- The copy the public folder in to the /public\_html/redmine/ folder. ```
    cp -R ~/redmine/public/* ~/public_html/redmine/
    ```
- Enter the Redmine folder. ```
    cd ~/public_html/redmine
    ```
- Rename the htaccess.fcgi.example, and dispatch.fcgi.example files. ```
    cat htaccess.fcgi.example >> .htaccess
    ```
    
    ```
    cp dispatch.fcgi.example dispatch.fcgi
    ```
- Then go back to the extract the Redmine ```
    cd ~/redmine
    ```
- Add the next line in `Gemfile` file: ```
    gem "bigdecimal"
    ```
- Run the following command:  
    Activate: ```
    source ~/rubyvenv/redmine/2.1/bin/activate
    ```
    
    Install:
    
    ```
    ~/rubyvenv/redmine/2.1/bin/bundle install
    ```
    
    Generating the Secret key:
    
    ```
    ~/rubyvenv/redmine/2.1/bin/rake generate_secret_token
    ```
    
    Load the database:
    
    ```
    RAILS_ENV=production ~/rubyvenv/redmine/2.1/bin/rake db:migrate
    ```
    
    Install the sample data:
    
    ```
    RAILS_ENV=production ~/rubyvenv/redmine/2.1/bin/rake redmine:load_default_data
    ```
- The final step restart the application in cPanel.

# How to redirect my Joomla! site HTTP to HTTPS?

<div id="bkmrk-checklist-for-your-s"><section class="wpb-content-wrapper"><div class="vc_row wpb_row vc_row-fluid"><div class="wpb_column vc_column_container vc_col-sm-12"><div class="vc_column-inner"><div class="wpb_wrapper"><div class="wpb_text_column wpb_content_element"><div class="wpb_wrapper">1. Checklist for your set up To get SSL Certificate enabled for your Joomla site, you should have these followings in advance.
    
    SSL Certificate, which has been installed successfully on your server. You can learn about how to get SSL Certificate HERE.  
    Your dedicated IP Address, which is unique for one SSL Certificate.
    
    Enable Force SSL in your Joomla site
    
    Configure your configuration.php file
    
    Open your configuration.php file
    
    Find the following line:
    
    ```
    var $live_site ='';
    ```
    
    Replace with:
    
    ```
    var $live_site = 'https://www.your-domain.com';
    ```
    
    Next, open .htaccess file then add the following code to the bottom of the file.
    
    ```
    RewriteEngine On
    RewriteCond %{HTTPS} OFF
    RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
    ```
2. enable Force SSL in your Joomla site In the Admin Panel, navigate through **System** &gt;&gt; **Global Configuration** or simply click the **Global Configuration** button.
    
    Within the Server tab, in the Server Settings section, there are 3 Force SSL alternatives that you can select, namely:
    
    
    - None: SSL will not be enabled in your Joomla site.
    - Administrator Only: connections to your administrator will be on HTTPS.
    - Entire Site: connections all over your website will be on HTTPS.

</div></div></div></div></div></div></section></div><div id="bkmrk-"></div>

# Joomla 1.5 and MariaDb – Collation problem

We found the hard way that all Joomla 1.5 ( yes there are still joomla 1.5 ) have problem with the collation of the database when you use UTF 8 characters . After several experiments with collation we found in some blogs that the anwer is pretty easy. You have to change a line in the mysqli file in Joomla.

**in libraries/joomla/database/database/mysql.php**

or (depending on your setting)

**libraries/joomla/database/database/mysqli.php**

**comment the line 186**

return ($verParts\[0\] == 5 || ($verParts\[0\] == 4 &amp;&amp; $verParts\[1\] == 1 &amp;&amp; (int)$verParts\[2\] &gt;= 2));

**and add this instead (assuming these days you’ll have unicode supported database):**

return 1;

**the code looks like:**

function hasUTF()  
{  
$verParts = explode( ‘.’, $this-&gt;getVersion() );  
// return ($verParts\[0\] == 5 || ($verParts\[0\] == 4 &amp;&amp; $verParts\[1\] == 1 &amp;&amp; (int)$verParts\[2\] &gt;= 2));  
return (1);  
}

# How To Install Google Analytics 4 in WordPress

<span lang="en" style="color:rgb(0,0,0);">Google Analytics 4, also known as GA4, is the latest version of Google’s analytics platform, providing advanced tracking capabilities for both websites and mobile apps. If you run a [WordPress site](https://dotroll.com/en/blog/why-should-you-update-the-wordpress-to-the-newest-version/), integrating Google Analytics 4 is essential for monitoring website traffic, user behavior, and overall website performance. This step-by-step guide will show you exactly how to install Google Analytics 4 in WordPress using three reliable methods: a plugin, manual code insertion, and Google Tag Manager.</span>

### <a name="_o2nwqdysilrc"></a>**<span lang="en" style="font-size:17pt;line-height:115%;">Set Up a Google Analytics 4 Property</span>**

##### <a name="_fpu7seghm4n"></a>**<span lang="en" style="font-size:13pt;line-height:115%;color:#000000;">Create a Google Analytics Account and Property</span>**

<span lang="en" style="color:rgb(0,0,0);">First, go to the Google Analytics website at analytics.google.com. If you don't have a GA4 account yet, click **Start Measuring** and fill in the necessary details. In the **Account** creation section, type your desired name to use.</span>

<span lang="en">![embedded-image-qi1ev7o3.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-qi1ev7o3.png)</span>

<span lang="en" style="color:rgb(0,0,0);">And then, in the **Property** section. Enter a name for your property, such as your website or business name, then select your reporting time zone and currency. </span>

<span lang="en">![embedded-image-9dpmlamf.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-9dpmlamf.png)</span>

<span lang="en" style="color:rgb(0,0,0);">Once you have entered these details, click **Next** and complete the additional business information, including your industry category and business size. </span>

<span lang="en">![embedded-image-zrrlcyxe.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-zrrlcyxe.png)</span>

<span lang="en" style="color:rgb(0,0,0);">Select your business objectives or choose **'Other'** to access the full reporting features. Finally, click **Next** to create your Google Analytics 4 Account.</span>

##### <a name="_u0w29yciexe"></a>**<span lang="en" style="font-size:13pt;line-height:115%;color:#000000;">Set Up a Data Stream</span>**

<span lang="en" style="color:rgb(0,0,0);">Once the property is created, you will be prompted to set up a data stream. Select **'Web'** as the platform and enter your website's URL, ensuring it begins with https:// or http://. Name your stream — for example, “MySite Website.” You can also enable or adjust **Enhanced Measurement** settings, which automatically track events like page views, scrolls, and outbound clicks. When you're finished, click **Create and Continue**.</span>

<span lang="en">![embedded-image-fxipwca7.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-fxipwca7.png)</span>

<span lang="en">![embedded-image-sypmpkjv.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-sypmpkjv.png)</span>

<span lang="en" style="color:rgb(0,0,0);">After creating the data stream, your **Web Stream Details** page will display your unique **Measurement ID** (which starts with "G-" followed by letters and numbers). Copy this Measurement ID, as it will be needed to connect Google Analytics to your WordPress site.</span>

<span lang="en">![embedded-image-pco3judt.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-pco3judt.png)</span>

<span lang="en" style="color:rgb(0,0,0);">Throughout this process, be sure to review and accept the Google Analytics Terms of Service when prompted to complete your setup. Following these steps will ensure your website is correctly connected to Google Analytics 4 and ready to collect valuable visitor data.</span>

<span lang="en">![embedded-image-j3ejypri.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-j3ejypri.png)</span>

### <a name="_k58oiv7zipv6"></a>**<span lang="en" style="font-size:17pt;line-height:115%;">Choose a Method to Add Google Analytics 4 to WordPress</span>**

<span lang="en" style="color:rgb(0,0,0);">There are three primary methods for installing Google Analytics 4 in WordPress: using a plugin, manually adding the tracking code, or integrating with Google Tag Manager. Each option suits different levels of technical experience and site needs.</span>

#### <a name="_v0wgt7zi41c1"></a>**<span lang="en" style="font-size:17pt;line-height:115%;">Install Google Analytics 4 Using a WordPress Plugin</span>**

<span lang="en" style="color:rgb(0,0,0);">The easiest method for most users is to use a WordPress plugin. Several plugins support GA4 integration, simplifying the setup process through your WordPress dashboard.</span>

<span lang="en" style="color:rgb(0,0,0);">To begin, log in to your WordPress admin area. Go to “Plugins” and click “Add New.” Search for a trusted plugin that supports the new Google Analytics 4, such as Site Kit by Google or Google Analytics 4 by Google. Click “Install Now” and then “Activate.”</span>

<span lang="en">![embedded-image-fm2blg6r.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-fm2blg6r.png)</span>

<span lang="en" style="color:rgb(0,0,0);">Once the plugin is active, navigate to its settings within your WordPress dashboard. You'll usually be asked to sign in with your Google account and connect your GA4 property. Paste your GA4 tracking code or select your Google Analytics 4 property directly from the interface.</span>

<span lang="en">![embedded-image-w3kvhzyw.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-w3kvhzyw.png)</span>

<span lang="en">![embedded-image-igsbt2pm.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-igsbt2pm.png)</span>

<span lang="en" style="color:rgb(0,0,0);">Some plugins offer additional options, such as enabling enhanced measurement or viewing the analytics dashboard directly within your WordPress dashboard. After connecting, test the setup to make sure GA4 is collecting data.</span>

#### **<span lang="en" style="font-size:17.5pt;line-height:115%;">Manually Add GA4 Tracking Code Without a Plugin</span>**

<span lang="en" style="color:rgb(0,0,0);">If you want to add Google Analytics 4 to your WordPress site without using a plugin, you can do it by manually inserting the GA4 tracking code into your theme files. This method is straightforward and gives you direct control over how Google Analytics 4 is loaded on your site.</span>

<span lang="en" style="color:rgb(0,0,0);">Start by logging into your Google Analytics account. From your Google Analytics 4 property, go to Admin, then click on Data Streams and select your web data stream. Copy the global site tag (gtag.js), which contains your GA4 Measurement ID. This is the tracking code that connects your site to Google Analytics 4.</span>

<span lang="en">![embedded-image-fljcoavx.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-fljcoavx.png)</span>

<span lang="en">![embedded-image-lbf2rlk6.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-lbf2rlk6.png)</span>

<span style="color:rgb(0,0,0);"><span lang="en">Next, log in to your WordPress dashboard and navigate to Appearance &gt; Theme File Editor. From the list of theme files on the right side, select header.php. This file controls the code loaded in the </span><span lang="en" style="font-family:'Roboto Mono';">&lt;head&gt;</span><span lang="en"> section of your WordPress website.</span></span>

<span lang="en">![embedded-image-oe1lpleb.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-oe1lpleb.png)</span>

<span style="color:rgb(0,0,0);"><span lang="en">Paste the entire GA4 tracking code directly above the closing </span><span lang="en" style="font-family:'Roboto Mono';">&lt;/head&gt;</span><span lang="en"> tag in the header.php file. This ensures that the Google Analytics 4 script is loaded on every page of your website when a visitor arrives.</span></span>

<span lang="en">![embedded-image-3zrlgtaf.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-3zrlgtaf.png)</span>

<span lang="en" style="color:rgb(0,0,0);">After placing the code, click Update File to save your changes.</span>

<span style="color:rgb(0,0,0);"><span lang="en">If you're using a theme that offers a built-in field for adding scripts to the </span><span lang="en" style="font-family:'Roboto Mono';">&lt;head&gt;</span><span lang="en"> section (available in some theme settings or frameworks), you can paste the GA4 code there instead. This is still considered a manual method and may help keep the tracking in place during theme updates.</span></span>

<span lang="en" style="color:rgb(0,0,0);">Manually adding the GA4 tracking code without a plugin ensures a lightweight and direct connection between your WordPress site and your Google Analytics 4 property, giving you immediate access to website traffic insights through the Google Analytics platform.</span>

### **<span lang="en" style="font-size:17.5pt;line-height:115%;">Use Google Tag Manager to Add GA4 to WordPress</span>**

<span lang="en" style="color:rgb(0,0,0);">For users who prefer complete control over their tracking setup without relying on a plugin, manually adding Google Tag Manager is an efficient way to install Google Analytics 4 in WordPress. This approach is beneficial if you plan to manage multiple tags or track custom events across your WordPress site.</span>

<span lang="en"><span style="color:rgb(0,0,0);">Begin by creating a Google Tag Manager account through your Google account. Inside the dashboard, set up a new container and select "Web" as the target platform for your WordPress website.</span> <span>![embedded-image-b7xtvw46.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-b7xtvw46.png)</span></span>

<span lang="en">![embedded-image-fhs0cfw4.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-fhs0cfw4.png)</span>

<span lang="en" style="color:rgb(0,0,0);">Once the container is created, Google Tag Manager generates two code snippets: one for the &lt;head&gt; section and one for the &lt;body&gt;.</span>

<span lang="en">![embedded-image-bou5szbs.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-bou5szbs.png)</span>

<span lang="en" style="color:rgb(0,0,0);">To install these manually, go to your WordPress admin panel and navigate to "Appearance"&gt; "Theme File Editor.” Open the header.php file and paste the first container code snippet immediately before the closing &lt;/head&gt; tag. </span>

<span lang="en">![embedded-image-fdyhwbx2.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-fdyhwbx2.png)</span>

<span lang="en">![embedded-image-ubl7amno.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-ubl7amno.png)</span>

<span lang="en" style="color:rgb(0,0,0);">Then, open the footer.php or another appropriate template file and insert the second snippet right after the opening &lt;body&gt; tag. Save the changes to apply the container to your site.</span>

<span lang="en">![embedded-image-niwsuwmq.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-niwsuwmq.png)</span>

<span lang="en" style="color:rgb(0,0,0);">After the container is active on your WordPress site, return to your Tag Manager dashboard to configure the Google Analytics 4 (GA4) tracking. Create a new tag and select "Google Analytics: GA4 Configuration” as the tag type. Enter your GA4 tracking code (Measurement ID) obtained from your Google Analytics 4 property.</span>

<span lang="en">![embedded-image-w0xlidum.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-w0xlidum.png)</span>

<span lang="en">![embedded-image-merlfrvr.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-merlfrvr.png)</span>

<span lang="en">![embedded-image-kbcolg7e.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-kbcolg7e.png)</span>

<span lang="en">![embedded-image-rklcze0o.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-rklcze0o.png)</span>

<span lang="en" style="color:rgb(0,0,0);">Set the trigger to "All Pages" to ensure that the GA4 tag fires on every page of your site. Once configured, click “Save" and publish the container.</span>

<span lang="en" style="color:rgb(0,0,0);">By manually placing the Google Tag Manager code into your WordPress theme, you can integrate Google Analytics 4 with WordPress without the need for any additional plugins. This setup allows you to connect GA4 to your site efficiently while keeping complete control over your analytics tags and ensuring accurate analytics tracking code deployment across your entire website.</span>

### <a name="_xamgf7ah3v5s"></a>**<span lang="en" style="font-size:17pt;line-height:115%;">Verify That GA4 Is Working on Your WordPress Site</span>**

<span lang="en" style="color:rgb(0,0,0);">After completing the installation, it's essential to verify that your GA4 tracking is active. Log in to your Google Analytics 4 property and open the analytics dashboard. Visit your WordPress site in a new browser tab and check the “Real-time" report.</span>

<span lang="en">![embedded-image-xd4dcli0.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-xd4dcli0.png)</span>

<span lang="en" style="color:rgb(0,0,0);">If your visit is successful, your installation is complete. If not, double-check that the tracking code or plugin was correctly implemented. You can also use the Google Tag Assistant or Chrome's developer tools to inspect whether the GA4 script is loading correctly.</span>

### <a name="_opv6uyy5rkyb"></a>**<span lang="en" style="font-size:17pt;line-height:115%;">Conclusion</span>**

<span lang="en" style="color:rgb(0,0,0);">Installing Google Analytics 4 in WordPress is crucial for accurately tracking user behavior and measuring your website’s performance. Whether you use a WordPress plugin, manually insert the GA4 tracking code, or set it up through Google Tag Manager, each method ensures your analytics platform begins collecting valuable data.</span>

<span lang="en" style="color:rgb(0,0,0);">If you have the technical confidence, we recommend using the manual method to avoid unnecessary plugins. Fewer plugins typically result in better site performance and fewer compatibility issues. However, for users who prefer a simpler setup, a plugin remains a reliable and effective option.</span>

<span lang="en" style="color:rgb(0,0,0);">With Google Analytics 4 properly connected to your WordPress website, you'll have the data needed to monitor traffic, improve user experience, and make informed, data-driven decisions for your business.</span>

<span lang="en"> </span>

<span lang="en"> </span>

<span lang="en"></span>

# How to install Google Tag Manager in WordPress

<span>Efficiently managing website analytics and marketing tags is crucial for tracking conversions, understanding visitors, and optimizing your WordPress site. Google Tag Manager (GTM) is a free, user-friendly tool that enables you to add, update, and organize all your tracking codes from a single, central dashboard, eliminating the need to edit your site's code each time. This guide will show you how to add Tag Manager on your WordPress site step by step, helping you streamline analytics management and gain actionable insights without complicated setup.</span>

### <a name="_k82udekygged"></a>**<span style="font-size:17pt;line-height:115%;">What Is Google Tag Manager and Why Use It in WordPress?</span>**

<span>Google Tag Manager (GTM) is a free tool by Google that lets you manage all of your website's tracking codes, known as tags, from a single interface. Tags can include **Google Analytics 4 tracking**, **Google Ads conversion codes**, or **custom snippets** for remarketing and WordPress form tracking.</span>

<span>Instead of manually inserting separate pieces of code into your WordPress site each time you want to add tracking, GTM provides a container system. You only need to install the **Google Tag Manager container code** once on your WordPress website. From then on, you can add, update, or remove tags directly from the GTM dashboard without editing your theme files.</span>

<span>For WordPress website owners, this means more straightforward integration with tools like **Google Analytics and Google Ads**, fewer risks of coding errors, and more flexibility to handle complex tag configurations. By centralizing all tracking codes, Google Tag Manager enhances efficiency, streamlines website analytics, and facilitates cleaner site management.</span>

#### <a name="_pfybt8q1slk1"></a>**<span style="font-size:17pt;line-height:115%;">Step 1: Set Up Your Google Tag Manager Account</span>**

<span>To begin, visit the Google Tag Manager website and sign in with your Google account. Create a new account setup by entering your website name and domain, then add a new container for your WordPress site. Accept the Google Tag Manager Terms of Service Agreement to proceed.</span>

<span>Once your account is ready, you'll see the container dashboard where you can manage all of your tags. At this stage, GTM will generate the GTM snippet you need to install.</span>

<span> </span>

<table class="MsoNormalTable" id="bkmrk-" style="width:624px;border-collapse:collapse;border:none;"><tbody><tr><td style="width:468pt;border:solid #000000 1pt;padding:5pt 5pt 5pt 5pt;">**<span>![embedded-image-xpjjdchp.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-xpjjdchp.png)</span>**

</td></tr><tr><td style="width:468pt;border:solid #000000 1pt;border-top:none;padding:5pt 5pt 5pt 5pt;">**<span>![embedded-image-szbpi7wo.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-szbpi7wo.png)</span>**

</td></tr></tbody></table>

#### <a name="_j2tjegmhwcvf"></a>**<span style="font-size:17pt;line-height:115%;">Step 2: Get Your GTM Container Code</span>**

<span>After account setup, GTM provides two pieces of code: one for the header of your site and one for the opening body tag. The Google Tag Manager code must be placed correctly on your WordPress website for tracking to function properly. The container tag ensures that every tag you add through GTM is automatically loaded on your site.</span>

<table class="MsoNormalTable" id="bkmrk-%C2%A0-1" style="width:624px;border-collapse:collapse;border:none;"><tbody><tr><td style="width:468pt;border:solid #000000 1pt;padding:5pt 5pt 5pt 5pt;">**<span>![embedded-image-dhdlpqv8.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-dhdlpqv8.png)</span>**

</td></tr></tbody></table>

<span> </span><a name="_ea1kmovy842m"></a>**<span style="font-size:17pt;line-height:115%;">Step 3: Add GTM Code to Your WordPress Site</span>**

<span>To implement Google Tag Manager on WordPress, you can choose between a plugin-based approach for simplicity or manually embedding the GTM container code into your theme. Before making changes, make sure your</span><span lang="en">[<span style="text-decoration:none;"> </span>](https://dotroll.com/en/blog/why-should-you-update-the-wordpress-to-the-newest-version/)[<span lang="hu" style="color:#1155cc;">WordPress site is updated</span>](https://dotroll.com/en/blog/why-should-you-update-the-wordpress-to-the-newest-version/)</span><span> to the latest version to avoid compatibility or security issues during installation.</span>

##### <a name="_6j2gk2uczzql"></a>**<span style="font-size:13pt;line-height:115%;color:#000000;">Option A: Install a Plugin</span>**

<span>The simplest way to install Google Tag Manager to WordPress site is by using a plugin. A tag manager plugin provides fields where you can paste your Google Tag Manager container tag without touching your site’s files. Popular options include the Insert Headers and Footers plugin, the</span><span lang="en">[<span style="text-decoration:none;"> </span>](https://wpcode.com/)[<span lang="hu" style="color:#1155cc;">WPCode plugin</span>](https://wpcode.com/)</span><span>, or a dedicated tool such as</span><span lang="en">[<span style="text-decoration:none;"> </span>](https://de.wordpress.org/plugins/duracelltomi-google-tag-manager/)[<span lang="hu" style="color:#1155cc;">DuracellTomi’s</span>](https://de.wordpress.org/plugins/duracelltomi-google-tag-manager/)</span><span> Google Tag Manager for WordPress plugin. After you install and activate the plugin through your WordPress dashboard, navigate to its settings page and insert the GTM container code snippets. This ensures the code is placed correctly in both the header and the opening body tag, providing a reliable way to add tracking codes directly in your WordPress admin without editing theme files.</span>

<table class="MsoNormalTable" id="bkmrk--1" style="width:624px;border-collapse:collapse;border:none;"><tbody><tr><td style="width:468pt;border:solid #000000 1pt;padding:5pt 5pt 5pt 5pt;">**<span>![embedded-image-fdawo4pf.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-fdawo4pf.png)</span>**

</td></tr><tr><td style="width:468pt;border:solid #000000 1pt;border-top:none;padding:5pt 5pt 5pt 5pt;">**<span>![embedded-image-n9z4pvxv.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-n9z4pvxv.png)</span>**

</td></tr></tbody></table>

##### <a name="_riun66bbjo25"></a>**<span style="font-size:13pt;line-height:115%;color:#000000;">Option B: Manual Installation</span>**

<span>If you prefer not to install a plugin, you can manually add the Google Tag Manager code to your WordPress theme. From your WordPress dashboard, go to </span>**<span style="font-family:'Arial Unicode MS';">Appearance → Theme File Editor</span>**<span> (or access your site files via FTP). The first snippet should be placed inside the </span><span style="font-family:'Roboto Mono';color:#188038;">&lt;head&gt;</span><span> section, and the second should go immediately after the opening </span><span style="font-family:'Roboto Mono';color:#188038;">&lt;body&gt;</span><span> tag. While this method works, it requires editing your theme files directly through the WordPress dashboard or FTP. Any theme update may overwrite your changes, requiring you to reapply the code. Because of this, most website owners choose plugins for long-term stability, while manual installation is better suited for developers who are comfortable editing code.</span>

<span> </span>

<table class="MsoNormalTable" id="bkmrk--2" style="width:624px;border-collapse:collapse;border:none;"><tbody><tr><td style="width:468pt;border:solid #000000 1pt;padding:5pt 5pt 5pt 5pt;">**<span>![embedded-image-mphzfqh3.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-mphzfqh3.png)</span>**

</td></tr><tr><td style="width:468pt;border:solid #000000 1pt;border-top:none;padding:5pt 5pt 5pt 5pt;">**<span>![embedded-image-ors3jkj7.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-ors3jkj7.png)</span>**

</td></tr><tr><td style="width:468pt;border:solid #000000 1pt;border-top:none;padding:5pt 5pt 5pt 5pt;">**<span>![embedded-image-bh5wmrs8.png](https://dotroll.com/en/knowledge-base/uploads/images/gallery/2026-06/embedded-image-bh5wmrs8.png)</span>**

</td></tr></tbody></table>

##### <span> </span><a name="_arf0vbhb5wv9"></a>**<span style="font-size:17pt;line-height:115%;">Step 4: Verify the Installation</span>**

<span>Once you add Google Tag Manager to your WordPress site, it's important to confirm the installation is correct. Start by using GTM's Preview mode to check whether tags are firing as expected. You can also install the Tag Assistant browser extension to verify that the Google Tag Manager code is loading properly on your website.</span>

<span>Beyond these tools, monitor your Google Analytics account after you add Google Analytics through Tag Manager to ensure data is being collected correctly. Checking the real-time reports in Google Analytics 4 is one of the fastest ways to confirm tracking activity. Regularly reviewing your tag performance helps you catch issues early, especially if you make changes to your WordPress website or add new tracking codes.</span>

##### <a name="_ncgco9ljbp"></a>**<span style="font-size:17pt;line-height:115%;">Step 5: Integrating Tags With GTM</span>**

<span>After installation, you're ready to add tracking codes through Google Tag Manager. A common first step is integrating Google Analytics 4 with your WordPress site. In your GTM dashboard, create a new tag, choose Google Analytics as the tag type, and enter your measurement ID.</span>

<span>You can also add Google Ads conversion tracking, remarketing pixels, and custom code snippets to track WordPress forms or user actions. With GTM, all of these tags can be managed from a single interface without editing your WordPress website's code. This flexibility makes it the best way to add tracking codes and integrate Google services for website analytics.</span>

<span>When adding tracking tags, remember that you are collecting user data. To comply with privacy regulations such as GDPR and CCPA, make sure your site includes a consent mechanism before tags fire. Many WordPress plugins support cookie consent banners and user permissions, helping website owners stay compliant while using Google Tag Manager effectively.</span>

### <a name="_ostuchudndou"></a>**<span style="font-size:17pt;line-height:115%;">Troubleshooting Common Issues With GTM in WordPress</span>**

<span>Sometimes, Google Tag Manager doesn’t track correctly due to mistakes in code placement or plugin conflicts. If tags are not firing, double-check that the container code is in both the header and opening body tag. If you’re using a plugin for WordPress, confirm the settings are correct and the plugin is active.</span>

<span>Another issue occurs when Google Analytics doesn’t track properly because the wrong property ID is used. Always verify your Google Analytics and Google Tag Manager account settings before testing.</span>

### <a name="_s5tba7e3rob"></a>**<span style="font-size:17pt;line-height:115%;">Conclusion</span>**

<span>Installing Google Tag Manager in WordPress allows website owners to manage tracking codes efficiently, integrate Google Analytics and Google Ads, and simplify website analytics. Whether you choose to add GTM using a plugin or manually through code snippets, the setup ensures you only need to install it once. From there, you can easily add, test, and manage tags without touching your WordPress site code again. For anyone looking to streamline their tracking setup, Google Tag Manager is the most effective way to add and manage tags on a WordPress website.</span>