Solved

Email/Image Tracking

Posted on 2003-10-27
5
251 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to make a simple HTML bar chart with the usage of WhizBase, If you want more information about WhizBase please read my previous articles at http://www.experts-exchange.com/ARTH_5123186.html (http://www.experts-ex…
This article will show, step by step, how to integrate R code into a R Sweave document
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

828 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