700+ Best Free WordPress Tutorials (Step by Step) https://www.wpbeginner.com Beginner's Guide for WordPress Wed, 19 Mar 2025 10:00:34 +0000 en-US hourly 1 How to Setup Matomo Analytics in WordPress (The Easy Way) https://www.wpbeginner.com/wp-tutorials/how-to-setup-matomo-analytics-in-wordpress/ https://www.wpbeginner.com/wp-tutorials/how-to-setup-matomo-analytics-in-wordpress/#respond Wed, 19 Mar 2025 10:00:00 +0000 https://www.wpbeginner.com/?p=332177 If you want more control over your WordPress website’s analytics—and you’re not comfortable handing over your data to big tech companies—then you may want to use Matomo. Matomo is a powerful, privacy-focused analytics platform that provides the insights you need to grow your business while… Read More »

The post How to Setup Matomo Analytics in WordPress (The Easy Way) first appeared on WPBeginner.

]]>
If you want more control over your WordPress website’s analytics—and you’re not comfortable handing over your data to big tech companies—then you may want to use Matomo.

Matomo is a powerful, privacy-focused analytics platform that provides the insights you need to grow your business while giving you full ownership of your data.

It’s a great option if you’re concerned about data privacy regulations like GDPR or just tired of sharing your visitors’ data with third parties. Plus, you can connect it with your WordPress website in just a few clicks.

In this guide, we’ll show you how to easily set up Matomo analytics on your WordPress website.

How to Set Up Matomo Analytics in WordPress

But before we begin the tutorial, we’ll cover the basics so you know exactly what you’re getting into.

If you’re already confident about your decision to use Matomo analytics with WordPress, then feel free to use the jump links below to skip ahead:

What Is Matomo Analytics?

Matomo is an open-source platform for tracking website traffic, user behavior, and more. It’s similar to Google Analytics, but it prioritizes privacy for both website owners and visitors.

How does it do that?

The answer is simple – with Matomo, you own all your data, it lives on either your own server or in the cloud, and you get complete control.

Matomo's homepage

So, what can Matomo help you track?

Here are some of the most essential tracking features:

  • Campaign Tracking – Track where your visitors come from using UTM tags, which are perfect for measuring ads, social media posts, and email campaigns.
  • User ID Tracking – See how logged-in users move across devices and sessions, giving you a clearer view of their journey.
  • eCommerce Tracking – Monitor sales, cart behavior, and product views to optimize your WooCommerce or online store.
  • Form Analytics – Find out where visitors struggle with forms so you can improve sign-ups and conversions.
  • Heatmaps & Session Recording – See where users click, scroll, and drop off with visual heatmaps and session replays.

Since Matomo lets you do all of this while giving you the added bonus of data protection, lots of people are making the switch from other analytics solutions.

If you’re one of those people and you’re thinking of switching from Google Analytics, keep reading to learn the differences.

Matomo vs. Google Analytics

When it comes to choosing between Matomo and Google Analytics, it’s all about which platform best fits your needs.

🔒 If keeping your data private is a top priority, then Matomo is the way to go. It’s an open-source platform that lets you host data on your own servers, giving you full control and helping with privacy compliance.

On the flip side, Google Analytics stores your data on Google’s servers, which might be a concern if you’re worried about data privacy.

📊 In terms of analytics features, both Matomo and Google Analytics offer a wide range of tools, including real-time data and visitor tracking.

Matomo provides extras like heatmaps and session recordings, though these require a premium plan.

Matomo heatmaps

Google Analytics, on the other hand, integrates seamlessly with other Google services, like Google Ads, Google Search Console, and Google Tag Manager. This can be super helpful if you’re already using these services.

It’s also a better option for advanced analytics and reporting, including custom funnels and predictive analytics. Plus, since Google Analytics is so popular, there is a large community of users and documentation if you run into any problems.

💸 In terms of costs, Google Analytics offers a free version packed with features. Meanwhile, its premium counterpart, Google Analytics 360, has a higher price tag.

Matomo offers flexibility with a free, on-premise version and a paid cloud-hosted option. This way, you can choose what suits your budget and hosting preferences.

Note: If you’re still undecided whether Matomo is right for you, we personally recommend Google Analytics. We use it across our own business because it comes with highly detailed reports that help us improve our marketing strategies.

Since the Google Analytics interface can be tricky to navigate, we suggest installing MonsterInsights. This beginner-friendly WordPress plugin turns your Google Analytics data into easy-to-understand reports and charts right inside your WordPress dashboard.

For details on how to get started, just check out our guide on how to install Google Analytics in WordPress.

How to Set Up Matomo Analytics in WordPress

Ready to set up Matomo? Let’s do a quick system check first!

Your WordPress website needs to be running WordPress version 4.8 or higher, along with PHP 7.2 or above. Plus, you’ll want MySQL 5.5 or greater, and we recommend having at least 128MB of memory available.

As you browse the WordPress plugin repository, you’ll notice loads of Matomo plugins.

For this guide, we’re going to use Matomo for WordPress. It’s an all-in-one solution that runs directly on your WordPress site. This way, you won’t need to create an external account or manage separate servers.

Matomo Analytics

It’s the easiest way to get started, especially if you’re new to this. It’s maintained directly by the Matomo team, so you’ll get top-notch support and the latest features.

In the following sections, we’ll show you how to set up Matomo in WordPress.

Step 1: Installing the Matomo for WordPress Plugin

The first step is to install and activate the Matomo for WordPress plugin. Go to Plugins » Add New Plugin in your WordPress dashboard.

The Add New Plugin submenu under Plugins in the WordPress admin area

