Astra is a highly customizable WordPress Theme. You can use Astra's Custom Layout feature to add different codes and content to the website without modifying Theme files or installing additional Plugins; the Theme's built-in functionality can achieve this. Ordinary
WordPress Theme adds Google AnalyticsOr other methods of adding statistical code involve editing theme templates or installing additional plugins. If you are using
Astra Theme, then you can use the custom layouts feature to add it.
The specific method is as follows:1. In the Astra Pro settings, enable the Custom Layouts feature, as shown in the image below:

2. Find Custom in the left-hand theme options, enter it, create a new project, and click the code editor to edit.

3. Give it a name for identification, such as Google Analytics Code. Then paste the Google Analytics code you created into the content area below.

4. In the custom layout settings below, select Hooks for Layout, choose wp_footer for Action, and select Entire Website for Display On.

After publishing, your website's source code will contain the Google Analytics code you just added. Isn't it simple? This method completely eliminates the worry of messing up your website's theme code or losing content during future theme upgrades, as everything is saved in the database. If you want
After building your own website, and also hope to achieve many custom functions and a beautiful appearance, then Naiba recommends you try
Astrathis theme.
A method more suitable for beginners: Quickly submit your WordPress website to Google and add Google Analytics code
Comments are closed
The comment function for this article is closed. If you have any questions, please feel free to contact us through other channels.