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.