On the next screen, you can use the search feature to quickly find the plugin. Simply type in ‘Matomo for WordPress’ and hit enter.

Once you have the result, you can go ahead and click the ‘Install Now’ button.

Instaling Matomo Analytics

Then, you’ll need to click the ‘Activate’ button.

For more detailed instructions, you can check out our guide on how to install a WordPress plugin.

Step 2: Enabling Matomo Tracking on Your WordPress Site

Once you activate Matomo, you’ll be redirected to the Matomo Analytics » Get Started page.

From there, follow the setup wizard to configure the basic settings. You’ll need to complete 2 steps: updating your privacy policy page and enabling Matomo Analytics tracking. The plugin will then save and apply your new settings.

Now, let’s go through each step individually.

Update Your Privacy Policy

The first step is to update your Privacy Policy page.

Here, Matomo asks you to make sure that your Privacy Policy page reflects a commitment to user privacy and compliance with regulations like GDPR and ePrivacy.

This means including an option for users to opt out of tracking, which you can add using the [matomo_opt_out] shortcode or the ‘Matomo opt-out’ block.

Getting started with Matomo Analytics

⚠️ So, if you don’t have a ‘Privacy Policy’ page yet, then you’ll need to create one.

Simply head over to your WordPress dashboard and navigate to Settings » Privacy.

In the dropdown menu, WordPress will tell you if it already has a privacy policy page in place for you. You can simply click on the ‘Use This Page’ button to make it live.

Privacy page in WordPress settings

If you’d like to draft a new one, all you have to do is click on the ‘Create’ button.

WordPress will then create a draft for you.

On the other hand, if you already used this default and want to make adjustments, just click on the ‘Edit’ button.

Editing privacy policy

This will open your Privacy Policy page in the block editor, ready for you to edit.

For details, see our guide on how to add a privacy policy in WordPress.

Expert Tip: Looking to improve your website’s privacy? WPConsent is a beginner-friendly WordPress plugin that helps you easily set up cookie banners, record user consent, and manage user privacy across your WordPress website. You can also get started with the free version of WPConsent.

Enable Matomo Tracking

After updating your privacy policy, you should be ready to enable Matomo tracking on your WordPress site.

On the ‘Get Started’ page, go ahead and click the ‘Enable tracking now’ button to start the process.

Enable Matomo tracking

Once enabled, you’ll see a green checkmark along with a success notification.

That said, Matomo needs a little time to start collecting data.

Matomo tracking enabled

So, don’t worry if you don’t see analytics right away – you can check back in a few hours to see your first visitor statistics.

⚠️ Note: If you’re using a caching solution (either through a caching plugin or your hosting provider), then you’ll need to clear your cache for tracking to work properly. For details, see our tutorial on how to clear your cache in WordPress.

Step 3: Navigating Through the Analytics Dashboard

Now that you’ve set up Matomo, let’s take a look at the dashboard. This is where you’ll find all the important data about your website, including who’s visiting, what they’re doing, and how your site is performing.

In this section, we’ll go over 3 key areas: Summary, Reporting, and Tag Manager. Each one gives you different insights and tools to help you track your site’s activity.

Summary

The ‘Summary’ section offers a quick overview of your website’s performance directly within your WordPress admin area.

Simply go to Matomo Analytics » Summary to access this report.

Accessing Matomo Analytics Summary from the WordPress dashboard

Once inside the ‘Summary’ page, you can immediately track key visitor metrics like visits, countries, user devices, and user actions.

You can also choose a timeframe that works best for you. It can be today, this week, this month, this year, and so on.

Matomo Analytics summary showing visits-related data

As you scroll down, you’ll see more report widgets.

Some focus on user details, like the devices’ screen resolution, operating system, browser, entry pages, and exit pages. Others are conversion-related, showing data about goals, visits per hour (based on your site’s timezone), and outbound links.

If you run an online store, then you can track its performance in the ‘Ecommerce Orders’ section.

For example, you can see your online store’s general statistics, including total orders, visits with conversions, and purchased products. Plus, there are more specific data points like tax, shipping, and discount calculations.

Matomo's eCommerce report summary

✋ Insider’s Tip: Are you a WooCommerce store owner? You might want to check out our expert picks for the best WooCommerce reporting and analytics plugins.

Reporting

If you’re looking for deeper insights, the ‘Reporting’ section is where you’ll find all the details you need.

To access it, go to your WordPress admin area and navigate to Matomo Analytics » Reporting.

Accessing Matomo Analytics Reports from the WordPress dashboard

This will take you to the full Matomo analytics interface, where you can explore in-depth reports for different parts of your website, including:

  • Visitor data – Get insights into who’s visiting your site and where they’re coming from.
  • User behavior – See how visitors interact with your posts and pages.
  • eCommerce – Monitor sales performance, order tracking, and customer journey.
  • Marketing insights – Analyze acquisitions, conversion goals, sales funnels, and form tracking.
  • Media performance – Measure engagement with images, videos, and other media content.
  • A/B testsCompare different page versions to optimize performance.
  • Heatmaps and session recordings – Visualize how users navigate your site.

Each one has its own dedicated panel that you can explore.

Matomo's reporting dashboard

For example, in the image below, the submenus are under the ‘Visitors’ section alone.

This page has detailed visit logs with real-time flows and maps. It also gives you insights into user locations, devices, software, IDs, and more.

Matomo's Visitors reporting page

This detailed analysis can help you make informed decisions to boost your site’s effectiveness.

Tag Manager

Matomo comes with its own tag manager.

Similar to Google Tag Manager, it simplifies the process of adding and managing tracking codes to your WordPress website. It allows you to set up analytics scripts and ad pixels on your site without touching a single line of code.

