Google Analytics 4 (GA4) is Google’s default analytics platform, replacing Universal Analytics in July 2023. If you run a WordPress site, you need GA4 to understand how visitors interact with your content, measure conversions, and evaluate performance across pages and campaigns.
This guide explains how to properly install GA4 on WordPress using several methods, while covering the technical nuances that experienced users expect.
You’ll learn how to:
Set up a GA4 property in Google Analytics.
Install GA4 in WordPress using three different methods.
Verify that your tracking code works.
Optimize settings for accurate data collection.
This guide assumes that you’re already familiar with WordPress basics and have administrative access to both your site and your Google Analytics account.
Recently our colleague Joshua Goode escalated to the Security Research team an investigation he was performing on several websites that presented the same indicators of compromise. There were small variations in what the final payload was, but the attack timeline was always the same.
Attack timeline
As Joshua initially pointed out and subsequently confirmed by me, the chain starts with the installation of the core-stab plugin, followed by other additional items. The following timeline depicts one of the many compromised sites we reviewed:
Jan 10, 2023 @ 17:29:49.587 UTC – Core stab plugin upload – /wp-admin/update.php?action=upload-plugin
Jan 10, 2023 @ 17:29:52.270 – /wp-content/plugins/core-stab/index.php
Jan 11, 2023 @ 02:12:50.773 – /wp-admin/theme-install.php?tab=upload
Jan 11, 2023 @ 03:37:58.870 – Another core-stab install
Jan 11, 2023 @ 04:15:06.014 – Installation of a new plugin, task-controller, /wp-content/plugins/task-controller/index.php
Jan 11, 2023 @ 08:23:26.519 – Installation of WP File Manager (Unsure if by attacker but this plugin is typical with a lot of malware)
The most common “coincidence” is that all users involved in this attack had their emails listed on at least one public password leak since 2019, which only corroborates the overall findings: the attacker(s) used compromised or leaked accounts to install the malware.
You can find more details on how the core-stab malware works, as well as detailed detection and blocking information for WP security experts, via WPScan.
Testing and validating our Proof-of-Concept for the malicious code.
What to do if my site was infected?
If you find the core-stab plugin installed on your site, the first thing you should do is remove it and then follow these next steps:
Every WordPress installation has a selection of “core” files. These are the files behind critical functionality, and one of them is .htaccess. It includes configuration options for your web server. In other words, it’s extremely important.
If you know how to find and edit .htaccess, you can change your site’s permalink structure, set up redirects, increase security for the dashboard, and make many more tweaks. You don’t even need to know how to code if you follow instructions carefully.
On this page, we’ll talk about the .htaccess file and how it works. We’ll show you how to locate, access, and edit the file. Finally, we’ll wrap up with some frequently asked questions.
WordPress is an excellent platform for your website. But that doesn’t mean that it’s invincible. If you’re working on your site and encounter a sudden glitch, freeze, or crash, it’s easy to enter panic mode.
Fortunately, there are ways to recover and restore your WordPress site after a crash. Whether you installed a poorly-coded plugin or accidentally deleted a file, you can get your site up and running again by following the right steps.
In this post, we’ll take a closer look at WordPress website crashes and some common causes. Then, we’ll guide you through five steps to recover and restore your site after a crash. Let’s get started!
People who visit your website don’t want to wait a long time to see your content. If you don’t optimize your code, render-blocking resources like CSS can contribute to visitors’ perception of slower load times.
Fortunately, you can easily generate critical CSS for your website. By installing a plugin like Jetpack Boost, you’ll be able to extract all the necessary CSS for displaying above-the-fold content. This can be key to making your website appear faster and more user-friendly.
In this guide, we’ll explain critical CSS and why you should consider generating it for your website. Then, we’ll show you two different ways to do this in WordPress.
Did you know that you can view and restore your site from anywhere with the Jetpack mobile app?
The app is the perfect companion to Jetpack Security. With it, you can be reassured that your site is humming along nicely, even while you’re far away from your laptop. Real-time security alerts will empower you to restore your site right from the palm of your hand if ever needed.
Your WordPress website is the product of countless hours of hard work, so it’s important to keep it secure. One essential part of your security setup should be a robust and reliable malware scanner. An effective WordPress malware plugin will help you quickly identify any malicious software that makes its way onto your WordPress website, and provide guidance on removing it.
But, with lots of different WordPress malware scanner plugins available, it may be a challenge to determine which one is right for you. To help, we’ve reviewed six of the most popular options and set out some key things to consider when deciding on the best free WordPress malware scanner for your website.
Building a strong following of readers and customers is hard work. And getting eyes on your content can feel like rubbing two sticks together.
You know there are people out there who are interested in what you’re building — but how to find them? That’s why we’ve created Blaze. Advertise your posts and pages across millions of sites in the WordPress.com and Tumblr ad network. All it takes is a few clicks, starting from $5 per day.
Blaze has incredible reach: more than 13.5 billion impressions per month from millions of active daily visitors is the spark you need to get noticed. It’s like lighter fluid for your best content.
With Jetpack 11.7, we’ve made further enhancements to the Form block, along with several other improvements and bug fixes for a better Jetpack experience.
Want analytics inside your WordPress dashboard? Here are two fast paths: Jetpack Stats for simple, privacy-friendly insights in WP Admin, or Google Analytics (GA4) via a dashboard plugin if you need advanced reporting. Below we’ll show both options step-by-step, then cover frequently asked questions about WordPress analytics.