[Seaside] Seaside Access/Activity Logging

Boris Popov, DeepCove Labs (SNN) boris at deepcovelabs.com
Tue Aug 24 10:18:31 UTC 2010

I guess you'd need to come up with a way of defining "meaningful" and
then use that to generate a URL... In other words, say you have a page
that shows 3 components: A, B and C. What would you like to see in your
URL given that this isn't like PHP where you'll have /signup.php and
/checkout.php etc? Then, say component B calls component D, what would
you like your URL to be then? If your application is controlled by the
task, it might be a touch simpler to define such rules as you could just
change your "URL" manually as you move through it in either direction.


DeepCove Labs Ltd.
+1 (604) 689-0322
4th floor, 595 Howe Street
Vancouver, British Columbia
Canada V6C 2T5

PacNet Services (Europe) Ltd.
+353 (0)61 714-360
Shannon Airport House, SFZ
County Clare, Ireland


This email is intended only for the persons named in the message header.
Unless otherwise indicated, it contains information that is private and
confidential. If you have received it in error, please notify the sender
and delete the entire message including any attachments.

Thank you.

-----Original Message-----
From: seaside-bounces at lists.squeakfoundation.org
[mailto:seaside-bounces at lists.squeakfoundation.org] On Behalf Of Sven
Van Caekenberghe
Sent: 24 August 2010 11:14
To: Seaside - general discussion
Subject: Re: [Seaside] Seaside Access/Activity Logging

Hi Boris,

On 24 Aug 2010, at 11:16, Boris Popov, DeepCove Labs (SNN) wrote:

> I would avoid web server logging in favour of modern tools like Google
Analytics, which allow you to track user's activity via variety of
dimensions, one of which is, obviously, page's URL. The following
extract from one of our apps shows rendering of GA tracking code from
updateRoot: that supports custom URL and multiple trackers (in our case
we CC clients' GA accounts using multiple tracker functionality new to
asynchronous GA), but the key here is _trackPageview option which you
can set to whatever free-form URL you choose instead of default
Seaside's URL. You can also add event tracking to all your links/buttons
or otherwise apply a variety of options GA offers to suit your needs,
> http://code.google.com/apis/analytics/docs/gaJS/gaJSApi.html
> updateRoot: aHtmlRoot
>                 [...]
> self session useAnalytics
>                                 ifTrue: [aHtmlRoot javascript with:
(String streamContents: [:ws | self renderAnalyticsOn: ws])].
>                 [...]
> renderAnalyticsOn: stream
>                 | trackers options |
>                 trackers := (Dictionary new)
>                                                                 at: ''
>                                                                 at:
'b.' put: 'UA-ZZZZZZZ-ZZ';
>                 options := OrderedCollection new.
>                 trackers keysAndValuesDo:
>                                                 [:tracker :accountid |
>                                                 | forThirdParty |
>                                                 forThirdParty :=
tracker notEmpty.
>                                                 options add: (Array
with: tracker , '_setAccount' with: accountid).
>                                                 forThirdParty
add: (Array with: tracker , '_setDomainName' with: 'none');
add: (Array with: tracker , '_setAllowLinker' with: true);
add: (Array with: tracker , '_setAllowHash' with: false)].
>                                                 options add: (Array
with: tracker , '_trackPageview' with: '/' , task trackingURL)].
>                 stream
>                                 nextPutAll: 'var _gaq = _gaq || [];';
>                                 nextPutAll: '_gaq.push('.
>                 options do: [:ea | stream json: ea] separatedBy:
[stream nextPut: $,].
>                 stream nextPutAll: ');'.
>                 stream
>                                 nextPutAll: '(function() {';
>                                 nextPutAll: 'var ga =
document.createElement(''script''); ga.type = ''text/javascript'';
ga.async = true;';
>                                 nextPutAll: 'ga.src = (''https:'' ==
document.location.protocol ? ''https://ssl'' : ''http://www'') +
>                                 nextPutAll: 'var s =
s.parentNode.insertBefore(ga, s);';
>                                 nextPutAll: '})();'.
> -Boris

Thx for the reply.
I understand your approach (even though I am not that deep into GA).
Still, the code you highlighted in red, task trackingURL, is that a
method that you have to implement manually ?
I am looking for some hack that would log something meaningfull
automagically ;-)


seaside mailing list
seaside at lists.squeakfoundation.org

More information about the seaside mailing list