Showing posts with label Universal Analytics. Show all posts
Showing posts with label Universal Analytics. Show all posts

Wednesday, October 01, 2014

Event Tracking - Web Tracking (analytics.js)

 Google

Event Tracking - Web Tracking (analytics.js)

This guide describes how to send events using analytics.js



  1. Overview
  2. Implementation
  3. Examples
    1. Cross Browser Event Tracking
    2. Using jQuery

Overview

Event tracking allows you to measure how users interact with the content of your website. For example, you might want to measure how many times a button was pressed, or how many times a particular item was used in a web game.
An event consists of four values that you can use to describe a user's interaction:
Value Type Required Description
Category String Yes Typically the object that was interacted with (e.g. button)
Action String Yes The type of interaction (e.g. click)
Label String No Useful for categorizing events (e.g. nav buttons)
Value Number No Values must be non-negative. Useful to pass counts (e.g. 4 times)

Implementation

To send an event, you pass the ga function the send command with the event hit type
ga('send', 'event', 'button', 'click', 'nav buttons', 4);
Where:
  • button is the category
  • click is the action
  • nav buttons is the label
  • 4 is the value
You can also send events using the following convenience commands. In each command, the optional parameters have been removed.
ga('send', 'event', 'category', 'action');
ga('send', 'event', 'category', 'action', 'label');
ga('send', 'event', 'category', 'action', 'label', 
    value);  // value is a number.
The send command also accepts an optional field object as the last parameter for any of these commands. The field object is a standard JavaScript object, but defines specific field names and values accepted by analytics.js.
For example, you might want to set the page field for a particular event. You do this using:
ga('send', 'event', 'category', 'action', {'page': '/my-new-page'});
Similarly, you might want to send an event, but not impact your bounce rate. This is easily solved by configuring the event to be a non-interaction event using the following code:
ga('send', 'event', 'category', 'action', {'nonInteraction': 1});
Finally, all the parameters of the send command have their own field names. So you can send an event by only passing a field object to the send command:
ga('send', {
  'hitType': 'event',          // Required.
  'eventCategory': 'button',   // Required.
  'eventAction': 'click',      // Required.
  'eventLabel': 'nav buttons',
  'eventValue': 4
});
Read the Field Reference document for a complete list of all the fields that can be used in the configuration field object.



Examples

You typically want to send an event to Google Analytics when a particular browser event occurs. To do this, you configure a browser event listener and from within that listener, call the event command.
Say you have a link to download a PDF on your page:
<button id="button">Please click</button>

Cross Browser Event Tracking

To track this with pure JavaScript across browsers you would use the following code:
var downloadLink = document.getElementById('button');
addListener(downloadLink, 'click', function() {
  ga('send', 'event', 'button', 'click', 'nav-buttons');
});

/**
 * Utility to wrap the different behaviors between W3C-compliant browsers
 * and IE when adding event handlers.
 *
 * @param {Object} element Object on which to attach the event listener.
 * @param {string} type A string representing the event type to listen for
 *     (e.g. load, click, etc.).
 * @param {function()} callback The function that receives the notification.
 */
function addListener(element, type, callback) {
 if (element.addEventListener) element.addEventListener(type, callback);
 else if (element.attachEvent) element.attachEvent('on' + type, callback);
}
In this example, the addEventListener function is a utility to add event listeners across browsers. This function is used to add an event listener to the PDF download link to listen for the click event. When a click event occurs, the event is sent to Google Analytics.

Using jQuery

jQuery is a popular JavaScript library that handles a lot of the cross browser inconsistencies. If you are using jQuery, to send an event to Google Analytics when a user clicks the link above, you would use:
// Using jQuery Event API v1.3
$('#button').on('click', function() {
  ga('send', 'event', 'button', 'click', 'nav-buttons');
});

Saturday, April 05, 2014

The Data in Google Analytics should be match with the Data or Blogger Statistics.

