Where do I put Google Analytics code in WordPress?
Add Google Analytics to WordPress Without a Plugin
- Click on Admin in the left taskbar.
- In the property column, click Tracking Info, and then Tracking Code.
- Now you can get the tracking code under the Website tracking section.
- Step 2: Add the Tracking Code to the header.php file.
Where do I put the Google Analytics code?
The code should be added near the top of the <head> tag and before any other script or CSS tags, and the string ‘UA-XXXXX-Y’ should be replaced with the property ID (also called the “tracking ID”) of the Google Analytics property you wish to track.
How do I add Google Analytics to a WordPress plugin?
To create this plugin, you’ll follow five steps:
- Check your active theme’s header. php file to ensure it includes the wp_head hook.
- Create a new file in your plugins folder.
- Get your analytics tracking code from the Google Analytics site.
- Add some code including the tracking code to your plugin.
- Activate the plugin.
How do I add Google Analytics code to WordPress without plugins?
Install Google Analytics in WordPress Without Plugins – “