Connect with us

Easy Google Analytics Events tracking in WordPress with GAS Injector


Easy Google Analytics Events tracking in WordPress with GAS Injector

I believe I do not need to introduce Google Analytics. Everyone having a website should know what it is, and usually does. A bigger issue is getting acquainted with all the features. There is a lot of them and many people does not know what benefit they can bring. One of such features are Events. They allow you to monitor a bunch of extremely useful things. Curious? Have a look on these:

  • Form submission
  • Scroll depth
  • Outgoing links
  • Downloads
  • Mailto Links Clicks
  • Played Audio/Video
  • Custom Vars

It’s really tempting to have access to these, but the problem is, they are not very easy to set-up.  In fact it is pretty hard without some dose of proper knowledge. The documentation for Google Analytics Events are pretty poor, having available only few examples. For more than many it maybe a dead-end. Well, not any more…

GAS Injector to the rescue

GAS is a Google Analytics on Steroids is a PHP script wrapping around the Google Analytics Tracking API from Google. It gives pretty simple interface to implement all those awesome events. Around this PHP script there was a WordPress plugin created, so now it is just plug and play. And this is what you will get:

  • A basic Google Analytics integration by only typing in your UA id.
  • A set of available events which you can turn on and off.
  • Absolutely free!
  • Frequently updated and actively developed
  • Excludes Admins Visits
  • According to author successfully running on really big websites

How to use it

Installing and configuring GAS Injector WordPress plugin is unbelievably easy. So here we go:

Step 1. Install

I will not describe installing WordPress plugin, as there is more than enough written about it in the Internet. You can find the plugin using this link. The plugin was not updated for a long time (5 years, but it can still do it’s job perfectly).

Step 2. Configure

In your Admin Panel, go to Settings -> GAS Injector. You will reach plugin configuration screen. In first field enter your Google Analytics tracking code and then your domain. Next you can decide if there are some thing you do not want GAS Injector to track. You have following options to choose from:

  • Disable tracking of outbound links
  • Disable tracking of forms
  • Disable tracking of mailto links
  • Disable tracking of scrolling
  • Disable tracking of downloads
  • Disable tracking of YouTube videos
  • Disable tracking of Vimeo videos

For every of these events you leave enabled you can specify your own label. In fact this is bad naming because these names are not Lables but Event Categories. Events Categories will be then displayed in Google Analytics allowing you to distinguish the events.

Finally you can set more options like

  • DC.JS – add support for Display Advertising (Remarketing with Google Analytics)
  • Anonymize IP – Google Analytics will receive users fake IP’s
  • Debug settings – to help you test the plugin
  • Advanced Setting – a field where you can type in your own Google Analytics Code.

3. Use

Now you have to wait some time to let some data be gathered. Then log in to your Google Analytics, then go to Behaviour -> Events -> Overview. You will get a chart showing how many events have been recorded during last month and below a table showing distribution among Event Categories.


Please mind that any actions made when logged in as Admin will by default not be tracked by GAS Injector.

To get some really interesting data, enter any of these Events Categories. You will see a table with only one record. at the top of the table click  “Secondary dimension” button and then choose Behaviour -> Event label. You will get distribution of event category to more detailed values. Depending on Event Category you may get different results. These could be:

  • For Max scroll – percentage values of scroll
  • For Outbound links – the links
  • For Vimeo videos – links to Vimeo video

When choosing “Secondary dimension” you can pick “Event Action” instead of “Event Label”. Then you will see results distributed to pages where they happened.

I encourage you to play around with data, as you may find a lot more valuable information for you.

Continue Reading
Click to comment

Leave a Reply

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

More in wordpress

About Me:

Szabi Kisded

Hey there, I'm Szabi. At 30 years old, I quit my IT job and started my own business and became a full time WordPress plugin developer, blogger and stay-at-home dad. Here I'm documenting my journey earning an online (semi)passive income. Read more

Sign up for my newsletter and get the YouTube Caption Scraper WordPress plugin for free
(worth 29$)!

All My Plugins In A Bundle:

My AutoBlogging Plugins:

My Online Courses:

A Theme I Recommend:

Featured Posts:

To Top