|e-commerce tracking - logs v database|
how do you track what items are purchased?
There's a lot of data recorded on the web server, but details of items purchased isn't one of them, normally.
Your database will record all the purchases made, and you then have to figure out how to marry the figures from the database and the server logfiles.
This is the norm, right?
But let's suppose you want more info about specific purchases to be recorded on the web server. How do you go about it? Is it a case of building some additional pages (redirects maybe) that store info on what is being purchased, before the user is brought to the confirmation page? Or is there a better way of achieving this?
Any views on this?
>> Your database will record all the purchases made, and you then have to figure out how to marry the figures from the database and the server logfiles.
Get your dbase to write to a separate logfile, recording purchase details and keying them to the session ID assigned when the visitor hit your site. Have the marketing site write cookies, or write to the same dbase for "normal" web traffic. Report on both
Surfer hits your site, from google, search string = blue widgets. Your server records the session ID, referring domain and search string in a cookie. After a click or two, they go to your cart and buy a widget. The cart writes the session ID, purchase value and item to a separate logfile. Your consolidated log analysis tool reads both logs, relates the 2 items using the session ID as the primary key, and reports sales by SE by keyword to you. Cool, huh?
There are variations on that theme depending on your skills and preferences, but you get the idea, I'm sure. You just need a primary key somewhere, and you're home
What I'd like ideally, is to tie the info you get from the server logs (email referrals, search engine referrals, etc) to the info in the database (details of specific purchases).
Let's say, I want to track the success of a recent email campaign. I want to know for each click-thru, how many went on to buy a product, and exactly what product they ordered.
As far as I know, my web stats packages alone, will not give me all this info (mainly because of the difficulty getting specific purchase details).
Now I know the product purchase details are held in the database, but I would prefer if this was also available from the server logs.
I'm asking for too much here, probably :-)
Depends a lot on your customers - if you have a very impulse buy oriented user-based then a simple session cookie will suffice since you only have to follow them for one trip, however if you have a user-base which tends to make several visits prior to purchasing then you might want to consider a semi-permanent cookie in order to allow you to understand their visits prior to making the "purchase visit"...
A cheap'n'easy session cookie method could be; list the cookies (inc. your session token) in your logs, interrogate the headers on the server side and store that session token alongside a purchase record.
It's not perfect but it would allow you to join logs to purchase information with very little effort.
I use Sessions and some ASP to achieve this. Its not totally reliable but it is easy to implement. For example I include the following code in a header file:
If Session("referrer") = "" Then
Session("referrer") = Request.ServerVariables("HTTP_REFERER")
Then I insert this with order info into the order table of the DB.