Link to home
Start Free TrialLog in
Avatar of Rowby Goren
Rowby GorenFlag for United States of America

asked on

Grab domain for email on linked web site

I assume this is a Perl question -- I'm ignorant about these things!  This much I know -- my web site is run on a Unix system.  Apache, as I recall, my system administrator told me.

I have put my banner on different web sites.  When the user clicks on the banner s/he is sent to my web site.  I would like some way to identify the source web site so that if the user becomes interested in my product, and decides to click on my email form, there appears on the subject line of the email form the name (or some brief numeric code) of the web site that referred that person to me.

So in other words, I need a way to grab the url/domain name where the person came from, and then whenever that person clicks on my page's email form, there appears on that email subject line a code that lets me know where that person came from -- so I later can credit the referring web site when I look at the email I received.  (Whew!)

If that's all the CGI script did, I would be happy.  But it would be even nicer, if at the same time it added the code to the email, it also put carbon copy infomation so that if the person emailed me a form, it also sent a carbon copy of their email to the email address of the web site that the person came from, so that the person who's site my banner ran on got notified that the person sent me email.

Obviously many times a person would arrive on my site from a domain/url where I have NO banner, so in that case the CGI script would put a code on the email that the person came from a URL/domain where I have no banner.  

Of course I would have a list of the email addresses of those web sites where I have placed my banner, so that the CGI script could refer to that list when it does its thing.

I hope I (a certified CGI Ignoramus) have provided enough information so that one of you experts can provide a solution.  And yes, I have access to my CGI-BIN.

Regards,


Rowby Goren
ASKER CERTIFIED SOLUTION
Avatar of WileyKat
WileyKat

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Rowby Goren

ASKER

You obviously know what you are doing, so I shall give you 250 points!

Thanks,


Rowby
I guess this comment is to ask you, yes, please write the script.  I don't know how to do any programming!

Thanks, Rowby
Avatar of WileyKat
WileyKat

No prob, Rowby. I'll have it written ASAP. Apologies in advance for delays.
Thanks!  Looking forward to your solution!


Rowby
So am I :-). This isn't the sort of script I do often; I just have the skill in case I need it :-). That and my numerous reference books! ;-). Seriously, I'll get it to you as soon as I can.
I need to request a bit more infomation here, sorry:

1. There are two ways for this to function:
  a. At the banner page, the banner has a line <A HREF="http://(your site)/cgi-bin/bannerclick.cgi?account=(siteID)">. Therefore, I have the CGI retrieve the site ID directly from the input.
  b. At the banner page, the banner has the same thing minus "?account=(siteID)". Therefore, i use REMOTE_HOST to lookup the site from a file.
 I need to know which to use. I'd recommend the first one; it's more reliable and it's faster. The only reason to use the second option is that it might be a bit easier for the webmasters to maintain.

2. Exactly where do you want me to store the information I get? You said that if the user clicks an email link on your page after clicking a banner, I should have the email subject be that the person clicked into your site from x banner. Might I suggest you do this slightly differently:
  a. When the person clicks the banner, have the CGI immediately send you an email containing as much info as I can gather from the browser. Then when the person enters the email page, have it ask a question like "How did you get to this site?".
  b. If that isn't good, how about letting the user enter the subject and I send the info from a hidden field instead of a line that the user could change?
 In fact, this time, I'd use the second option. But it's up to you. If you don't like either of these, could you explain your original idea a bit more fully? I don't quite understand it perfectly.
I like the second option: 2B:   I like the info coming from a hidden field.  

It sounds exactliy what I'd like.  The hidden field providing me as much info as you can get from the browser.  

And, if possible, I would like a carbon copy of that person's email to me also sent to the referring banner URL, letting them know that a person has sent me an email.  

Thanks!

Rowby
lemme see if I've got this right:

you like the hidden field with as much info as possible
you want a CC of the email you get sent to the correct website for the banner that was clicked.
that still leaves me in the dark about option one. do I do a file lookup from the HTTP_REFERER, or do I get the info from the banner click itself (QUERY_STRING)?
let me point out that using QUERY_STRING is much easier on me and the script will most likely execute faster using it.
It's weird.  I thought I answered your response.  But it didn't seem to appear.

I'd prefer 2B.  It's exactly what I'd want.  

And, at the same time, I would like (as I indicated in my original request), if possible, for an email to be sent to the referring URL -- taken from an email list that I would keep on my server.  It should be a blind carbon copy of the email that the person sends to me (if they choose to send me an email, that is) after they arrive on my web site.  And I like the idea that you have in 2B where it's sent from a "hidden field instead of a line that the user could changee".  That soulds perfect!

Thanks.  (And if my response is a duplicate, it's because I didn't see my submitted response here to your last response!)
I'm looking now at your 2:39 PM response, which for some reason did not appear until now.

Being a non  programmer I'm not sure what the difference is from a QUEERY STRING or a BANNER Refrerrer.

But I do know this.  I dont want to get an email every time someone clicks on my site. I only want to get an email when someone looks at my site, decides what I have to offer is something they're interested in.  And then they send me an email.  It is that email that I want to have the referring information included to me in the "hidden field".

