Categories: Google Analytics

Google Analytics Event Tracking Made the Easiest

I recently authored a post that contained a couple of handy scripts to track YouTube views and outbound links in Google Analytics Event Tracking without having to markup your HTML. I recently found an even easier way to do the most common event tracking needs with just one script.

Cardinal Path, a leader in search engine marketing and web analysis, has an Analytics extension called Google Analytics on Steroids that accomplishes all the following event tracking:

    • Download Tracking
    • Outbound Link Tracking
    • MaxScroll Tracking – very cool addition to find how far down your page users are scrolling
    • Form Tracking
    • Youtube Video Tracking
    • Vimeo Video Tracking
    • HTML5 Video/Audio Tracking
    • MailTo Tracking

Installing the simple tag automatically adds all the above into your Analytics events reporting. You can download the gas.min.js script and install it on your site or reference it from cdnjs as show below.  It automatically pulls the ga.js script. There is no option to pull the DoubleClick script (dc.js) if you are using Analytics to build remarketing lists.

<script type="text/javascript">
var _gas = _gas || [];
_gas.push(['_setAccount', 'UA-YYYYYY-Y']); // REPLACE WITH YOUR GA NUMBER
_gas.push(['_setDomainName', '.mydomain.com']); // REPLACE WITH YOUR DOMAIN
_gas.push(['_trackPageview']);
_gas.push(['_gasTrackForms']);
_gas.push(['_gasTrackOutboundLinks']);
_gas.push(['_gasTrackMaxScroll']);
_gas.push(['_gasTrackDownloads']);
_gas.push(['_gasTrackYoutube', {force: true}]);
_gas.push(['_gasTrackVimeo', {force: true}]);
_gas.push(['_gasTrackMailto']);

(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = '//cdnjs.cloudflare.com/ajax/libs/gas/1.10.1/gas.min.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>

The script also adds other features that can help with the following:

  • Social Media Hit Tracking
  • ECommerce Tracking using metas
  • Cross Domain Setups
  • Multi-account Tracking
  • Changing Page Titles
  • Extensible Custom Hooks (documentation)

Of course, this does not work with the universal analytics script (analytics.js), but I imagine they will release a version that will, and I’ll be sure to post when they do.

NYCSEM

View Comments

  • UPDATE: I reached out to Cardinal Path concerning the availability of GAS for the beta universal analytics. Stephane Hamel,
    Director, Strategic Services, explained that while they are developing the features internally there is no plan to release the product as open source.

Share
Published by
NYCSEM

Recent Posts

How to Respond to Negative Advertising Feedback

Negative Advertising Feedback A client recently got some pointed negative advertising feedback. The response came…

8 years ago

Measurable Marketing Success

Driving Revenue and Expanding Reach NYC SEM helps clients create pay-per-click advertising programs with measurable…

8 years ago

The Future of Banner Ads is Now

We are all familiar advertising with banner ads, also called Content or Display advertising, that…

10 years ago

Link and YouTube Video Event Tracking in Google Analytics with Two Easy Scripts

Measuring conversions in Google Analytics (or other analytics package) is essential for optimizing paid online…

11 years ago

Welcome to the NYC SEM Blog

Watch this space for useful articles, videos, and digital marketing industry discussions. I hope to…

12 years ago