[ic] [data session ...] ?

Alessandro Poletto alessandro at polet.to
Fri Jul 23 19:30:59 EDT 2004

I have made a live tracking of users form my shops, it work really 

1 my-sql table named: tracking
CREATE TABLE tracking (
  session varchar(20) NOT NULL default '',
  username varchar(200) NOT NULL default '',
  nitems varchar(4) NOT NULL default '',
  total_cost varchar(10) NOT NULL default '',
  url varchar(255) NOT NULL default '',
  carrello text NOT NULL,
  referer varchar(150) NOT NULL default '',
  host varchar(128) NOT NULL default '',
  page_view varchar(5) NOT NULL default '',
  tempo varchar(30) NOT NULL default '',
  KEY tempo (tempo),
  KEY username (username),
  KEY session (session)

in template_TOP i've inserted:

my @carrello=@{$Carts->{main}};
my $elementi= @carrello;
$elementi = $elementi * 1;
my $conc = "";
my $aca = 0;
while ($aca < $elementi) {
  my $carrello = $Carts->{main}[$aca]{code};
  my $carrello_l = $Carts->{main}[$aca]{sku};
  my $carrello_q = $Carts->{main}[$aca]{quantity};
  $conc = $conc . " <a target=nuovo href=/acqua/acquarivendo/" . 
$carrello_l . ">" . $carrello . "</a>"  . "q " . $carrello_q . 

return ;

[tmp laquery]
insert into 
values('[data session id]','[data session username] [data session 
source]','[nitems]','[total-cost]','[data session 
last_url]','[scratch codici_prodotto]','[data session referer]',' 
[data session host]','[data session pageCount]','[scratch 
[query sql="[scratch laquery]"][list][/list][/query]


in crontab I execute a script every 300 seconds (5 min)


TIM=`date +%s`;
let TIML=$TIM-180;
mysql -u USER -pPASSWORD -B DATABASE -h localhost -e "delete from 
tracking where tempo < '$TIML'"


And last I've created a page under /pages in the shop:


<table cellpadding=0 cellspacing=0 border=1 width=100%>
  <th>Art. Car.</th>
  <th>Ip Prov</th>
  <th>Pagine viste</th>
[query sql="select count(distinct session) as utenti from tracking" 
type=list][list][sql-param utenti][/list][/query]
[query sql="select distinct session as utenti from tracking order by 
session" type="list"]
  [query sql="select count(session) as pagine from tracking where 
session='[sql-param utenti]'" type=list prefix=utenti 
        <td><a href="__VendURL__\tracker.html?utente=[sql-param 
utenti]">[sql-param utenti]</a></td>
        <td colspan="9">&nbsp;</td>
[query sql="select * from tracking where session='[sql-param utenti]' 
order by tempo" type="list" prefix=dettaglio list_prefix=dettaglio]
[tmp tempo][time]%s[/time][/tmp]
      <td>[dettaglio-param username]</td>
      <td>[tmp articoli][dettaglio-param nitems][/tmp]
[if scratch articoli > 0]
  [dettaglio-param nitems]
      <td>[dettaglio-param total_cost]</td>
      <td nowrap>[dettaglio-param carrello]</td>
      <td>[dettaglio-param host]</td>
      <td>[dettaglio-param page_view]</td>
      <td>[calc][scratch tempo]-[dettaglio-param tempo][/calc]</td>
      <td>[dettaglio-param url]</td>
      <td>[dettaglio-param referer]</td>



not so well but works (make the page auto-refreshing with meta 

your graphs are really interesting... can you send the code?

> Quoting Sandy Thomson (sandy at scotwebshops.com):
> > Hi,
> > I have been trying to access various things in the session database,
> > mainly referer and source (as documented here:
> > http://www.icdevgroup.org/i/dev/docfly.html?mv_arg=ictemplates05%2e0
> > 2), but these always seem to be blank when referencing them in a
> > page.
> > 
> > Not all things are blank, for instance ohost, id etc.
> > 
> > Using the [dump] tag, i can see the HTTP_REFERER enviroment variable
> > has the correct referer but it doesnt propogate into the sessions
> > DB.
> > 
> > Anyone got any ideas? I am using IC 5.0 and have
> > SessionDatabase session
> > in my catalog.cfg file
> > 
> > 
> > The reason I ask is I was wanting to track how successful our 
> > advertising on various search engines is, and whether it is worth
> > paying for.
> Both the referer and source keys are set only once.
> The referer key is set only on the initial
> entry for the session. If you link from an HTML page you should
> find this to be true. It will always stay at the initial value.
> The source key is set the first time mv_pc has a qualifying value,
> i.e. letters not just digits. Or you can reset it any time with
> mv_source.
> -- 
> Mike Heins
> Perusion -- Expert Interchange Consulting    http://www.perusion.com/
> phone +1.765.647.1295  tollfree 800-949-1889 <mike at perusion.com>
> Being against torture ought to be sort of a bipartisan thing.
> -- Karl Lehenbauer
> _______________________________________________
> interchange-users mailing list
> interchange-users at icdevgroup.org
> http://www.icdevgroup.org/mailman/listinfo/interchange-users

Toth di
Alessandro Poletto
E-mail: alessandro at polet.to

More information about the interchange-users mailing list