But Matomo’s Tag Manager takes this a step further by allowing you to setup and oversee multiple analytics and marketing tools from a single, centralized platform.

It also makes it easy to embed both first- and third-party application resources.

To access the ‘Tag Manager’ reports, simply go to Matomo Analytics » Tag Manager in your WordPress admin area.

Accessing Matomo Analytics Tag Manager reports from the WordPress dashboard

This will take you to the ‘Tag Manager’ tab in your Matomo dashboard.

Once inside, you can switch between containers using the dropdown menu. Containers are collections of tags, triggers, and variables that help you organize and manage your tracking setup efficiently.

Matomo's Tag Manager tab

Matomo Alternatives: Top Analytics Plugins for WordPress Users

Matomo can be a great solution if privacy is your top priority. But if you’re looking for other analytics platforms, then here are some of our recommendations for Matomo alternatives:

  • MonsterInsights – The best Google analytics plugin for WordPress. It focuses on simplicity and is ideal for beginners who want easy-to-read Google Analytics reports directly in their WordPress dashboard. We use it ourselves to track conversions, referrals, and more. See our detailed MonsterInsights review for more details about our experience.
  • ExactMetrics – This plugin offers more detailed Google Analytics reports, catering to users who need in-depth insights without leaving WordPress. We’ve tested this tool extensively for our complete ExactMetrics review.
  • OnePageGA – This beginner-friendly tool turns all your Google Analytics 4 data into a one-page analytics dashboard. It’s ideal for users who prefer a simple setup without extensive features. Learn more in our full OnePageGA review.
  • HubSpot – An all-in-one CRM platform with built-in analytics to track website traffic, user behavior, and conversions. See our article on how to set up HubSpot analytics in WordPress for more details.

For a more extensive list of analytics solutions tailored for WordPress users, you might want to see our list of the best analytics solutions for WordPress users.

You may also wish to check out our ultimate WordPress security guide to protect your website and visitor data. 🔒 

We hope this article has helped you set up Matomo on your WordPress website. Next up, you can head over to our guide on how to see search analytics in WordPress and our expert picks of the best WordPress activity log and tracking plugins.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Setup Matomo Analytics in WordPress (The Easy Way) first appeared on WPBeginner.

]]>
https://www.wpbeginner.com/wp-tutorials/how-to-setup-matomo-analytics-in-wordpress/feed/ 0
How to Stop WordPress Redirecting to Spam Websites (Quick Fix) https://www.wpbeginner.com/wp-tutorials/how-to-stop-wordpress-redirecting-to-spam-websites/ https://www.wpbeginner.com/wp-tutorials/how-to-stop-wordpress-redirecting-to-spam-websites/#comments Thu, 13 Mar 2025 10:00:00 +0000 https://www.wpbeginner.com/?p=333089 Imagine this: You’re trying to check your WordPress website when, suddenly, you’re taken away to a suspicious gambling site or a sketchy pharmaceutical page. Your heart sinks as you realize your site’s been hacked. 😱 We know exactly how terrifying and frustrating this situation can… Read More »

The post How to Stop WordPress Redirecting to Spam Websites (Quick Fix) first appeared on WPBeginner.

]]>
Imagine this: You’re trying to check your WordPress website when, suddenly, you’re taken away to a suspicious gambling site or a sketchy pharmaceutical page.

Your heart sinks as you realize your site’s been hacked. 😱

We know exactly how terrifying and frustrating this situation can be. But first, take a deep breath.

Your website can be saved, and we’re here to guide you through every step of the recovery process. Whether your visitors are seeing spam redirects or you’re getting that dreaded “This site may be hacked” warning from Google, we’ve got you covered.

In this article, we’ll show you two proven ways to stop WordPress redirecting to spam websites.

Fixing WordPress spam website redirects issue

Why Is My WordPress Site Redirecting to Spam?

Spam redirects happen when hackers inject malicious code into your WordPress site. This code then sends visitors to unwanted websites filled with ads, phishing scams, or malware.

Hackers can use different methods to gain access to your site, including:

  • Infected Plugins & Themes: Plugins and themes downloaded from unauthorized sources (nulled WordPress themes and plugins) are a common cause of malware and spam redirects.
  • Weak Passwords: Attackers can guess or steal weak admin passwords to take control of your site and insert malicious code that redirects users to spam sites.
  • Unpatched Security Holes: If your WordPress core, plugins, or themes are outdated, then hackers can exploit known vulnerabilities to add malicious code.
  • Hidden Backdoors: Even after removing visible malware, hackers sometimes leave hidden access points to reinfect your site later. These are called backdoors.

Many website owners don’t realize their site has been hacked until visitors start complaining or search engines issue a warning. The sooner you act, the less damage it will cause.

We will cover 2 methods in this article, and feel free to use the jump links below to go to the method you want to use:

Let’s begin with our recommended solution because it is easier for beginners, non-tech users, and small business owners.

When your site’s been compromised, time is of the essence. Every minute your website redirects to spam websites could mean lost visitors, damaged reputation, and potential Google penalties.

That’s why many site owners choose a professional repair service – it’s the fastest, safest way to get back online.

The Expert Solution:

For most WordPress users, the easiest way to clean spam redirects is by using our professional Hacked Site Repair Service.

WPBeginner Pro Services Hacked Site Repair

For a one-time (non-recurring) fee, our team of WordPress security experts will clean your website and remove the malicious code redirecting to spam sites.

Our Hacked Site Repair Service offers several key benefits:

  • Expert technicians who have handled thousands of hacked sites
  • Emergency response & timely fixes
  • Complete malware removal and security hardening
  • Post-cleanup backup of your website
  • No risk of accidentally damaging your site

