Google Tag Manager Tracking Guide for WordPress

Google Tag Manager Tracking Guide for WordPress

This guide shows you how to track:

  • External Link Clicks
  • Internal Link Clicks
  • Affiliate Link Clicks
  • Anchor Link Clicks
  • 404 Errors
  • Comment Form Submissions
  • Contact Form 7 Submissions
  • Subscriber Opt-Ins
  • Social Follows
  • Media Shares
  • Social Shares

How to setup Google Tag Manager Tracking in WordPress

  1. Create Google Account or Login to your existing Google Account
  2. Sign into Google Tag Manager
  3. Create a new Google Tag Manager Account (e.g. Penguin Initiatives)
  4. Google Tag Manager Account Setup Screen

  5. Create a new Google Tag Manager Container for your website (e.g. penguininitiatives.com)
  6. Setup Container Google Tag Manager

  7. Copy your new Google Tag Manager Container’s GTM ID (e.g. GTM-P3XHZF):
  8. Copy New Google Tag Manager Container's GTM ID

  9. Login to your WordPress website’s Admin Dashboard and go to Plugins > Add New
  10. Search for “DuracellTomi”, click the “Install Now” button for “DuracellTomi’s Google Tag Manager for WordPress” and then activate the plugin
  11. Go to Settings > Google Tag Manager
  12. Paste in your Google Tag Manager ID and click the “Save Changes” button
  13. DuracellTomi's Google Tag Manager for WordPress General Settings Screen

    Add Google’s Tag Manager Container Code Without a Plugin

    If you don’t want to use a plugin to add your Google Tag Manager code to your WordPress website, then you can of course alternatively copy and paste the code snippet right below your opening body tag in your WordPress theme’s header.php file if you know how to do so. Note that if you do this instead you won’t get the WordPress dataLayer variables that DuracellTomi’s Google Tag Manager for WordPress plugin creates

  14. Right click and save this Google Tag Manager Container Template for WordPress
  15. In your Google Tag Manager account click on the “Admin” section
  16. Select your new Google Tag Manager Account and Container
  17. Click on “Import Container”
  18. Import Container Google Tag Manager

  19. Then select the Google Tag Manager Container Template for WordPress JSON file you downloaded and import it
  20. Now replace “yourdomain.com” with your website’s domain in the following Triggers: Anchor Link Click, External Link Click and Internal Link Click (you may have to refresh your container to see the newly imported Tags, Triggers and Variables)
  21. Next replace “affiliatelinkpattern” with whatever URL pattern is consistent for your affiliate links, if your site doesn’t have affiliate links or they don’t use a consistent URL pattern you can skip this step
  22. Finally replace the “Tracking ID” Variable with your website’s Google Universal Analytics Tracking ID (e.g. UA-61808155-1)
  23. Save all your changes and Publish your Container
  24. Login to your WordPress website’s Admin Dashboard and go to Plugins > Add New
  25. Search for “WP Ajaxify Comments”, click the “Install Now” button for “WP Ajaxify Comments” and then activate the plugin
  26. Go to Settings > WP Ajaxify Comments
  27. Check the checkbox next to “Enable plugin”
  28. Scroll down to the ‘OnAfterUpdateComments’ callback field”, then copy & paste in the following JavaScript code:
  29. WP Ajaxify Comments newComment dataLayer event callback

  30. Scroll to the bottom and click the “Save Changes” button
  31. If you would like to track Contact Form Submissions, simply use the Contact Form 7 WordPress Plugin to power your contact form
  32. If you use Elegant Theme’s Bloom Email Opt-In WordPress Plugin and want to track new Opt-Ins you’ll need to do the following:
  33. Download Bloom’s custom.js file from this location: /wp-content/plugins/bloom/js/custom.js and open the file in a text editor
  34. Search for the following code (on line 405 in version 1.0.3):
  35. Hit return after this line of code to create an empty line below it, then copy and paste the following code:
  36. Now save your modified custom.js file and overwrite it via FTP
  37. If you use Elegant Theme’s Monarch Social Sharing WordPress Plugin and want to track social follows, media shares and social shares you’ll need to do the following:
  38. Download Monarch’s custom.js file from this location: /wp-content/plugins/monarch/js/custom.js and open the file in a text editor
  39. Search for the following code (on line 11 in version 1.2.2):
  40. Hit return after this line of code to create an empty line below it, then copy and paste the following code:
  41. Search for the following code (on line 35 in version 1.2.2):
  42. Hit return after this line of code to create an empty line below it, then copy and paste the following code:
  43. Now save your modified custom.js file and overwrite it via FTP
  44. Finally clear your cache and purge your CDN if needed, if you followed this guide correctly you should see the following in your Google Analytics > Real-Time > Events Report:
  45. Google Analytics Google Tag Manager for WordPress Real-Time Events

  46. For slicing and dicing this data further I’ve also created this Google Analytics Advanced Segments Template you can import into your Google Analytics account

