How to Track User Engagement in WordPress with Google Analytics

Are you properly tracking user engagement on your WordPress site? User engagement is one of the most important metric to track because it helps you strategically plan for growth. In this article, we will show you how to track user engagement in WordPress with Google… Read More »

The post How to Track User Engagement in WordPress with Google Analytics appeared first on WPBeginner.

Are you properly tracking user engagement on your WordPress site? User engagement is one of the most important metric to track because it helps you strategically plan for growth. In this article, we will show you how to track user engagement in WordPress with Google Analytics.

Tracking User Engagement

Why Track User Engagement with Google Analytics

Generally, website owners consider traffic and pageviews as the most important indicators of their website’s performance. They assume that higher traffic will result into more conversions and sales.

While that is true, you can get even better results by tracking and optimizing user engagement.

User engagement shows you what users do when they arrive on your website. It helps you identify patterns of highly engaged user behavior which leads to more conversions and sales.

For example, you may realize that users visiting a specific page are 10X more likely to make a purchase vs any other visitor on your website. You can use this insight to redirect more user’s attention to that page.

To track user engagement on our websites, we use Google Analytics in combination with the popular MonsterInsights plugin.

If you haven’t already signed up for Google Analytics, then you can follow the instructions in our guide on how to install Google Analytics in WordPress.

Next, you need to install and activate the MonsterInsights plugin. We recommend getting the Pro plan of this plugin.

Now most people ask us why install a plugin, when you can just paste the Google Analytics script in the footer of the website.

The reason is that by simply pasting a link in the footer, you miss out on key user engagement data. You won’t know which outbound links are users clicking, which forms have the highest conversions, which products in your online store has the best conversions, which affiliate links or ads are getting the most clicks, etc.

MonsterInsights plugin automatically handles all of that and more for you. It automates the process of pasting different analytics code and event tracking scripts in the footer, so you don’t have to deal with the hassle of code and configuration.

Once you have setup Google Analytics with MonsterInsights, let’s take a look at how to track different user engagement metrics for your site.

1. Tracking Your Most Popular Content

The first thing you want to figure out is which blog posts and pages are the most popular amongst your users? These are the pages and posts on your website getting the most traffic.

Figuring out what your users like on your site can help you plan a content strategy that expands on what’s already working.

MonsterInsights makes it really simple. You just need to visit Insights » Reports page in your WordPress admin area.

You will find your most popular content under the ‘Top posts and pages’ section.

Most popular content

Next to it, you’ll also see your top traffic sources. This gives you a general idea of where your traffic is coming from.

On most websites, 90% of their traffic goes to 10% of the top pages. Once you find these top pages, you can optimize them for maximum conversions by adding content upgrades or targeted lead magnets on these posts.

We find that by adding content upgrades can help you boost your conversions by as high as 845%. Our founder Syed Balkhi has a blog post sharing the case study results.

2. Tracking How Users Engage with Forms on Your Website

Most websites rely on contact forms to collect user leads and feedback. Sadly most contact form plugins don’t give you accurate tracking and conversions data.

MonsterInsights lets you leverage Google Analytics’ events tracking feature to see how many times your forms are viewed and submitted.

To enable forms tracking, you need to visit Insights » Addons page. On this page, you will need to install and activate the Forms addon.

Install Forms Addon for MonsterInsights

Once you have activated the Forms addon, MonsterInsights will automatically start tracking all forms on your website.

It automatically works with popular contact form plugins like WPForms, Ninja Forms, Formidable, and others. MonsterInsights also track your website comment form, user registration forms, and more.

To see how your forms are doing, you will need to visit your Google Analytics account. In the Google Analytics dashboard, click on Behavior » Events » Overview page and then under ‘Event Category’ click on ‘form’.

Form tracking in Google Analytics

Next, you need to click on the ‘Event Label’ to see stats for different forms on your website.

Sort by form label

From there, you can click on any form to see your impressions and conversions.

Form impressions and conversions

3. Tracking Ecommerce Stores in Google Analytics