The best part is that you get a 30-day guarantee and a full refund if we are unable to fix your WordPress website.

👉 Ready for expert help? Just visit our Hacked Site Repair Service page to get started.

Method 2: Fix WordPress Spam Site Redirects Manually (DIY Users)

If you’re comfortable with WordPress and prefer to handle things yourself, then we’ve created a comprehensive step-by-step guide.

We’ll walk you through each part of the cleanup process, explaining what to do and why it matters.

⚠️ Caution: While DIY fixes are possible, they can be risky if you’re not familiar with WordPress security. One wrong move could make the problem worse or lead to data loss.

ℹ️ Important: Create a Backup Restore Point

Before starting any repairs, make sure you have a recent backup of your site. If something goes wrong, then you’ll want a restoration point.

We recommend using Duplicator, which easily backs up and restores your website. We use it across our business, and it has been a game-changer for our secure backup needs. For more details, check out our complete Duplicator review.

Duplicator

Note: A free version of Duplicator is also available. You can give it a try, but we recommend upgrading to a paid plan, which offers more features.

Now that you have prepared your website for repairs, let’s start fixing spam redirects.

Step 1: Scan Your Website for Malware

Think of malware scanning like using a metal detector at the beach – it helps you find hidden threats buried in your site’s files.

Our experience shows that spam redirects often hide in unexpected places, making a thorough scan essential.

Luckily, there are excellent WordPress security plugins available that you can use to scan your website.

Here’s how to run an effective malware scan.

First, you need to install a trusted security plugin (like Sucuri Security or Wordfence). For the sake of this article, we will show you how to run a scan in Wordfence, but the instructions work the same regardless of which security plugin you are using.

First, you will need to install the security plugin of your choice. For details, see our guide on how to install a WordPress plugin.

Start new scan

Next, under the plugin menu, navigate to the Scan section and run a comprehensive site scan. It can take some time to complete the scan depending on how much data and files you have stored.

Once that’s finished, you will see the scan results.

Review the results carefully and look for severe, critical, and other issues. You can click on an issue to view its details.

Here, most security plugins will also provide you with instructions on how to address that issue.

Security actions

WordPress security scanners are quite good at catching some of the most notorious malware and redirect hacks. Hopefully, they will be able to find the code responsible for spam redirects.

💡 Pro tip: Don’t rely on just one scanner. Different security tools can catch different types of malware. We recommend using at least two different scanning solutions.

Step 2: Check for Suspicious Admin Users

Hackers often create hidden administrator accounts to maintain access to your site. These accounts might have innocent-looking usernames or be disguised as system accounts.

We’ve seen cases where hackers created a single cleverly disguised admin user account. We have also seen cases where the malware created dozens of admin accounts.

Just follow these steps to identify and remove suspicious users.

Go to the Users » All Users page in your WordPress admin dashboard.

View all users

Here, you need to look for accounts you don’t recognize. These could be accounts with random numbers or strange usernames or accounts pretending to be system accounts.

Next, it’s time to remove any suspicious accounts immediately by clicking ‘Delete’ under that account.

Delete suspicious accounts

⚠️ Warning: Some hackers name their accounts after common WordPress roles like “admin_support” or “wp_maintenance”. Be extra vigilant with system-looking usernames.

Once you have reviewed and deleted suspicious user accounts, you can move on to the next step.

Step 3: Replace Hacked WordPress Files

Just like replacing a virus-infected hard drive with a clean one, we need to restore clean versions of core WordPress files.

Don’t worry – this won’t affect any of your website content, images, themes, or plugins.

Here’s our tested process for safe file replacement.

First, you need to download a fresh copy of WordPress from WordPress.org and unzip the file on your computer.

Download WordPress

Next, connect to your site using an FTP client or File Manager app in cPanel and navigate to the WordPress root folder.

This is the folder where you will be able to see the wp-admin, wp-includes, and wp-content folders.

WordPress root folder

Now, go ahead and delete the existing wp-admin and wp-includes folders.

Once they are deleted, you need to upload the clean versions from your computer.

Upload core folders

After replacing the main folders, you need to replace all core files in the root directory. This includes files like wp-activate.php, wp-blog-header.php, wp-comments-post.php, wp-config-sample.php, and more.

When prompted, select ‘Overwrite’ to replace old files with the new version.

Next, you need to download the wp-config.php file to your computer as a backup and delete the .htaccess file from your root folder. Don’t worry because WordPress will automatically regenerate the .htaccess file for you.

Download wp-config.php

Now, you have to rename the wp-config-sample.php file to wp-config.php and then right-click to ‘Edit’ it. The file will open in a text editor like Notepad or TextEdit.

Carefully fill in the values for the database connection. You can see the old wp-config.php file that you downloaded in the earlier step to find out your WordPress database, table prefix, username, password, and hostname.

For more details, see our guide on editing the wp-config.php file.

Once you have finished replacing the old core files with fresh copies, don’t forget to visit your website and admin dashboard to make sure everything is working as expected.

After that, you can move on to the next step.

Step 4: Remove Malicious Code from Theme & Plugin Files

One of the common sources of malware is nulled plugins and themes. These are pirated copies of premium WordPress plugins and themes downloaded from unauthorized sources.

Hackers love hiding malicious code in theme and plugin files. They often inject their spam links and redirects into legitimate files, making them harder to spot. But don’t worry – we’ll show you exactly what to look for.

⚠️Warning: Most WordPress theme and plugin settings are stored in the database and will remain there even if you delete those files. However, sometimes, you may lose settings or custom changes you made to those files. In that case, you will need to manually restore those changes.

Just follow this process to clean your plugin and theme files.

