Google Analytics Tips for WordPress Websites

For any website operator, especially one that is chasing good SEO ranking, Google Analytics will be a familiar tool. WordPress websites are no exception, with Google Analytics easily integrated within a WordPress theme via code or WordPress plugin. With Google Analytics being used globally for website traffic, statistics, and Internet market data mining, here are a few useful tips for WordPress sites using Google Analytics.

Bypass Google Tracking for Authenticated Users. When adding the Google Analytics tracking code directly to a WordPress theme or template, wrap the tracking code in a conditional statement so that authenticated users are not tracked. This is especially useful to prevent administrative access to the WordPress site from skewing your website traffic statistics.

To wrap the code within a conditional statement, add the following to the WordPress header.php file where your Google Analytics tracking code resides:

php if (!is_user_logged_in()) {?>

Insert your Google Analytics code here

This will only execute the Google tracking code when an unauthenticated user visits the site, and help to keep your website traffic and statistics more accurate and useful.

Keyword-Rich Permalinks. WordPress allows for the use of Permalinks, sometimes referred to as pretty URLs, or pretty permalinks. These are search-engine (and human) friendly URLs that make it easier for a search engine to index and catalog your site content. Permalinks change your WordPress site content URLs from the default format of “/index.php?p=423” to a more standard and useful format.

WordPress permalinks can help boost your SEO ranking by ensuring that WordPress post titles, which are converted to a unique, human readable URL for the post, contain enough of your target keywords to promote the post in SEO ranking. While it is the content of the article that will achieve a good SEO ranking, having the title in a “search engine friendly” format only helps to emphasize the topic of the article.

For the purposes of Google Analytics, permalinks make it much easier for you to read and understand the website traffic reports and data, since you will be able to easily determine which pages or posts the reports are referencing to.

Consider Footer.php for Tracking Code. When using WordPress themes with large amounts of javascript, or a large number of plugins which inject javascript in to the website, web page load times and user experience can be negatively impacted. This is most often seen as a lengthy wait for the website to load, caused by the javascript or jQuery code in the WordPress header.php file taking more than a few seconds to execute. While the code is executing, loading of the web page is halted, and the user sees this as a delay in loading the page.

If your WordPress site contains more than a few javascript or jQuery scripts in the header.php file, consider moving the Google Analytics script to the footer.php file. Scripts in footer.php execute after the page content is loaded, giving the user something to view as the scripts finish executing at the bottom of the page. While the Google Analytics code itself adds little load time to the page contents, adding more executable script code to the header.php file will only add to the delay experienced by your website visitors.

You might be interested in …

4 Simple Ways To Improve Your Website Using Google Analytics

Google Analytics

To be honest, Google Analytics can be pretty daunting once you begin. It’s fairly common for people to get overwhelmed by the magnitude of information available. Also, a lot of people log into Google Analytics, have a look here and there, check their total visitors every now and then, and […]

Read More

How Google Analytics Works – 3 Important Things to Know

Google Analytics

For anyone seeking to build traffic and visits to their site needs to find out how Google Analytics works as quickly as possible. The reason why is that it is probably the most comprehensive, free tool on the internet for tracking your site’s visitors. Not only this, but Google Analytics […]

Read More

How use google analytics tool?

Google Analytics

As a content marketer, you are interested in growing your small business blog. But you might be having problems coming up with result-driven blog post ideas that will connect and convert your readers. That means, whenever you want to write a post, you’re not sure what to write Here are […]

Read More

Leave a Reply

Your email address will not be published. Required fields are marked *