Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I've never used Google Analytics (GA), so maybe this is possible. But, a friend of mine had someone create a site for him for quite a lot of money. Anyway, my friend wanted the guy to add another textbox & database field to track some data and the guy said, "We'll add the textbox, but we'll let Google Analytics track the data for you and give you a report."

Anyway, adding another field seems trivial to me...but the developer said GA is "the way" to do it. Everything I see about GA seems to track how people get to your site and how they explore it...but doesn't seem to capture RAW DATA for you.

  1. Does GA capture RAW DATA?
  2. If so, how?
  3. What widgets are used?

The reporting aspects of GA are awesome, but relying on GA for RAW DATA seems hokey to me. Why let someone else capture data you should be anyway?

...thanks!

share|improve this question

migrated from stackoverflow.com Sep 7 '11 at 1:11

This question came from our site for professional and enthusiast programmers.

add comment

3 Answers

up vote 1 down vote accepted

I had honestly never thought about it before, but GA event tracking is not a bad solution for a simple "database". It allows several values to be passed for categorization, labeling, "additional info", and numerical data. In the case of the text box (presumably with a submit button) the following code would work fairly well:

var textbox = document.getElementById('myTextBox'),
    submitButton = document.getElementById('myButton');

submitButton.onclick = function()
{
    _trackEvent('data-store', textbox.name, textbox.value, 0);
    // 'data-store' can be replaced with whatever category of data you want, for sortability's sake
    // the 0 can be replaced with any other numerical data you want - but it must be numerical
}

This should answer your first two list items, but I'm unsure as to what you mean by "what widgets are used". It should be some simple javascript.

share|improve this answer
    
I noticed there are other widgets available for use on the GA site. –  Prisoner ZERO Sep 6 '11 at 14:39
add comment

Yes, it can do that kind of thing with Event Tracking and Ecommerce Tracking.

share|improve this answer
add comment

You can use Custom Variables to track any data you want to be tracked. Check Custom Variables. You can btu your RAW DATA there.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.