First, you need to download fresh copies of all your themes and plugins from trustworthy sources. For free themes and plugins, the trusted source is the WordPress.org website itself. For premium themes and plugins, you will want to download them from official websites.

Once you have downloaded all the plugins and theme files, connect to your website using an FTP client and navigate to the wp-content folder.

Now, you need to delete the themes and plugins folders from your website. Once they are deleted, create new directories and name them ‘themes’ and ‘plugins’. You will now have empty themes and plugins folders on your website.

Delete plugins and themes folder

You can now start uploading the theme and plugin files you downloaded earlier. You will need to unzip each downloaded file before you can upload them to your website.

Once you have uploaded all the files, go to your WordPress admin area in the browser and activate the theme and plugins you were using before. If you see an error, then you may need to try uploading that particular theme or plugin file again.

Replacing theme and plugin files with newer versions downloaded from authentic sources will clean them.

Hopefully, by now, your website will be clean of any spam redirects. However, to ensure your website remains secure, you will need to tighten its security.

Step 6: Securing WordPress After Cleaning Up Spam Redirects

Security is not a one-time thing. Instead, it is an ongoing process.

Now that you have cleaned and fixed the spam redirects, the next step is to ensure your website remains clean going forward.

To do that, you need to perform some additional security hardening on your website.

1. Change All Website Passwords

Passwords play an important role in WordPress security. If you believe your website was hacked, then you need to immediately change all your passwords related to your website.

This includes the following:

  • All user accounts on your WordPress website. See our guide on changing passwords for all users in WordPress.
  • Passwords for all FTP accounts on your website. You can find FTP accounts in your WordPress hosting control panel, and you can manage their passwords there.
  • Passwords for your WordPress database username. You can find MySQL users in your hosting account control panel under the Database section. You must update the password for the database username in your wp-config.php file as well. Otherwise, your website will start showing the error connecting to the database error.

💡Pro Tip: Always use stronger passwords and a password manager app like 1Password to store all your passwords.

2. Install a Security Plugin and a WordPress Firewall

Now that we’ve cleaned up the hack, it’s time to strengthen your site against future attacks. Think of this step as installing a high-tech security system for your WordPress site.

Here’s our recommended security setup:

  • Install a WordPress security plugin like Sucuri or Wordfence (both have excellent free versions).
  • Set up a WordPress firewall that runs on the cloud. We recommend using the Cloudflare free CDN, which automatically blocks any suspicious activity even before it reaches your website.

We use Cloudflare on WPBeginner. You can read about our experience in our case study on switching to Cloudflare.

The combination of a WordPress security plugin that runs on your website and a cloud-based firewall strengthens your WordPress security to a professional level. It is capable of blocking the most common malware, DDoS attacks, and brute force hacking attempts.

Bonus Tips: Prevent Future WordPress Hacks

The best way to deal with hacks is to prevent them from happening in the first place. After helping countless users recover their sites, we’ve developed a solid prevention strategy.

You can read them all in our complete WordPress security handbook. It is a step-by-step security setup we use on all our websites, written specifically for beginners and small businesses.

Here are our top security practices:

These tips are quick and easy to implement. They will protect you from malicious spam URL redirect attacks in the future.

Final Words: Securing WordPress From Spam Redirects and Malware

Dealing with spam redirects can be scary, but you’ve now got all the tools and knowledge needed to fix your site.

Whether you choose our Hacked Site Repair service (Recommended) or follow the DIY guide, you’re taking the right steps to secure your WordPress website.

Remember, security isn’t a one-time fix – it’s an ongoing process. By using the prevention tips we’ve shared, you’ll be much better protected against future attacks. 💪

You may also wish to read our article on how to tell if a WordPress security email is real or fake or how to secure WordPress multisite.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Stop WordPress Redirecting to Spam Websites (Quick Fix) first appeared on WPBeginner.

]]>
https://www.wpbeginner.com/wp-tutorials/how-to-stop-wordpress-redirecting-to-spam-websites/feed/ 3
How to Setup HubSpot Analytics in WordPress (The Easy Way) https://www.wpbeginner.com/wp-tutorials/how-to-setup-hubspot-analytics-in-wordpress-the-easy-way/ https://www.wpbeginner.com/wp-tutorials/how-to-setup-hubspot-analytics-in-wordpress-the-easy-way/#respond Wed, 12 Mar 2025 10:00:00 +0000 https://www.wpbeginner.com/?p=330036 Are you looking to add powerful HubSpot analytics tracking to your WordPress website? Understanding your visitors’ behavior and tracking conversions are important for making data-driven decisions that help you grow your business. Without proper analytics, you’re essentially running your website blind – missing out on… Read More »

The post How to Setup HubSpot Analytics in WordPress (The Easy Way) first appeared on WPBeginner.

]]>
Are you looking to add powerful HubSpot analytics tracking to your WordPress website? Understanding your visitors’ behavior and tracking conversions are important for making data-driven decisions that help you grow your business.

Without proper analytics, you’re essentially running your website blind – missing out on valuable insights about your marketing efforts, user engagement, and conversion opportunities.

Plus, incorrectly setting up analytics can lead to inaccurate data and flawed business decisions.

In this step-by-step guide, we’ll show you how to properly set up HubSpot analytics in WordPress. You’ll learn how to track the right metrics, set up conversion goals, and integrate with your HubSpot CRM – all without touching a single line of code.

Set Up HubSpot Analytics in WordPress

Why Connect WordPress to HubSpot Analytics?

Whether you run a WordPress blog, an online store, or a service-based website, HubSpot insights and analytics data can help you make smarter business decisions.