Additional Google Tag Manager Resources

Want to track something else?

If you want to track something not covered here and need help getting it to work, please post a request in the comments and I’ll do my best to help you out.

How To Increase Organic Blog Website Traffic Easily

How To Increase Organic Blog Website Traffic Easily

Creating great content is tough to say the least. If you go through the effort of making great content, you want to maximize its value. Value can be created in many ways, but generally the more traffic your content generates, the more valuable it is to you. So here’s a guide on how to easily increase the traffic to your great content. Using the Unique Word Visit Influence Report you can quickly & easily make an educated gamble by tweaking your page titles to increase your organic traffic.

Unique Word Visit Influence Report

  • Login to Google Analytics
  • Set the date range to the past six months
  • Go to Acquisition > Keywords > Organic and set the Primary Dimension to Landing Page
  • Click on the most visited blog post of yours in the report
  • Set the Primary Dimension to Keyword
  • Setup a filter to Exclude Keyword Exactly Matching “(not provided)”
  • Set rows to show 5,000
  • Export the report as an Excel file
  • Copy and paste the Keyword column into Column A of another sheet of your Excel file
  • Run the following macro on the Keyword column of your report:
  • This will extract all the unique words from all your keywords and spit them out in column B
  • Now copy and paste the Visits column into Column C of your new sheet next to the original Keywords from your exported Google Analytics report. Make sure to remove the total visits from the bottom of this column
  • Now in Column D use the following SUMIF formula & drag it down for your entire list of unique words:
  • Now copy column D and paste the values, then use the Sort function to Sort By Column D, Sort On Values, Order Largest to Smallest
  • Remove all the Stop Words, partial words, misspellings and non-plural words (if appropriate)

This will reveal how many visits each unique word is contributing to your most popular blog post.

How to Use the Report

  • Use the Unique Word Visit Influence Report to look for words driving lots of traffic that are currently missing from your blog post’s page title. This report can guide you on modifiers to consider using to further optimize your blog post page title.
  • Adjust your post’s page titles accordingly and re-submit the posts via Google’s Webmaster Tools to speed up the page title updates in Google’s index.
  • Do this for your ten most popular blog posts and enjoy the additional traffic, merely through a well educated page title adjustment.

The Results

Organic Traffic Increase To One of my Most Popular Posts

I was able to achieve the above results for just one of my more popular blog posts (when comparing the same four days one week to the prior week). Considering it only took about 15 minutes, it was well worth the effort.

How I Increased My Extension’s Chrome Web Store Impressions 1,112% in only 15 Minutes!

How I Increased My Extension’s Chrome Web Store Impressions 1,112% in only 15 Minutes!

The Secret

I simply enhanced the professionalism of my extension’s small tile promotional image and added similar large tile and marquee promotional images.

The Extension

The extension I’m referring to here is called Theme Sniffer. It simply detects any given theme or template being used on web sites built in Drupal, Joomla or WordPress. The original version was first published in the Chrome Web Store on May 22, 2012. I built it because I personally wanted such an extension and it did not yet exist.

The Original Chrome Web Store Promotional Image

Original Chrome Extension Small Tile Promotional Image (440 x 280)

The New Chrome Web Store Promotional Images

New Chrome Extension Small Tile Promotional Image (440 x 280)

New Chrome Extension Large Tile Promotional Image (920 x 680)

New Chrome Extension Marquee Promotional Image (1400 x 560)

The Results

Chrome Web Store Stats Trend for my Theme Sniffer Extension

The Data

Note that those increases stand regardless of the viral blog post that shot up the numbers drastically on November 3rd and 4th and they are regardless, still that significant! If we removed that fluke event’s data from the 2012-11-01 through 2012-11-08 average the increase would be even more spectacular!

In fact, if we assumed something more average such as 700 impressions and 25 installations on November 3rd and 4th, the increase would amount to a whopping growth of 1,539% in impressions and 192% in installations!

The Takeaway

Don’t be lazy! Make the extra effort to design professional, consistent, promotional images in all sizes for your Chrome Extension, because the payoff can be HUGE!

7 Basic SEO Tips, Tweaks, Tactics & Strategies