Google Analytics offer many features specifically for eCommerce websites. However these features are not turned on by default, and most users don’t even know that they exist.

Enhanced Ecommerce tracking lets you see shopping behavior, checkout behavior, product lists performance, sales performance, and so much more. The best part is that you can combine this data with your overall website traffic to gather better insights.

MonsterInsights eCommerce tracking for WordPress works with both WooCommerce and Easy Digital Downloads.

First, you will need to enable eCommerce tracking in Google Analytics. Head over to your Google Analytics account and switch to the admin page.

Google Analytics admin

Next, you need to click on the ‘Ecommerce Settings’.

Ecommerce settings

Now click the slider under the first step, Enable Ecommerce, to turn it on. You need to click on the Next Step button to continue.

Enable eCommerce tracking

We also recommend that you turn on the Enhanced Ecommerce settings.

Enhanced ecommerce

Once you are done, click on the submit button to store your settings.

Next, you need to switch to your WordPress admin area. Go to Insights » Addons page and install and activate the ‘Ecommerce Addon’.

MonsterInsights ecommerce addon

After that you can head over to Insights » Settings page and click on the tracking tab. Next, click on the Ecommerce section to continue.

Enhanced eCommerce tracking

On this tab, you need to check the box next to ‘Use Enhanced eCommerce’ and then click on ‘Save changes’ button to store your settings.

To view your ecommerce tracking reports, you need to visit your Google Analytics account and go to Conversions » Ecommerce page.

Ecommerce tracking

Here are a few powerful reports you get by enabling Enhanced eCommerce tracking on your store:

  • Shopping Behavior
  • Checkout Behavior
  • Product Lists Performance
  • Sales Performance

For more details on each of these reports, see this article on adding Google Analytics enhanced ecommerce to your website.

4. Tracking Who’s Clicking on Your Ads with Google Analytics

Many websites rely on ads to make money online while creating useful content. Advertising platforms like Google AdSense provide you some reports on ad impressions and clicks.

However, with MonsterInsights and Google Analytics you can actually see how users interact with ads on your site. You’ll be able to:

  • Track how many clicks each ad is receiving
  • Discover which ads your audience are ignoring
  • Identify the most effective ad placements
  • And more…

First you will need to visit Insights » Addons page on your WordPress site. Now install and activate the ‘Ads Tracking’ addon.

Ads tracking addon

Next, you need to integrate Google Analytics to your Google Adsense account.

Head over to your Google Analytics dashboard and click on the ‘Admin’ button located at the bottom left corner of the screen.

Switch to the Google Analytics Admin section

On the admin page, click on ‘AdSense linking’ under the property column.

Linking AdSense

Next, you need to click the +New AdSense Link button and then select AdSense property that you want to link with your Analytics property.

Select and link AdSense property

After that, click on the continue button to move forward.

Next, you need to select the Analytics view in which you want your AdSense data to be available. Once you select that click Enable Link and then click Done.

Adsense link setup

After you have configured everything in Google Analytics, you need to head over to your WordPress site and go to Insights » Settings page. Switch to the ‘Tracking’ tab and then click on the Ads section.

You need to Enable Google Adsense tracking in MonsterInsights.

Enable Adsense tracking in Google Analytics with MonsterInsights

To view your AdSense performance reports, go to your Google Analytics account and visit Behavior » Publisher page.

Adsense reports

The overview report gives you a high-level summary of key AdSense metrics. You can also find the Publisher Pages and Publisher Referrers report in Google Analytics.

5. Tracking Your Affiliate Links in Google Analytics

Most affiliate marketers use plugins to manage and cloak affiliate links. This makes your affiliate links look more user-friendly. Here is an example of a cloaked affiliate link:

http://example.com/recommends/product-name/

MonsterInsights allows you to track those affiliate links in Google Analytics. This helps you figure out which affiliate products are doing well, which pages are generating more affiliate revenue, and more.

To enable Affiliate link tracking, you need to visit Insights » Settings page. Switch to the tracking tab and then click on ‘Affiliate links’ section.