Once you connect WordPress to HubSpot, you’ll be able to:

  • See traffic sources, pageviews, keyword rankings, and more.
  • Send leads directly to the HubSpot CRM so that you can track customer data there.
  • Track form submissions to identify drop-off points and reduce form abandonment.
  • Optimize email campaigns for better open and click-through rates.
  • Use live chat to assist visitors in real time and improve customer experience.
  • Monitor sales and payments to refine your eCommerce strategy.

Best of all, this data integrates seamlessly with your existing HubSpot analytics. You’ll get a complete picture of how visitors interact with your WordPress website alongside your other marketing metrics.

This means you can make better decisions about your content, optimize your sales funnels, and improve user experience – all from the familiar HubSpot dashboard.

💡 Insider Tip: While HubSpot Analytics is powerful, we usually recommend that our readers use Google Analytics instead. It’s a free analytics platform that gives you access to a wide range of data for understanding more about your visitors.

Plus, it’s super easy to use Google Analytics by installing MonsterInsights. It creates user-friendly reports about visitor behavior, plus advanced tracking for eCommerce, forms, and affiliate links directly in your WordPress dashboard.

We use this setup ourselves because it provides deep data insights in beginner-friendly charts. Just check out our full MonsterInsights review to see all the benefits.

With that said, we’ll show you how to set up HubSpot analytics on WordPress. Here’s a quick look at all the steps you’ll take:

Ready? Let’s jump right in!

Step 1: Sign Up for a HubSpot Account

First, you’ll need to sign up for an account on the HubSpot website. Just click on the ‘Get started free’ button.

HubSpot CMS landing page

HubSpot will now ask you to create an account using your email address, Google account, Microsoft account, or Apple account.

In the following popups, you’ll be asked to provide some details about your business, such as your company name, industry, size, and more.

You can just fill in the required fields and then click ‘Next’ to continue.

Adding company name

Just follow the onscreen onboarding to sign up for an account.

Keep in mind that HubSpot offers a free plan that includes lead generation forms, limited email marketing features, web analytics, live chat, and other free features that have HubSpot branding on them.

Upgrading to a paid plan will give you access to more features like marketing automation, the removal of HubSpot branding, and higher limits for email marketing.

Step 2: Install and Activate the HubSpot WordPress Plugin

To allow HubSpot to track analytics on your WordPress website, you’ll need to connect the services with a tracking code. Luckily, the free HubSpot All-In-One Marketing plugin automatically installs the tracking codes for you.

This means that once you’ve set up your, let’s say, email marketing campaign, HubSpot will automatically assign tracking codes. These codes help monitor user interactions, email engagement, and conversion rates.

The first step here is to install and activate the HubSpot All-In-One Marketing plugin.

HubSpot plugin

To do this, you’ll need to navigate to Plugins » Add New Plugin from the WordPress dashboard. Then, you can use the search feature to look for the HubSpot CRM plugin.

After that, just click ‘Install Now’ on the search result, then ‘Activate.’

Installing HubSpot in WordPress

For step-by-step instructions, you can check out our guide on how to install a WordPress plugin.

Add Tracking Code Manually

Can’t install the HubSpot plugin? This might happen due to compatibility issues, plugin conflicts, or restrictions on your WordPress hosting.

If this happens to you, then you’ll need to add the tracking code manually.

You need to go to ‘Settings’ from your HubSpot dashboard. Just click on the gear icon in the menu bar.

Under ‘Account Managements,’ you’ll need to find the ‘Tracking Code’ option.

Locating the Tracking Code menu

On the right-hand panel, you can click ‘Set up tracking by embedding code’ to expand the section.

From here, you can go ahead and click the ‘Copy’ button.

Copying HubSpot tracking code

Now, you can use this tracking code before the closing tag on every page of your website.

Alternatively, you can add the code across all pages through the common footer file in your theme files. However, modifying theme files is not very beginner-friendly – one tiny mistake can break your WordPress website.

This is why we always recommend using the WPCode plugin, which is the best code snippet plugin on the market. It allows you to add custom code in WordPress without the risk of breaking your site.

WPCode's homepage

We use WPCode across our partner websites to create and manage custom code snippets easily. If you’re interested in learning more, check out our detailed WPCode review.

So, let’s go ahead and install and activate the WPCode plugin. If you need help, you can read our guide on how to install a WordPress plugin.

💡 Note: You can use the free WPCode version to do this, but upgrading to WPCode Pro gives you access to full code history, the ability to schedule your code, and more!

Upon activation, simply head over to Code Snippets » Header & Footer. Then, you can paste your HubSpot tracking code into the ‘Footer’ field.

Adding HubSpot tracking code to site's footer using WPCode

Go ahead and click ‘Save Changes’ to complete the process.

Step 2: Connect Your HubSpot Account to Your WordPress Website

After activating the HubSpot plugin, you will be prompted to connect it to your WordPress website.

If you’re new to HubSpot, you can choose a sign-up method with Google, Microsoft, or Apple. If you already have an account, simply enter your email address and click ‘Verify email.’

In this tutorial, we’ll walk through the HubSpot sign-up and setup process.

On the HubSpot page in your WordPress dashboard, we’ll select the ‘Sign up with Google’ option, for example.

Signing in or logging in to HubSpot

HubSpot will then confirm your Google account and request permission to access your basic profile details.

Once you’ve gone through the setup wizard, you’ll be redirected to the WordPress admin area.

Here, you’ll find the ‘Connect website’ button. Just click on it to finish the sign-up process.

The Connect Website button

After that, a welcome popup will appear.

You can choose to ‘Get started’ right away or click the ‘Learn more’ button to access the tool’s documentation.

