I'm a coder. Welcome to my blog. Here are some of the records on my job.

Categories

Use events or virtual page views for Google Analytics and ajax

What makes more sense (or is proper according to google)? Registering an event or a virtual pageview with Google Analytics when tracking navigation through a webpage with heavy use of ajax?

I had been using events to track this kind of thing, but I find myself kind of emulating the pageview mechanism by tracking the clicks through events like the following:

_gaq.push(['_trackEvent', 'signup', 'clicked', 'header']);

should I instead be creating virtual pageviews when visitors click on links that call AJAX and bring up dynamic content?

_gaq.push(['_trackPageview', '/signup/form']);

If this is a new content that user navigates to, then you should be using virtual pageviews.

If you use events for all navigation then some metrics will be unreliable like pages/visit, avgTimeOnPage, avgTimeOnSite, pageDepth. If you use pageviews for navigation these metrics will be closer to the truth.

Related Articles

I'm looking at the GA traffic and I'm seeing page views for pages like this: /cms/getdoc/2d22c1db-ae83...angobjectlifetime=request Is this page used when a user is viewing a document (PDF, Word, etc.)?Not necessary. It could be any page within the co

I have about 50 websites in my google analytics account. I want to do some research, create notification system and compare analytics data with data from other sources. That means I want to get a dozen of reports for every site twice a day. I parse t

Goal: a client would like download / view stats on specific PDF files on their website. It seems that Google Analytics provides two options: event tracking and virtual pageviews. But, the documentation is not clear to me whether either of these is tr

This question already has an answer here: Validation plugin - Auto validate multiple forms on a page 1 answer i'm making a landing page with some forms on it and i'm using JQuery validator to validate the Input on every form, the thing is that two of

I downloaded the sdk for google-analytics for android but where i can setup the account? I have the option for only adding http or https wesites. I use the UA number that i got from a fake url but i get no analytics. Also.. Tracking Status: Tracking

I'm trying to set up a Goal for Google Analytics for a certain page pattern containing a subpage AND a parameter value. If I have the url: http://www.domain-name.com/page-title/?sort=0&make%5B%5D=0.123&make%5B%5D=0.345&make%5B%5D=0.456&ext

I wanna start using Google Analytics PHP API. I found 2 libraries and I can't understand which one should I use and what is the main difference between them: gapi-google-analytics-php-interface and google-api-php-client P.S. The main reason to use th

I'm trying to implement a page-views-counter with Rails and memcached. Every time I render a page, through rails I increase a memcached key (key.incr is atomic). My main worry is the possibility where this key gets expired or deleted from memcached b

The codes for Google Analytics use a global _gaq object for the analytics commands. They advise to check if such an object already exists, like this: var _gaq = _gaq || []; // Command _gaq.push(['_trackPageview']); In CoffeeScript, this would look li

we are new to phonegap, and planning to use phonegap to build the application for iOS , Android , and Windows platfrom, have following question , 1 -- I believe phonegap framework will assist developer to write code in HTML/Javascript , CSS and it ca

I have click stream data such as referring URL, top landing pages, top exit pages and metrics such as page views, number of visits, bounces all in Google Analytics. There is no database yet where all this information might be stored. I am required to

Does anyone know how to get CSP, even with the default-src wildcard, to work so a modern Analytics script sends website per-page data (not just home page data) to the site owner's account and so AdSense ads appear? I tried many variations of CSP for

We are trying to use google analytics and hubspot on our site but they bith seem to delay the execution of the scripts on our site. We are using jQuery and the "ready" function to delay our scripts until the page is ready. Are there any ways we

I am most interested in an answer for Android, though it would be great to know if the answer is generalizable to websites, iOS, etc. Can I anonymize IPs (using setAnonymizeIp()) in Google Analytics and still track unique visitors? I understand Googl