7 Basic SEO Tips, Tweaks, Tactics & Strategies

It’s quite amazing how many web sites there are that don’t do the basics. If you have a web site and you want it to succeed, then make sure you’ve done all of the following at the very least. This post will explain domain-wide redirects, proper page title, meta description, alt attribute, and URL usage, as well as web analytics and making sure to host all your own content on your own domain.

Domain-wide Redirect

Search engines consider separate sub-domains to be separate web sites. This is why domain.com and www.domain.com are considered separate web sites. External web sites will sometimes link to your site using both variations and this can lead to you not capturing the full potential of your backlinks.

To avoid this problem, you simply need to setup a domain-wide 301 redirect on your Apache web server. Assuming your site is running on Apache (the vast majority are) then you can use the following code. You’ll just need to edit your .htaccess file in your root public directory, or you’ll need to create a text file and save it as “.htaccess” and upload it to your root public directory.

Ideally you’ll want to redirect the variation with the least unique domain backlinks to the version with the most unique domain backlinks. You can utilize Majestic SEO’s Site Explorer to determine this. Just register for a free account, then enter both variations of your domain (http://domain.com and http://www.domain.com), be sure to “Use Historic Index” so you’ll see all the backlinks for each. Then, by using the following lines of code, redirect the version with the least unique domain backlinks to the version with the most unique domain backlinks.

non-www to www

www to non-www

Proper Page Title Usage

Make sure your page title is no more than 70 characters in length. Place your targeted keywords as far left as possible, throw in your site/brand at the end after a pipe (|) symbol.

good page title example

The following is a good page title because it is exactly 70 characters in length. In addition, it has the most relevant keywords at the beginning and includes the web site name at the end.

bad page title example

The following is a bad page title because it is very short. The only keyword it has in it is SEO. It is only 8 characters in length, meaning it is not making use of the additional 62 characters it could be to target additional, longtail keyword phrases. It also explains nothing about the web site’s home page.

Proper Meta Description Usage

Make sure your meta description is no more than 155 characters in length. Place the keywords you anticipate the page ranking for near the beginning of the meta description and be sure to finish it off with a nice call to action. If your page comes up in the results for the keywords you have in the meta description they will be listed in bold. This will help your listing stand out more, then your call to action will entice users to click on your listing even further. Both of these tactics combined can help increase the click through rate on your search engine result page listing.

good meta description example

The following is a good meta description because it is exactly 155 characters. It also includes keywords that the page is targeting and likely to rank for. In addition, it has a nice call to action that will entice viewers to click on its search engine result page listing.

bad meta description example

The following is a bad meta description because it is very short, does not include many keywords and has no call to action. It is only 57 characters in length, meaning it is not making use of the additional 98 characters it could be to explain in more detail what the web site is about and include more relevant keyword phrases as well as a call to action to entice viewers of the search engine result page listing.

Use ALT Attributes

Images on a web site are like a black box to search engines. This is why alt attributes exist. All search engines have to go on is the name of the image file if you do not use alt attributes. Blind people have the same problem with images on a web site that search engines do. You should always use alt attributes to explain what the image is about. Ideally you can find a happy medium between describing an image and utilizing relevant keywords you are targeting.

good alt attribute example

The following is a good alt attribute example for the above image because it explains in detail what the image is about and it also includes many relevant keywords. This is equally good for visitors and search engines to consume. In addition, the alt attribute does a good job complementing the image file name.

bad meta description example

The following is a bad alt attribute example for the above image because it explains nothing specific about the image. Simply “seo graph” is too generalized. If you typed “seo graph” in Google would you want to see this image? Perhaps, but you’d be far more likely to want to see this graph if you typed in “keyword length conversion rates”. In addition, the image would likely rank much higher for the phrase “keyword length conversion rates” than “seo graph” because it is a far less competitive keyword phrase. The alt attribute in this example, is also not very complementary to the image file name.

Use SEO-Friendly URLs

SEO-friendly URLs are equally people-friendly in that they are easy to remember and include keyword phrases in them. They are important because they help re-emphasize what the page is all about. Not only that, but when people link to a web page they commonly will copy and paste the URL. If your keywords are in the URL, then you get backlinks pointed to your site that have your targeted keywords in the anchor text.

SEO-friendly URL example

The following is an SEO-friendly URL because it utilizes hyphens to separate words and English words to explain what the page is about. Just looking at that URL, you have a pretty good idea about what you’ll find after you click on it don’t you? If you did a Google search for “seo friendly urls” the keywords “seo”, “friendly” and “urls” would be bolded, which again helps with clickthrough rates on your search engine result listing.

SEO-unfriendly URL example

The following is an SEO-unfriendly URL because it tells you nothing about what the page is about. All I can tell is that it’s one of many posts on seopeng.com. If I had never been to the site before I would have no clue at all what its about. Perhaps it has something to do with search engine optimization? For a site about SEO, they don’t really seem to know what they’re doing!

Host all your content on your own Domain

So many business web sites have a blog hosted on a free blogging service such as Blogger. This is a horrible idea because the point of a blog from an SEO perspective is to create great content, which generates backlinks organically. When You host this on your own domain such as http://www.domain.com/blog/ it associates these backlinks with your root domain and increases its overall domain authority. When you have your site hosted on a third party site is doesn’t give you the same benefit. This applies to any content you produce that is hosted on a third party site, always place it on your own root domain when possible.

Install web analytics

How are you going to measure the success of your web site if you have no data on what it’s doing? There is absolutely no reason not to install analytics on a business web site. You need to establish goals for what you want people to accomplish on your web site. These are known as conversions, desired actions you want users to take on your site when visiting. For a business web site this could by filling out a contact form, requesting a quote, giving you a call, signing up for your newsletter or purchasing a product. There’s no excuse, setting up analytics is very easy and there are many free web analytics packages out there. Google Analytics is one of the best free web analytics packages out there. Stop flying blind and install it today if you have not already!

SEO Link Value Measurement & Evaluation Criteria

SEO Link Value Measurement & Evaluation Criteria

There’s a lot that goes into assessing the value of a link. Knowing the value of a link is important, because you don’t want low-quality links nor do you want to waste too much time, money or both on links that aren’t truly worthwhile. The following are ten factors to take into account when assessing link acquisition targets.

Authority

You want links from places with significant authority and ideally trust as well. Not only domain-wide, but for the specific page in question as well. The more the merrier, but focus on the sites that have equal or higher authority than yours. Run a free Open Site Explorer report on the domain. For this example we are looking at SEOBook.com.

Relevance

Alright, so not all links need to be relevant. Ideally most will have some form of relevance. Avoid getting many irrelevant links, as they don’t really add that much value. Too many can be negative. The truly relevant ones are where it’s at! Try to find the cream of the crop, the links from domains that have backlink profiles that include the leaders of your industry. For example, that would be like SEO Peng getting a link from SEOBook.com or SEOMoz.org.

Number of existing external links on page

The less external links on the page the better. This means more authority will be passed your way, the more links you’re sharing with, the smaller your piece of the pie.

Relative difficulty for competitor to replicate

Can your competitors get links from the same source? If not, then this link is gold! Get as many of these as possible! If they can easily replicate the link, then you should still acquire it as the competition probably will in the future. Since your link campaign will probably start with you scouring through all your competitors’ backlinks, this will probably be one of the first things you do.

rel=”nofollow”

Is the link going to be tagged with rel=”nofollow” so it passes no authority? Don’t waste too much effort going after these, but you’ll need to get them too to keep your link diversity at a healthy ratio. Install SEO plugins to quickly point these out as you surf around. I’d recommend SEO for Chrome for, you guessed it Google Chrome and SEOBook’s SEO Toolbar for Mozilla Firefox. You can enable settings in these to automatically highlight rel=”nofollow” links as you surf around.

Direct traffic potential

How many direct visitors is this link likely to send? Are these the types of visitors you want? How likely that any of them will result in a conversion? If it has no direct traffic potential, then it better provide some SEO value! Obviously there’s no way for you to know how much traffic a site gets unless you have access to their analytics. For this reason, we’ll have to rely on third party traffic estimation services like Alexa.com and Compete.com. You can use the SearchStatus Firefox Plugin to see these estimates for every site you browse, then you can hover over each for specifics. This plugin also allows you to show Google PageRank and MozRank if you’re interested.

Location on web page

A link within the main content area is ideal. This will pass the most value to your site. Links from sidebars and footers are not considered as important. People are more likely to place paid links in these areas so they have been devalued relative to links placed in the main content area.

Anticipated link duration

How long is this link going to be around after you acquire it? Indefinite links are what you want. You don’t want a temporary boost.

Relative control of link

How much control over the link do you have? Can you choose the anchor text and placement? Are you able to tweak the link in the future as it fits your needs? In most cases you will not have any control.

Acquisition potential

How likely is it you’ll be able to even get a link in the first place? Is it really worth the effort to pursue? Money is valuable. Time is money. Keep the costs low unless the link really deserves it!

Pin It on Pinterest