We’ll explore the HubSpot plugin’s features in a minute, so you can go ahead and click ‘Get Started.’

HubSpot welcome message after completing setup

You might notice that all the HubSpot menus are now unlocked.

In the ‘User Guide’ panel, you’ll see that one of the five setup tasks is already checked off.

Simply complete the remaining tasks one by one, or skip any that aren’t relevant.

HubSpot's setup prompt

For example, let’s try importing user contacts to HubSpot.

You can click on the ‘Import your contacts’ accordion menu to expand it, then select ‘Import contacts.’

Importing contacts in HubSpot

A new tab will open for uploading your contacts. Here, you’ll see that HubSpot supports file types such as .csv, .xlsx, and .xls.

Simply click ‘Choose a file’ or drag and drop it from your computer.

Importing users' contacts

You can also upload a .csv file to add your team members. But if you have a smaller team, you may not have it.

Luckily, HubSpot allows you to easily add team members by entering their email addresses.

Importing teams' emails

Now, you can choose to complete all the steps, including taking courses in the HubSpot Academy. These courses will help you understand the benefits of installing the HubSpot WordPress plugin and explore practical use cases.

You can also purchase additional tools from the HubSpot App Marketplace to connect with your favorite tools, such as Google Ads, WooCommerce, and Constant Contact.

HubSpot App Marketplace

You are now ready to use HubSpot analytics to grow your WordPress site!

Step 3: Explore the HubSpot Analytics Features

With HubSpot connected to WordPress, you’ll now be able to track the performance of your marketing campaigns from your HubSpot dashboard. From automation to customer engagement, you have all the insights you need to grow your business.

Now, we’ll show you what you can monitor and how to access these reports.

Generally, you can head over to HubSpot » Reporting to view any of these reports. This will open the HubSpot dashboard in a new tab for you.

The HubSpot Reporting menu in the WordPress admin area

From here, you can set up custom reports.

Just click on the ‘Create report’ button at the top.

HubSpot add report

For example, HubSpot has a library of analytics reports that you can select, including:

  • Page views and bounce rate
  • Sessions and traffic sources
  • Visitor engagement rates
HubSpot reports

Simply click to add the reports you want, and HubSpot will start collecting data from your WordPress website.

Popups Reporting Dashboard

HubSpot lets you design custom popups and slide-ins that engage users at the perfect moment.

Here are some use cases for popups for more inspiration:

✍️ Showing a registration form to visitors before they leave your site.

🏷️ Display discounts or limited-time deals to boost conversions.

🔖 Suggest relevant content or product recommendations based on behavior.

💬 Use quick surveys to gather insights about user experience.

To keep track of how your popups perform, you can navigate to HubSpot » Reporting from your WordPress dashboard.

The HubSpot Reporting menu in the WordPress admin area

This will redirect you to your HubSpot account.

From here, you can head over to Reporting » Dashboards.

Accessing the HubSopt reporting dashboard

Next, simply click on the dropdown to expand it and choose ‘Marketing Channel Performance’ analytics.

And that’s it! You’ll find the dedicated section for tracking form submissions:

Tracking form submissions on HubSpot

Live Chat Reporting Dashboard

Live chat is a great way to connect your website visitors with your team in real time. When you set it up on HubSpot, a chat widget will appear on your site. It allows visitors to click to start a conversation with someone from your team.

In addition to greeting visitors and offering assistance, here are some other live chat use cases for inspiration:

  • 🛒 Set up live chat on your sales page that connects visitors directly to your team.
  • 🎯 Use live chat on your landing pages to engage potential leads and provide personalized assistance.
  • 📈 Add live chat on your pricing page to address any questions visitors might have about pricing or features before making a decision.
  • 📑 Offer another live chat option to your knowledge base articles to assist with support questions.

You can track how your live chat performs by going to HubSpot » Reporting from your WordPress dashboard.

The HubSpot Reporting menu in the WordPress admin area

You’ll then be redirected to your HubSpot account in a new tab.

The next step is to click on ‘Reporting’ and once again on ‘Dashboards.’

Accessing the HubSopt reporting dashboard

Go ahead and click on the ‘Chat Overview’ option from the dropdown.

Here, you can track key metrics to review chat performance and team efficiency:

  • Chat conversation totals by rep – See how many chat conversations each team member has handled.
  • Chat conversation totals by URL – Identify which landing pages generate the most chat interactions.
  • Chat conversation average first response time by rep – Track how quickly each team member responds to incoming chat messages.
  • Chat conversation average time to close by rep – Measure how long it takes each team member to resolve a chat conversation.
  • Chat conversation close totals by rep – View the total number of chat conversations successfully closed by each team member.
Chat overview dashboard

Email Overview Dashboard

HubSpot’s email marketing tool allows you to create and send different types of emails to your audience.

For example, you can:

  • 📧 Send one-time campaigns to specific groups of contacts, which is perfect for announcements or promotions.
  • 🔄 Set up automated emails when contacts take certain actions, like filling out a form.
  • 📝 Keep subscribers engaged by automatically sending them your new blog posts.

To see how your email newsletter performs, you can go to HubSpot » Reporting from your WordPress dashboard.

The HubSpot Reporting menu in the WordPress admin area

This will open your HubSpot account in a new tab.

From here, you can navigate to Reporting » Dashboard.

Accessing the HubSopt reporting dashboard

Next, you’ll want to click ‘Email Overview’ from the dropdown.

Once inside, you can track key metrics to measure team performance and response times:

  • Email conversation totals by rep – See the number of email conversations handled by each team member or customer service representative.
  • Email average first response by rep – Track how quickly each rep responds to incoming emails.
  • Email closed totals by rep – View the total number of email conversations successfully resolved by each rep.
  • Email average time to close by rep – Measure how long it takes each rep to close an email conversation.