Affiliate link tracking in MonsterInsights

First you need to enter the slug you use for your affiliate links. After that, you need to provide a label you would like to use for those links in your Google Analytics reports.

Next, click on the save changes button to store your settings.

MonsterInsights lets you track affiliate clicks as events in Google Analytics.

To find an overview of your affiliate link clicks report, you can go to Behavior » Events » Overview page. Your affiliate link clicks will be shown with the label you chose earlier.

Affiliate link reports

For more detailed instructions, see our guide on how to track outbound links in WordPress.

Note: most WordPress affiliate plugins may promise to give you link stats. We have found most of those stats to be highly inaccurate because most WordPress based analytics tracking breaks due to caching. Google Analytics is the only way to properly track analytics.

6. Tracking Bounce Rate in Google Analytics

Bounce rate is the percentage of users who land on your website and decide to leave without going to a second page.

To check your website’s bounce rate, you need to login to your Google Analytics dashboard and then go to Audience » Overview page.

Checking bounce rate in Google Analytics

Want to see an individual page’s bounce rate? Head over to Behavior » Site Content » All Pages to see all pages from your website.

Checking bounce rate for individual pages

You can sort the pages by higher or lower bounce rate to see which pages are not performing.

Higher bounce rate indicates that you were unable to convince the user to visit other pages. Users can leave your website by clicking on the back button in their browser, clicking on an outgoing link, or by closing the window.

Bounce rates are completely normal. However higher bounce rates indicate problems with your website affecting user experience and causing low conversions / engagement.

What should be the acceptable bounce rate for your website?

Here is a general breakdown of bounce rate from good to bad.

An excellent bounce rate is between 30% and 50%. However, most websites fall between 50% and 70% bounce rate which is an acceptable average. Bounce rates higher than 70% are considered poor for most websites.

Not all websites are the same which means average bounce rate vary depending on different kind of websites.

Take a look at the chart below to see an average bounce rate by industry:

Bounce rate average by industry

For more on this topic, see this article with tips to reduce bounce rate on your website.

7. Tracking Time Spent on Your Website

Another indicator that shows user engagement is session duration or time users spend on your site.

If users are abandoning your site without spending enough time to look at it, then something is wrong that needs to be fixed.

Google Analytics can show you the average time users spend on your site per session. Simply go to Audience » Overview page, and you will see it among other stats.

Average time spend per session

It can also show you how much time users spend when viewing individual pages. You can check it by visiting Behavior » Site Content » All Pages page in Google Analytics.

Time spent on individual pages

To learn how to improve session durations, take a look at this article with practical tips to increase time users spend on your website.

8. Tracking Page Views Per Visit with Google Analytics

Page views per visit is another great indicator of how engaged your users are. More page views per session also increases time users spend on your site and decreases bounce rates.

Google Analytics will show you the total page views for a given period on Audience » Overview page. However, to track user engagement you also want to see page views per session.

Tracking page views in Google Analytics

You can also break down page views per session by source and channel by visiting Acquisation » All Traffic » Channels page.

Pages per session by channel

This helps you see which traffic channels are converting the best for your website, so you can focus your efforts on areas that are actually driving results.

We hope this article helped you track user engagement in WordPress with Google Analytics. You may also want to see our ultimate step by step WordPress SEO guide and email marketing 101 guide for beginners.

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 Track User Engagement in WordPress with Google Analytics appeared first on WPBeginner.

How to Track Outbound Links in WordPress

Do you want to track outbound links in WordPress? Outbound links are the links that take users away from your website. These could be links to affiliate products, social networks, or simply other websites that you have linked to from your website. In this article,… Read More »

The post How to Track Outbound Links in WordPress appeared first on WPBeginner.

Do you want to track outbound links in WordPress? Outbound links are the links that take users away from your website. These could be links to affiliate products, social networks, or simply other websites that you have linked to from your website. In this article, we will show you how to easily track outbound links in WordPress to see which outbound links get the most clicks.

How to Track Outbound Links in WordPress

Why Track Outbound Links in WordPress?

