I’m trying to track specific actions using Google Analytics, but I don’t want to track them locally when I’m developing the site. Locally I don’t load Google Analytics, so I’m trying to only enable the tracking if GA is loaded. When I added the condition shown below it stopped tracking actions, any thoughts on why?
if (typeof _qag != "undefined") {
_gaq.push(['_trackEvent', ucfirst(Site.page.tabs.main.getSelected().attr('data-siteName'))+' Tab', 'Clicked deal header', ucfirst(Site.page.tabs.getSelected().attr('data-siteName'))]);
}
Shouldn’t it be “_gaq” instead of “_qag” on your if?
That way it’s always false.