eCommerce Analytics Dashboard

HubSpot’s Commerce Hub makes it easy to collect payments and track revenue. Whether you’re selling one-time products, subscriptions, or even on a free HubSpot plan, you can:

💳 Use payment links to collect one-time or recurring payments.

📠 Track payments in your CRM, just like contacts and deals.

💭 Create branded quotes or bill customers with invoices.

To access the commerce analytics, you can first navigate to HubSpot » Reporting from your WordPress dashboard.

This will open your HubSpot account in a new tab.

The HubSpot Reporting menu in the WordPress admin area

From here, let’s click ‘Commerce.’

Then, you can select the ‘Overview’ menu.

Finding the Commerce Overview in HubSpot

In the ‘Commerce Overview’ analytics section, you’ll find:

  • Total payment volume by month – See how much revenue you’ve collected each month to spot trends and seasonality in sales.
  • Paying customers by month – Monitor the number of unique customers making purchases each month to gauge customer loyalty and acquisition.
  • Total payment volume by quarter – Get a broader view of your sales performance over three-month periods.
  • Total payment volume by year – Review annual revenue to assess long-term growth and make informed business decisions.
Commerce Hub analytics in HubSpot

Step 4: Monitor and Analyze Your HubSpot CRM Regularly

Now that you know where to access your analytics, you’ll want to keep an eye on your results.

By regularly reviewing your data, you can make adjustments to your strategy. For example, you can look at your campaign performance metrics, like click-through rates and conversion rates.

If certain campaigns aren’t performing as expected, then you might need to adjust your messaging or call-to-action to make them more effective.

You can also evaluate how well your email newsletter, ads, or social media posts connect with your audience.

Doing A/B testing is an easy way to see what gets the best response. Then, simply adjust your strategy to build stronger connections. For details, you can check out our guide on how to do A/B split testing in WordPress.

Bonus Tip: Boost Your Website Performance with HubSpot Alternatives

HubSpot is a solid platform, but it’s not the best fit for all WordPress users. A lot of its features work best when you’re all-in on its ecosystem, which can feel a bit limiting.

Another downside to HubSpot is that its SEO tools are only available on paid plans.

If you pay, you will have access to powerful SEO audits, keyword tracking, and optimization suggestions. However, it also means that if you’re on a free plan, you’ll miss out on these features.

For now, if SEO is a key focus for your website, you might need to consider upgrading to unlock these valuable tools. If you’re just starting out, though, you can check out our ultimate WordPress SEO guide for beginners.

There are also plenty of other HubSpot alternatives for WordPress websites, depending on what you’re trying to achieve:

  • MonsterInsights – MonsterInsights is the best analytics plugin for WordPress, and it brings all your Google Analytics data right into the WordPress dashboard. It also provides advanced tracking for online stores, affiliate marketing links, digital downloads, and more.
  • Constant Contact – If you’re looking for an email marketing platform, then we recommend Constant Contact. It’s affordable, beginner-friendly, and has all the tools you need to set up email campaigns, segment your audience, and more.
  • OptinMonster – Need more leads? OptinMonster is a powerful lead-generation tool that helps you create high-converting popups, slide-ins, and optin forms to build your email list and boost conversions.
  • AIOSEO – If SEO is your priority, then All in One SEO (AIOSEO) makes it very easy to optimize your site. It provides on-page analysis, keyword research tools, and technical SEO features to improve rankings and drive organic traffic. You can also check out the AIOSEO free version.
  • LiveChat – For real-time customer support, LiveChat allows you to engage visitors instantly. It is an easy-to-use live chat solution that helps boost conversions, answer customer questions, and improve the user experience.

Each of these tools focuses on a specific area, giving you more control and customization for your website.

By choosing the right combination, you can create a streamlined, high-performing site without relying on an all-in-one solution like HubSpot. 🙂‍↕️

For more information, see our expert list of the best HubSpot alternatives.

FAQ About Setting Up HubSpot Analytics

If you’re new to HubSpot or wondering how it fits into your WordPress blog or site, here are answers to some common questions that we get from our readers.

What can I use HubSpot for?

HubSpot is a powerful all-in-one marketing platform. It helps you manage a lot of things, including customer relationships, analytics, and email campaigns. This tool can also help you engage visitors through live chat and forms.

Can I integrate HubSpot with WordPress?

Yes! HubSpot offers a WordPress plugin that seamlessly integrates with your site. This makes it easier to track and manage everything without leaving your dashboard.

How do I set up tracking using the HubSpot WordPress plugin?

Once you install and activate the HubSpot All-In-One Marketing plugin, it automatically adds tracking to your site. You can then access insights like page views, conversions, and user behavior directly in your HubSpot account.

What analytics tools should I use for my WordPress site or blog?

Other than HubSpot, we recommend using MonsterInsights. It’s the best Google Analytics plugin that allows you to gain deeper insights into traffic, engagement, and conversions.

Which plugin is best for WordPress marketing automation?

We recommend Uncanny Automator for WordPress marketing automation. This powerful tool allows you to link all your software and set up automated workflows. For more details, see our guide on how to create automated workflows in WordPress with Uncanny Automator.

We hope this article has helped you set up HubSpot Analytics on your site. Next up, you might want to check out our guide on how to track website visitors or our expert picks of the best analytics solutions for WordPress users.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

The post How to Setup HubSpot Analytics in WordPress (The Easy Way) first appeared on WPBeginner.

]]>
https://www.wpbeginner.com/wp-tutorials/how-to-setup-hubspot-analytics-in-wordpress-the-easy-way/feed/ 0