After you build your website, you need to learn how users interact with your website, so you can grow it. The best way to do this is by using Google Analytics.

It allows you to see where your users are coming from, what pages they are viewing, and how much time they are spending on your website. This information helps you adjust your strategy and improve your website accordingly.

Similarly, learning about outbound or external links can help you understand which outgoing links are clicked more often. If you recommend affiliate products, then tracking outgoing links help you learn which products perform better with your audience.

Having said that, let’s take a look at how to easily track outbound links in WordPress.

Tracking All Outbound Links in Google Analytics

First, you will need to install and activate the MonsterInsights plugin. There is a free version as well which you can use. For more details, see our step by step guide on how to install a WordPress plugin.

MonsterInsights is the most popular Google Analytics plugin for WordPress. It allows you to properly connect your website with Google Analytics.

For complete setup instructions, see our step by step guide on how to install Google Analytics in WordPress.

Upon activation, you need to visit Insights » Settings page in your WordPress admin area and click on the ‘Tracking’ tab.

Enabling outbound link tracking using MonsterInsights

Under the ‘Engagement’ section, you will see ‘Track outbound clicks and download links?’ option. You want to select ‘Using Javascript’ option and then click on the save settings button.

That’s all, you have enabled outbound link tracking on your WordPress site.

Tracking Internal Affiliate Links as Outbound Links

Many WordPress site owners use affiliate marketing plugins to manage and cloak affiliate links. This allows them to use pretty URLs like this:

http://example.com/refer/productname/

By default, Google Analytics doesn’t track these URLs as outbound links, so they will not appear under your outgoing-link reports.

MonsterInsights allows you to easily fix this.

Head over to Insights » Settings page and then click on the ‘Tracking’ tab. The tracking page is divided into different sections. Click on the ‘Affiliate Links’ section to continue.

Track affiliate links

Now you need to provide the path that you use for your affiliate links. This is the prefix added by your link cloaking or affiliate link manager plugin.

After that you need to provide a label for those links. This label will be added to your Google Analytics report and will help you identify those links in your reports.

Don’t forget to click on the save changes button to store your settings.

Viewing Outbound Link Reports in Google Analytics

If you have just enabled outbound link tracking on your WordPress site, then allow Google Analytics at least 24 hours to collect the data.

After that you can login to your Google Analytics dashboard and click on Behavior » Events » Top Events page.

You will see your outbound links listed as ‘outbound-link’ event category and your affiliate links will be listed with the label you added in plugin settings.

Outbound link event category in Google Analytics

Clicking on it will show you the URLs users clicked on your website.

Outbound link URLs

You can also view outbound link activity in real time. Inside your Google Analytics dashboard, simply go to the Real-time » Events page.

Viewing outbound link reports in real time

You will see your outbound link, and your outbound affiliate links reported as events.

We hope this article helped you learn how to track outbound links in WordPress. You may also want to see our ultimate step by step WordPress SEO guide for beginners.

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 Track Outbound Links in WordPress appeared first on WPBeginner.

How to Find Who Reads and Subscribes to Your WordPress Blog

Do you want to find who reads and subscribes to your WordPress blog? Part of building a website is to understand is how your users read and interact with your content. In this article, we will show you how to find who reads and subscribes… Read More »

The post How to Find Who Reads and Subscribes to Your WordPress Blog appeared first on WPBeginner.

Do you want to find who reads and subscribes to your WordPress blog? Part of building a website is to understand is how your users read and interact with your content. In this article, we will show you how to find who reads and subscribes to your WordPress blog.

Who reads and subscribes to your WordPress blog

Why You Need to Know Your Audience?

Understanding your audience is crucial for the success of your blog or business. It helps you learn: which pages on your website are most popular among users? How your users found those pages? Where those users came from? And what else they looked on your website?

All this information helps you decide what kind of content works for your audience. It also helps you find out what is not working with your readers.

This allows you to plan and create better content.

Having said that, let’s take a look at how to find out more information about your readers and subscribers.

