Subject: [CODE4LIB] Web analytics for POST data

From: Yitzchak Schaffer <[email-masked]>
Date: Fri, 20 Nov 2009 00:34:51 -0500

Hello coders,

I'm looking at tracking our III OPAC usage via a Google Analytics-like 
tool.  As far as I can tell, GA itself doesn't track POST data for 
privacy reasons.  Anyone here know of something for this?  I found an 
open-source GA-like, on-your-own-server PHP project called Piwik 
[http://piwik.org] which I imagine does this, or could be modified 
easily enough.

-- 
Yitzchak Schaffer
Systems Manager
Touro College Libraries
33 West 23rd Street
New York, NY 10010
Tel (212) 463-0400 x5230
Fax (212) 627-3197
Email [email-masked]

---

From: Alejandro Garza Gonzalez <[email-masked]>
Date: Fri, 20 Nov 2009 08:39:41 -0600

I see two ways to do this:

1) You *can* use GA and some Javascript embedded in your III pages to 
log "events" (as they´re called in GA lingo). The javascript (depending 
on your coding wizardry level) could track anything from hovers over 
elements, form submission, "next page" events, etc.

2) Move all or part of your catalog traffic thru a reverse proxy which 
does the actual tracking. Of course, finding the proxy software is one 
thing, finding one that analyzes the specific requests or patterns is 
another =) More likely you would have to find an OSS proxy then modify 
it to do what you want =)

I'd go with GA first =) By the way, I've done a bit of snooping around 
this area, you can email me if you need help =)

_alejandro

-- 
_________________ ___ _ _ _ _ _ _ _
*Ing. Alejandro Garza González*
Coordinación de proyectos y desarrollo de sistemas
Centro Innov@TE, Centro para la Innovación en Tecnología y Educación
Tecnológico de Monterrey

Tel. +52 [81] 8358.2000, Ext. 6751
Enlace intercampus: 80.689.6751, 80.788.6106
http://www.itesm.mx/innovate/

El contenido de este mensaje de datos no se considera oferta, propuesta 
o acuerdo, sino hasta que sea confirmado en documento por escrito que 
contenga la firma autógrafa del apoderado legal del ITESM. El contenido 
de este mensaje de datos es confidencial y se entiende dirigido y para 
uso exclusivo del destinatario, por lo que no podrá distribuirse y/o 
difundirse por ningún medio sin la previa autorización del emisor 
original. Si usted no es el destinatario, se le prohíbe su utilización 
total o parcial para cualquier fin.

The content of this data transmission must not be considered an offer, 
proposal, understanding or agreement unless it is confirmed in a 
document signed by a legal representative of ITESM. The content of this 
data transmission is confidential and is intended to be delivered only 
to the addressees. Therefore, it shall not be distributed and/or 
disclosed through any means without the authorization of the original 
sender. If you are not the addressee, you are forbidden from using it, 
either totally or partially, for any purpose.

---

From: Yitzchak Schaffer <[email-masked]>
Date: Mon, 23 Nov 2009 19:01:22 -0500

> elements, form submission, "next page" events, etc.

Hi Alejandro,

Thanks for a great suggestion.  I tried poking around at it; it seems to 
me like Events aren't built for what I'm really interested in doing, 
namely systematic exploration and analysis of the search sessions.  IOW, 
let's say a form looks like

t=finn
a=twain
l=circ,reserve

It looks like I could log this as three separate events, or one; but 
either way, how would one analyze this?  I'm not interested (solely) in 
how many times this particular query was entered.

I started looking at ways to funnel the params into my own tracking 
script, the prototype of which just writes a line to a text file with a 
JSON serialization of the form data; but I'm not a JS ninja, so I'm 
still trying to figure out how to get around the XSS problems.

Ruddy III turnkey...

---

From: Joel Marchesoni <[email-masked]>
Date: Tue, 24 Nov 2009 09:00:40 -0500

Hi Yitzchak,

I was just looking at this yesterday on the Google Analytics site.  It's a way to define custom variables at either the page, session, or visitor level:

http://code.google.com/apis/analytics/docs/tracking/gaTrackingCustomVariables.html

Joel Marchesoni 
Tech Support Analyst
Hunter Library @ Western Carolina University
[email-masked]
828-227-2860
 Please consider the environment before printing this email!

-----Original Message-----
From: Code for Libraries [mailto:[email-masked]] On Behalf Of Yitzchak Schaffer
Sent: Monday, November 23, 2009 7:01 PM
To: [email-masked]
Subject: Re: [CODE4LIB] Web analytics for POST data

Hi Alejandro,

t=finn
a=twain
l=circ,reserve

Ruddy III turnkey...

---

From: Alejandro Garza Gonzalez <[email-masked]>
Date: Tue, 24 Nov 2009 09:55:37 -0600

To get around XSS you can use GET requests to your logging script, 
sending the data as arguments by one of two methods (maybe there are 
others?):

    * one way is to just "get" an Image by setting an image's SRC to
      your logging script.
    * another is to have an inline IFRAME where you also change its SRC
      to your logging script's URL.

You might have to have some built-in delay to let the logging script 
have time to actually log the event before the form gets submitted... 
I'm thinking using setTimeout() in javascript.

_alejandro

Yitzchak Schaffer said the following on 23/11/2009 06:01 p.m.:
>> log "events" (as they´re called in GA lingo). The javascript 
>> (depending on your coding wizardry level) could track anything from 
>> hovers over elements, form submission, "next page" events, etc.
>
> Hi Alejandro,
>
> Thanks for a great suggestion.  I tried poking around at it; it seems 
> to me like Events aren't built for what I'm really interested in 
> doing, namely systematic exploration and analysis of the search 
> sessions.  IOW, let's say a form looks like
>
> t=finn
> a=twain
> l=circ,reserve
>
> either way, how would one analyze this?  I'm not interested (solely) 
> in how many times this particular query was entered.
>
> script, the prototype of which just writes a line to a text file with 
> a JSON serialization of the form data; but I'm not a JS ninja, so I'm