On 1/10/03, Double Down, Inc. penned:
>Can anyone suggest a good method for tracking what page bought a 
>surfer to my page? I need to be able to get that information and put 
>it in a DB.

You could place something like this at the top of every page:

<cfset mydomain = "www.somedomain.com">
<cfset thispage = "sometemplate.cfm">

<CFIF cgi.http_referer does not contain mydomain>
<cfset camefrom = cgi.http_referer>
<cfset cameto = thispage>

<CFQUERY DATASOURCE="mydatasource">
INSERT INTO tracking_table
(Referer, Page_Visited, When_Visited)
VALUES
('#camefrom#', '#cameto#', #CreateODBCDateTime(now())#)
</CFQUERY>
</CFIF>

Alternately you could put it in Application.cfm and change

<cfset thispage = "sometemplate.cfm">

to

<cfset thispage = listlast(cgi.script_name, "/")>

That is if you want to grab the entry page also.
-- 

Bud Schneehagen - Tropical Web Creations

_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
ColdFusion Solutions / eCommerce Development
[EMAIL PROTECTED]
http://www.twcreations.com/
954.721.3452
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at http://www.coolfusion.com

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to