Learn About Your Readers and Subscribers Using Google Analytics

Google Analytics is the most comprehensive analytics available in the market today. It can be used to track your site visitors as well as your RSS feed subscribers.

First you need to visit the Google Analytics website and signup for an account. Take a look at the section ‘How to Signup with Google Analytics’ in our guide on how to install Google Analytics in WordPress for detailed instructions.

Setting up Google Analytics for WordPress by MonsterInsights

For this tutorial, we will be using the MonsterInsights plugin. If you are already using the plugin and have it setup on your WordPress site, then you can skip to the next step.

First thing you need to do is install and activate the Google Analytics by MonsterInsights plugin. For more details, see our step by step guide on how to install a WordPress plugin.

Upon activation, you need to visit Insights » Settings page and click on ‘Authenticate with your Google account’ button.

Authenticate Google Account to select your Analytics profile

This will open a popup dialog where you will be asked to allow Google Analytics plugin to access your Google account.

Google Account Permission

Click on the allow button to continue.

The popup will now show you a code which you need to copy and paste into Google Analytics plugin settings on your WordPress site.

Once you do that, the plugin will now fetch your account settings from your Google Analytics account. After that you need to select your analytics profile by clicking on select a profile.

Select a profile

Click on save changes button to store your settings.

That’s all you have successfully setup Google Analytics by MonsterInsights on your website. For detailed instructions, take a look at our beginner’s guide on how to use Google Analytics for your WordPresss site.

Tracking RSS Links in Google Analytics

Google Analytics can not only track visitors coming to your site, but it can also track links to your website from other sources like your RSS feed, email newsletter, social links, etc.

See our guide on how to track links in WordPress using Google analytics.

If you are manually sharing links, then you can add your own URL parameters. But the links in your RSS feed and newsletter are automatically generated by WordPress.

Here is how you can track your RSS feed links in WordPress using the Google Analytics by MonsterInsights plugin.

Go to Analytics » Settings in your WordPress admin area and click on the Advanced tab.

Tracking RSS feed links in Google Analytics

Check the box next to ‘Tag links in RSS feed with campaign variables’ option and click on the save changes button.

That’s all, you have successfully enabled tracking of links in your RSS feed.

Viewing Reports for Your RSS Feed Links in Google Analytics

Log in to your Google Analytics dashboard and then visit the reporting page. Go to Acquisition » All Traffic » Source/Medium tab.

Google Analytics Acquisition

There you will find RSS as source and as medium in your reporting. You can click on it to further drill down, and see which content they clicked.

Finding Subscriber Information

In order to find subscriber information, the first thing you need to do is give your users the ability to subscribe to your blog through an email newsletter. See why you should build your email list right away.

We also have an email marketing 101 guide that will help you build an email list in WordPress.

We’re going to cover how to find subscriber information in two of the most popular email marketing platforms among our users.

Find Subscriber Information in MailChimp

If you are using MailChimp, then it comes with its own built-in analytics. These reports tell you how your newsletter campaigns and your RSS to Email campaigns performed.

Simply login to your MailChimp account and click on Reports from the top menu.

You will see a list of emails sent to your subscribers. Click on the view report button next to an email.

View reports in MailChimp

This will show you an overview of your campaign. It will also provide you with information like how many users opened or didn’t open your email, bounced email addresses, abuse reports, total clicks, links clicked, etc.

Viewing MailChimp reports

Find Subscriber Information in AWeber

If you are using AWeber in WordPress as your email list provider, then you can use AWeber’s built-in reports feature. It will show you how your newsletter or RSS to email campaigns performed.

Simply login to your AWeber account and then click on reports.

Aweber Reports

The reporting dashboard provides an indepth overview of your overall opens and click rates. You can drill down the reports by clicking on shortcuts in the left menu.

AWeber reports shortcuts

That’s all, we hope this article helped you find who reads and subscribes to your WordPress blog. You may also want to see our list of 40 useful tools to manage and grow your WordPress blog.

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 Find Who Reads and Subscribes to Your WordPress Blog appeared first on WPBeginner.

