Digital Point Forums
Winn Law Group

Go Back   Digital Point Forums > Design & Development > Programming > ColdFusion
Google Analytics
Log In to view
your analytics

Reply
 
Thread Tools
  #1  
Old Jun 6th 2007, 7:58 am
SEOMalc SEOMalc is offline
Peon
 
Join Date: Oct 2006
Location: Leeds
Posts: 3
SEOMalc is on a distinguished road
Question Capturing Referrer Using ColdFusion.

Hi, I am trying to capture referral data from various sources using ColdFusion such as Google Adwords, Yahoo, MSN, Google etc.

I have done this in the past using PHP as it allows access to the header variables, but I'm rather rusty when it comes to ColdFusion having only lightly touched on it during me degree many years ago.

What I need to ask is, is there a way that I can capture the URL a visitor has come to me from using ColdFusion, so I can report back to my superiors and say "this many visitors came from Google Adwords, this many came naturally via MSN, this many came naturally via Yahoo etc." ?

Thankful for any help anyone can give.

SEOMalc.
Reply With Quote
  #2  
Old Jun 6th 2007, 10:30 am
IsRoss() IsRoss() is offline
Champion of the Naaru
 
Join Date: Apr 2007
Location: Syracuse, NY
Posts: 116
IsRoss() is on a distinguished road
Very easy. #cgi.http_referrer# is the variable you are looking for. Then to save it to your database:

<cfquery name="save_referrer" datasource="#MY_DSN#">
INSERT INTO referrer_table (referrer_name) VALUES ("#cgi.http_rerferrer#")
</cfquery>
Reply With Quote
  #3  
Old Jun 6th 2007, 12:30 pm
tbarr60's Avatar
tbarr60 tbarr60 is offline
Starcaller
 
Join Date: Jan 2005
Location: Southern California, USA
Posts: 3,328
tbarr60 is a name known to alltbarr60 is a name known to alltbarr60 is a name known to alltbarr60 is a name known to alltbarr60 is a name known to alltbarr60 is a name known to all
I'd recommend dumping the CGI scope as a learning exercise.

<cfdump var="#CGI#">

While your at try dumping application, server, client, session, request, form, variables, or any other scope you have or can think of. It's the best way to see what the server and or browser are seeing.
__________________
Salary Survey Your Salary mapped
Creasemonkey.com Goalie Forum
Reply With Quote
  #4  
Old Aug 20th 2007, 1:33 pm
3plains's Avatar
3plains 3plains is offline
Grunt
 
Join Date: Nov 2006
Location: Minneapolis, Minnesota
Posts: 39
3plains is on a distinguished road
Thanks for the info tbarr60. Good stuff.
__________________
3plains Web Solutions: Outdoor Marketing and Outfitter Marketing
Reply With Quote
  #5  
Old Aug 20th 2007, 2:58 pm
tbarr60's Avatar
tbarr60 tbarr60 is offline
Starcaller
 
Join Date: Jan 2005
Location: Southern California, USA
Posts: 3,328
tbarr60 is a name known to alltbarr60 is a name known to alltbarr60 is a name known to alltbarr60 is a name known to alltbarr60 is a name known to alltbarr60 is a name known to all
Quote:
Originally Posted by 3plains View Post
Thanks for the info tbarr60. Good stuff.
I am a big fan of CFDUMP and it even gets better with CF8. I wrote about it on my blog in the post CFDUMP even better in CF8.
__________________
Salary Survey Your Salary mapped
Creasemonkey.com Goalie Forum
Reply With Quote
  #6  
Old Aug 20th 2007, 11:11 pm
3plains's Avatar
3plains 3plains is offline
Grunt
 
Join Date: Nov 2006
Location: Minneapolis, Minnesota
Posts: 39
3plains is on a distinguished road
Is there any way to capture the Referer/User without storing the value of cgi.http_referer or cgi.http_cookie to a database?

All I want to do, is grab the variable once, store it (as users still browse your website), then attach it to a contact form that sends to an email address.

Any help would be appreciated.
__________________
3plains Web Solutions: Outdoor Marketing and Outfitter Marketing
Reply With Quote
  #7  
Old Aug 20th 2007, 11:17 pm
tbarr60's Avatar
tbarr60 tbarr60 is offline
Starcaller
 
Join Date: Jan 2005
Location: Southern California, USA
Posts: 3,328
tbarr60 is a name known to alltbarr60 is a name known to alltbarr60 is a name known to alltbarr60 is a name known to alltbarr60 is a name known to alltbarr60 is a name known to all
Read up on client scope and session scope. If you store the variable in either scope you can access it throughout their stay on the site.
__________________
Salary Survey Your Salary mapped
Creasemonkey.com Goalie Forum
Reply With Quote
  #8  
Old Aug 23rd 2007, 7:38 am
advantage advantage is offline
of the Nightfall
 
Join Date: Jun 2006
Posts: 1,261
advantage will become famous soon enoughadvantage will become famous soon enough
in application.cfm
<CFPARAM name="session.ref_Url" default="#cgi.http_referrer#">

Then add session.ref to your send mail script.
Something like <CFIF isdefined("session.ref_URL")>
Ref : #session.ref_URL#
</CFIF>

Quote:
Originally Posted by 3plains View Post
Is there any way to capture the Referer/User without storing the value of cgi.http_referer or cgi.http_cookie to a database?

All I want to do, is grab the variable once, store it (as users still browse your website), then attach it to a contact form that sends to an email address.

Any help would be appreciated.
__________________
Free Games | Best Bingo Affiliate Programs | |
Reply With Quote
  #9  
Old Nov 13th 2009, 8:30 am
tmusschoot tmusschoot is offline
Peon
 
Join Date: Nov 2009
Posts: 1
tmusschoot is on a distinguished road
Quote:
Originally Posted by advantage View Post
in application.cfm
<CFPARAM name="session.ref_Url" default="#cgi.http_referrer#">

Then add session.ref to your send mail script.
Something like <CFIF isdefined("session.ref_URL")>
Ref : #session.ref_URL#
</CFIF>
I have tried this and it did not work? Any other suggestions?
Reply With Quote
  #10  
Old Nov 13th 2009, 1:45 pm
cfStarlight cfStarlight is offline
Hand of A'dal
 
Join Date: Mar 2007
Posts: 347
cfStarlight is on a distinguished road
.. and what do you mean by "did not work"?
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
I buy traffic in bulk. Needs to include the referrer; NO referrer == NO sale. jedibusiness Traffic 2 Apr 16th 2007 9:32 am
Capturing my On Screen Actions on Video emmaonline Graphics & Multimedia 11 Dec 4th 2006 8:57 pm
Screen capturing video software? Seannal Graphics & Multimedia 5 Nov 8th 2006 2:24 pm
Forward multiple domains using 301 permanent redirect and capturing referrer clasione Apache 2 Sep 26th 2006 10:11 am
Referrer logs show odd referrer: somesite.com\robots.txt Tim_Myth robots.txt 7 Feb 5th 2006 10:24 pm


All times are GMT -8. The time now is 3:56 pm.