I hope what I'm asking is the simple and easiest for you to do.

If not, maybe you need to help me understand the difference between the Querry and Referrer technique is.  

Thanks!

Rowby
For some reason when I'm reading this thread, occasionally responses are missing.  Now I have the complete thread and I realize what you wanted to know in your 2:40pm comment.

Go ahead and do the QUERY STRING.  That will be just fine.  I'm the only webmaster so I can handle the "paperwork".

Thanks!

Rowby
As far as the missing comments, maybe it's a trouble with reloading the page or something with EE, I don't know. I don't think it really matters much, as long as it comes out right in the end :-).

Let me list the feature list I've compiled based on your comments:

1. A click on a banner will record info from the browser and redirect to your main website page. That's all for then.
2. A click on an email link will send the user to a page where they can send an email.
  a. That form should have a hidden field with the info gathered from the banner click, if that person clicked on a banner. If not, just info on that person.
  b. If the persondid come from a banner, a BCC should be sent to the webmaster of the site of the banner that was clicked.
  c. The email will be sent to you with the fields the user filled out plus the hidden info I compiled.

As far as the difference between the QUERY_STRING and HTTP_REFERER techniques, it is thus:

1. Using QUERY_STRING, the webmaster of the bannered sites will link the banner like so: <A HREF="http://(your site)/cgi-bin/bannerclick.cgi?siteid=(that particular site's ID #, which we'll assign)>. My CGI will pickup the site ID directly and use that. It's easier on me that way, not to mention it will work with some very old browsers.
2. Using HTTP_REFERER. the webmasters will link the banner with: <A HREF="http://(your site)/cgi-bin/bannerclick.cgi>. My CGI will NOT pick up the site ID and will use HTTP_REFERER to do a URL lookup in a table (in a file) which will translate the URL to a site ID, which I will then use. It's harder on me, and the script might be slower, AND some very old browsers might not send HTTP_REFERER, but it is easier on the webmasters with your banner, because they won't have to keep track of their site ID.

Quite frankly, I'm glad you chose QUERY_STRING. It is the better option :-).

If you give me the OK on the stuff I outlined above (feature set), I'll be ready to get some real work done and should have the script ready within a week or two, probably less.

BTW, when you get notification that a comment has been added, but you don't see the new comment, try hitting the reload button in your Web browser.
Yes, I realize now that the reload/refresh button would have solved the mystery of the missing posts.

I've carefully read your description of what I want, and it is exactly what I need.  It all makes sense, especially when considering older browsers.

So I'm "officially" giving you the OK on your feature set of your 7:01 PM post.

And I (patiently) await the script.  And thank you again!

Rowby Goren
Pardon my next line of text please.

WHOOOOOPPPPPPEEEEEEEEEEEEEEEEEEEEEEEEEEE!!!!!!!!!!!!!!!!!!!!!!!!
Now back to our regularly scheduled comment.

Seriously though, it's good that we've finally agreed on exactly what should be done. I'll start working on it. I'll be mostly unable to test it, however (I don't have the facilities), so we'll have to go through a cycle of test/fix. Or, if you're using a UNIX server, giving me a login would be very helpful (I realize this could be a lot to ask. Ignore it completely if you aren't running your own server, if you're using an ISP's server. If you are, I won't ask you to give me your password. That would be silly. I think I have a UNIX shell account I can test it with; no guarantees.) In any case, I can give you a script; god only knows if i can give oyu a working script :-). Honestly, I'll write it and see where we go from there. Catch ya as soon as I have something we can try out.
WileyKat, send me email (when you're ready) and I'll give you the login and passowrd.

rowby@earthlink.net

Thanks, Rowby
You amazingly trusting and wonderful person ;-)

Seriously though, my email = macprogfreak@geocities.com
If you have ICQ (www.icq.com), my ICQ # = 12637347
So I paid 25 points to see the answer and the answer is not here?
What a rip-off! Is there any way to post the answer? This is not the intent of experts-exchange!
Sorry, ajtech.  I don't know how this thing works!  In any case, WileyKat is still working on the solution.  When he finishes it I'll be sure the answer is posted here.  Also, if you send me your email address I will notify/give you the answer.

rowby@earthlink.net
yes, I will post it here if it is not too big for my browser to put in the text box :). Otherwise rowby can email it to you, ajtech.
Everyone, I am reopening this request to everyone.  WileyKat has had to take care of other business, and is unable to finish this project at this time.  I've had some email exchanges with him, and we decided that reopening it would be the best thing to do.  WileyKat's solution seems to be the correct and best one, so I would welcome anyone stepping in and taking what appear to be just a few final steps to execute the solution.

Any takers?


(And sincere thanks to WileyKat, a very talented person indeed!!)

Rowby

P.S.  I hope I can simply reopen this question with this comment. If not, can someone tell me how to do it?


ironically, Rowby, I can answer that. (That's what I get for staying on the email notification list for this question :) In order to reopen the question, you must post a new question (with a reference to this one) to EE.