How to Add Google Analytics Event Tracking in WordPress

Do you want to track user activity while they are on your site? You can track pageviews, referral source, time spent on page, and much more by simply installing Google Analytics, but for more in-depth insights, you will need to use event tracking. In this… Read More »

The post How to Add Google Analytics Event Tracking in WordPress appeared first on WPBeginner.

Do you want to track user activity while they are on your site? You can track pageviews, referral source, time spent on page, and much more by simply installing Google Analytics, but for more in-depth insights, you will need to use event tracking. In this article, we will show you how to add Google Analytics event tracking in WordPress.

What is Event Tracking in Google Analytics

Event tracking allows you to measure user interactions on your website. These interactions can be things like clicking on a button, playing a video, downloading files, submitting forms, etc.

Let’s suppose you added a video to your product page, and now want to know how effective is it for your conversions. Event tracking allows you to track how many users played the video, so you can judge for yourself.

Another example is ajax based form submissions. If you are using Gravity Forms or any other contact form plugin, then form submission does not result into a new pageview.

Using event tracking you can see how users interacted with a form.

The same goes for file downloads included on a page. You can track how many users downloaded a file using event tracking and even which button on the page was clicked most.

Event tracking is different from tracking links in Google analytics. You can track links in WordPress using Google Analytics by simply adding UTM source to a link.

These measurable actions allow you to see how users behave on your site. You can then change your strategy to add content that generate more user engagement and interaction. Ultimately this means more sales and conversions on your website.

Getting Started

Before getting started, you will need to setup and install Google Analytics on your WordPress site. If you are not familiar with using Google Analytics, then you can try our beginner’s guide on how to use Google Analytics.

If you are already using Google Analytics, then you can jump right into event tracking.

Upgrade to Universal Analytics Code

There are currently two type of Google Analytics implemented on websites. Google is slowly pushing out the older code by asking webmasters to use newer ‘Universal Analytics Code’.

If your Google Analytics code looks like this:

<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-XXXXXX-1', 'auto');
  ga('send', 'pageview');

</script>

Then you are already using the newer Universal Analytics code. There is no action required, and you can move on to the next step.

If your code does not look like this, then you are probably using the older Google Analytics code. You will need to upgrade, Google has a detailed upgrade guide for that. Basically if you are not using advanced tracking features in Google Analytics, then you can just switch the old code with the new one from your account’s property settings.

Creating Your Event in Google Analytics

First you need to create your event in your Google Analytics account. Simply log into your Analytics dashboard and click on the Admin link at the top. If you have multiple websites under your analytics account, then make sure that you are viewing the dashboard for the site where you want to add the event.

Google Analytics dashboard

There are three columns under the admin page. Click on the ‘Goals’ link under the ‘View’ column.

Creating Goals in Google Analytics

Next, click on the new goal button to create a goal. From the Goal Setup options, you need to select the custom option and then click on the next button to continue.

Creating custom goal in Google Analytics

This will bring you to the Goal Description step. You need to provide a title for your custom goal, this is something that will help you identify the goal inside Google Analytics.

Under the goal type, you need to select Event. After that click on the next step button to continue.

Entering custom goal title and selecting event as the goal type

The last step is to provide goal details. You will need to enter the event conditions here.

Analytics will count a conversion when all these conditions match.

In this example, we have provided a category and action for the event. We entered a label for the event and provided a value. Depending on what kind of event you are trying to create, you can name your own category, actions, and labels.

If you feel that your event should pass on a value that can be calculated, then you can enter that value here. However, for most common event tracking using the value to be 0 works fine too.

Entering event conditions for custom goal in Google Analytics

Finally click on the create goal button to save and activate the goal. You have successfully enabled tracking for an event in Google Analytics. The next step is to track this event on your website and send data to Google Analytics.

Adding Google Analytics Event Tracking onClick

The easiest and perhaps the fastest way to add Google Analytics event tracking is by using the onclick method. This method simply sends event conditions to Google Analytics when user clicks on an element.