The Data in Google Analytics should be match with the Data or Blogger Statistics: 

For Geo Location Audience is very different from the Public Data of the same month interval, and is a marked difference. This advice I extend to all other segmentations : 

Example:

In my case, my blog: Digital Marketing & A Bit of All,www.alexrojasriva.blogspot.com appears as follows :

March 7, 2014 - April 5, 2014 . 


Blogger                                          Google Analytics

Statistics -Vision General-Public       Audience-Geo-Location 
________________________________________________________________

America                                          America

 

Included Canada                              Not Included Canada 
Not Included Venezuela                    Included Venezuela 
Not Included Ecuador                      Included Ecuador
Not Included Peru                            Included Peru
Not Included Bolivia                        Included Bolivia

Europa                                             Europa


Not included France                          Included France 

Not Included Italy                             Included Italy 
Not Included Romania                       Included Romania
Not Included Greece                          Included Greece 
Not Included Turkey                          Included Turkey

Africa                                                Africa


Not Included
Senegal                         Included Senegal
Not Included Equatorial                     Included Guinea Equatorial Guinea
Not Included Zambia                         Included Zambia

Asia                                                   Asia


Not Included Thailand                       
Included Thailand
Not included Malaysia                        Included Malaysia
Not Included Indonesia                       Included Indonesia
Not Included Philippines                     Included Philippines
Not Included Japan                             Included Japan

Middle East                                        Middle East


Not Included Israel                            
Included Israel
Not Included Iraq                               Included Iraq
Not Included United Arab Emirates     Included United Arab Emirates

My advice to Universal Analytics (Google).

Since Universal Analytics left beta version or trial period.My advice to Universal Analytics ( Google UA ) is to use the biometric system , iris or retina reading to unify once and for all the offline and online sales in its new tool, thus , will offer the same service for free with the same UA tool , most comprehensive analytical information of the client database, and allowing better segmenting on Universal Analytics tool (like by hardware: smartphone, laptop, PC, Tablet, by OS-software: include Ubuntu/Linux, by behavior: Offline, Online), just increase a field in the database of all customer website using Google Analytics tool , the same it should allowed on UA tool , allowing the transition from GA tool to UA tool, and also allowing use an iris reader developed by Google (new free app called RETINA UNIVERSAL ANALYTICS App, RUA App), also keep customers the free use , and updated interpretations of data closer to the existing reality.Every customer buying online will have to add a record reading your own iris , which will allow you to be unique , such as online and offline customer .When the customer goes to the physical store , with just a reading of the iris , which will be recorded by the smartphone Store and checked every certain period of time in case of lost or stolen smartphone regular customer, update data, suspected of usurpation of person in a physical store using a stolen or lost mobile want to buy using data from credit or debit card registered on the website before by the real client .After making a thorough check of the person is the real owner of the smartphone, is when only then we will know that all your data and the actual purchase you make will be added correctly to your buy offline behavior from the same client and your behavior will be recorded by Universal Analytics online, offline and on time.File reading iris client will be stored in the cloud , so if lost or stolen mobile Store is not very difficult to sell the next day at the store, and only checks with iris client when you have a purchase of a new customer and that also acts suspicious , since regular customers are well known to store employees , but new or recent customers is checked for safety and tranquility.Another tip , UA should not use fingerprint readers , as they have a higher percentage rate of duplication , but can be a second field to add to the database client to identify the same customer only , that is, double check identity .
Neither is recommended to use a number of client / customer card, because the customer always forget the number, or lose the card, or they forget to bring the card with them everywhere.
 With just my little recommended changes, Universal Analytics market win more customers Sitecatalyst Adobe Omniture, Clicktrack , WedTrends and Microsoft Analytics , ensuring the reign of the Analytics Market for many years .UA should never forget either encrypt the customer data, change the encryption from time to time, provide better customer service, be better simply because they are, and each of their products.

 
Alex Rojas Riva