Solved

Email/Image Tracking

Posted on 2003-10-27
5
247 Views
Last Modified: 2013-12-25
Hi all-
  I have very little perl/cgi experience, but I have built a coldfusion application that allows for bulk email marketing and managing, and I was curious as to how to set up a tracking system for the emails being sent through my application.  In basic form, I would like to have a log that shows who and how many opened the email, if possible, I would like to go further and have these stats available for display by our clients.

Any help would be great-
thanks-
-m
0
Comment
Question by:macromike
  • 3
  • 2
5 Comments
 
LVL 1

Expert Comment

by:robysath
ID: 9635002
I hope this is not spam messaging related! :)

You can send an html message with an image. The url for the image should point to a perl script on your web-site. This perl script can determine all the information about the user when they connect to retrieve the image data.
0
 

Author Comment

by:macromike
ID: 9635181
That is exactly what I want to do, I tried browsing through the cgi resource, but a lot of the scripts there seemed more complex than what I needed.  Do you have a sample url I could use to learn from? or an example script?

Thanks-
-m
0
 
LVL 1

Accepted Solution

by:
robysath earned 500 total points
ID: 9635777
Shouldn't be hard:

#!/usr/local/bin/perl

$today = `date`;

# Hey, let's remember some info about this person
open(FILE, ">>info.txt");
print FILE "$today\n";
print FILE "REMOTE_ADDR: $ENV{'REMOTE_ADDR '}\n"';
print FILE "HTTP_USER_AGENT: $ENV{'HTTP_USER_AGENT'}\n";
print FILE "HTTP_REFERER: $ENV{'HTTP_REFERER'}\n";
print FILE "--------------------------------------------------\n";
close(FILE);

# Ok send them the image
open(FILE, "/path/to/image.gif");
@file=<FILE>;
close(FILE);
print "Content-type: image/gif\n\n";
print @file;

You can then parse through the gathered data in info.txt

Example of REMOTE_ADDR: 192.75.116.16
You can do a reverse lookup to find out what domain the user is from. Then write perl code to get stats of all the domains.

Note sure how useful HTTP_REFERER is if they are reading their e-mail from Microsoft Outlook Express or the like.

Example of HTTP_USER_AGENT: Mozilla/4.0 (compatible; MSIE 5.5; Windows NT 4.0)
You can write perl code to determine the most popular browser and Operating System.

There are probably lots of other environment variables you can store and gather statistics on, have a look on google for a possible list or check ur server with this code:

foreach $key (keys(%ENV))
{
  print "<p>$key = $ENV{$key}</p>\n";
}
0
 

Author Comment

by:macromike
ID: 9659226
And then what do I put in for my image link in my email?  Thanks for all the help, you are the man! let me know if you need some actionscript help ;-).
0
 
LVL 1

Expert Comment

by:robysath
ID: 9661320
Send your e-mail in html form with

<img src="http://www.yourserver.com/path/to/image.gif">
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction:   Welcome to my first article ever. To begin with, the reason I write this article.  I participated in a question on Experts Exchange about the start command in Windows and there were some discussion about the usage. The discussio…
Recently I have been answering a lot of questions like this in IT forums that I frequent. The question posed is usually something along the lines of "We have software X installed and need to uninstall it for reason Y" or some other variant of the sa…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now