In this example, we are tracking users who click on eBook download link.

We will add the onClick parameter to the download link using this format.

onClick="ga('send', 'event', 'category', 'action', 'label', 'value');"

You will need to replace category, action, label, and value with your event’s conditions. Finally your download link would look like this.

<a onClick="ga('send', 'event', 'Downloads', 'Click', 'Ebook downloaded', '0');" href="http://example.com/wp-content/uploads/2015/06/free-ebook.pdf">Download Free Ebook</a>

That’s all, when users click on this link, it will send an event to Google Analytics which will appear in your site’s reporting.

Adding Event Tracking Using Google Tag Manager

Google Tag Manager is an online tool which allows you to add different tracking codes as tags under one dashboard.

You can also use it to create tags to track events in your Google Analytics account. The main benefit of using Google Tag Manager is that you wouldn’t have to manually insert code into your website, and you can manage all your tags from one location.

If you have already added Google analytics tracking code to your site manually, then you will need to remove it. Use our tutorial on how to install and setup Google Tag Manager in WordPress to add Analytics code to your website.

Once you have successfully added Google Analytics tag in the tag manager, the next step is to create a new trigger. For the sake of this tutorial, we will be tracking a contact form submission as an event.

Click on Triggers in tag manager and then click on the New button.

Triggers in Google Tag Manager

This will bring you to the trigger creation wizard. This is where you would choose event select form.

Choose form as your event

Under the configure trigger section, you need to uncheck wait for tags and check validation options. Next, click on the continue button to go to the next step.

Configure trigger options

In the next step, you need to choose when to fire the trigger. If your page has only one form on it, then you can choose all forms. If your page has more than one form, then you click on some forms button.

When to fire the trigger

If your page has more than one form and you want to track a specific form, then you need to tell Google Tag Manager which form you want to track. When you click on some form buttons you will see filters.

Creating a fire on filter

A filter is simply a set of instructions like if A matches B, then fire the trigger. You need to select new variable.

Selecting new variable will bring up a popup where you can create your own variable. Select DOM element as your variable type. Next, under configure variable choose ID as your selection method.

Now you will need to find your form’s ID. Visit the form page on your WordPress site, take the mouse over to the first form field and select inspect element.

Your browser screen will split into two. You will see the HTML for your page in the bottom screen. The id attribute will either be part of your <form> tag or the div containing the form.

Finding the form element ID

Copy and paste the form ID under the element ID and attribute. Next, click on the create variable button.

You will come back to Fire on filter where you can now select your custom variable. In the matching rule select ‘contains’ and then enter your form’s ID again.

Now click on the create trigger button to continue.

The next step is to create a tag for the event we want to track. In the Google Tag Manager, click on Tags and then click on the New button.

This will bring you to tag creation wizard. Select Google Analytics as your product and then click on the continue button.

Creating an event tracking tag in Google Tag Manager

Now you need to choose Universal Analytics as your tag type. You will be asked to provide your Google Analytics tracking ID. You can obtain this from your Google Analytics account.

Under the track type you need to select event and then provide category, action, label, and value information. In this example we used Forms for category, form submission for action, contact form as label, and submitted as the value.

Click on the continue button to proceed to next step. This is where you select when to fire the tag. Click on the more button and select the trigger you created earlier.

Select your trigger

Finally you can click on the create tag button to save your tag.

Remember that saving a tag does not make it go live on your website. You will still need to click on the publish button to make it live.

Publish your container

That’s all, you can now go to your website and submit the form. Go to Real Time » Events in your Analytics account and you will see your event tracked and recorded.

Event tracked in Google Analytics

Using the tag manager you can create different kind of events and manage them all from Google Tag Manager. It also saves you from editing your WordPress themes or adding tracking code manually.

We hope this article helped you add Google Analytics event tracking in your WordPress site. You may also want to check out our list 7 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 Add Google Analytics Event Tracking in WordPress appeared first on WPBeginner.

How to Block WordPress Referrer Spam in Google Analytics

Are you getting a lot of referrer spam in your Google analytics? Referrer spam is a way to pass fake referer information to websites. These spammy links then appear in a users analytics and can lead you to click on malicious websites. In this article,… Read More »

To leave a comment please visit How to Block WordPress Referrer Spam in Google Analytics on WPBeginner.

Are you getting a lot of referrer spam in your Google analytics? Referrer spam is a way to pass fake referer information to websites. These spammy links then appear in a users analytics and can lead you to click on malicious websites. In this article, we will show you how to effectively block WordPress referrer spam in Google Analytics.

Getting Started With Google Analytics

If you are not using Google Analytics on your WordPress site, then you should check out our guide on how to install Google Analytics in WordPress.

Google Analytics is an awesome free tool that allows you to see how users interact with your website. You can see which pages users are visiting, track clicks on links, run split tests, and much more. See this beginner’s guide on how to use Google Analytics for your WordPress site.

For those of you who are already using Google Analytics, let’s fix the referrer spam problem in your Google Analytics reports.

What is Referrer Spam?

We all want our websites to be noticed. It makes us happy when other websites link to our articles. Referral spammers take advantage of this desire by sending fake referer URL with automated scripts to thousands of websites.

This URL then appears in your Google analytics or any other stats service you are using as referrers. Considering the fact that they affect millions of websites, it is likely that many users may want to explore these sites when they see them in their referral reports.

Referral Spam

Why You Need to Worry About Referer Spam

Some might say that referrer spam is quite harmless unless you click on the links. Well let’s assume that you won’t click on those links, there are still other downsides.

If you are small or medium sized website, then referer spam can ruin your sites analytics reports.

If you decide to sell your website and share this report with interested buyers, these spam links can leave a bad impression on them.

How We Deal With Referrer Spam?

We use Sucuri to monitor our website’s security. Sucuri not only only protects our website against malware and trojans, it also blocks referrer spam.

Sucuri Website Firewall blocks most known bad referrals by default. Their team is always adding new referral spammers to the list and actively monitoring their behavior.

Blocking Referrer Spam in WordPress Using Plugin

There are several WordPress plugins that can help you keep referrer spam to a bare minimum. These plugins use web services that are actively monitoring referral spam websites and use that list to block referral spam.

First thing you need to do is install and activate the SpamReferrerBlock plugin. Upon activation, you need to visit Settings » Spam Referrer Block to configure the plugin.

Custom Blacklist

On the plugin’s settings page, you will see a text area to create your own custom blocking lists. Below that you will see the list of sites this plugin is actively monitoring and blocking. You can update this list with the most up to date version by clicking on the download from server button.

Download blacklist or upload yours

If you see a referrer spam link in your Analytics account that is not listed on this page, then you can add it to the custom blacklist. Click on the save button and plugin will start blocking it.

You can also share your custom blacklist with the rest of the internet community by clicking on the upload to server button at the bottom of the page.

Block Ghost Referrals Using Google Analytics Filtering

Despite implementing these solutions, you will still see some referrer spam in your Analytics reports. These websites are not visiting your site at all, so Sucuri or any other tool cannot block them.

They are sending their requests directly to Google Analytics using your UA Tracking code. This tracking code is used by Google Analytics to identify your website. Most site owners add it to their WordPress site’s footer or header section. Anyone can look at this code and use the UA tracking id to generate referrer spam.

Here is how you can block such websites in Google Analytics itself. Login to the Google Analytics account and then click on Admin link at the top.

Google Analytics admin

This will bring you to the admin section of Google Analytics.

First you need to select the account from the left hand column. After that you need to click on Tracking Info to expand it.

Finally, you will see the Referral Exclusion List option.

Referral exclusion list

Clicking on it will show you the referral exclusion list. Click on the add referral exclusion button and start adding domain names that you want to block.

Add domains to your referral exclusion list

We hope this article helped you learn how to block WordPress referrer spam in Google Analytics. You may also want to see our list of 7 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.

To leave a comment please visit How to Block WordPress Referrer Spam in Google Analytics on WPBeginner.