
Track who reads your news letters!
After sending out 9,000 news letter one day I wondered, geeze, how
many people actually read it? Well, after pondering the thought for 30
seconds I started writing this script that could be used to track a
newsletter on just about any system where you have access to the
database. Essentially what this does is track how many people request
the logo in your news letter (HTML news letters only) and along with
that I also attach a record number so I can tell who requested it... neat
right, now we know how many, who and when!
Required:
1) ASP JPeg by Persits
http://www.aspjpeg.com/ (you use some other form of image processor
and change code)
2) Access to update and change your news letter email address database.
(could be any type of DB really)
3) HTML News Letters only.
NewsTracker database... build it any way
you too but for my example below I have used MS SQL and built a table as
follows.
Call the database news Tracker (dah!)
Copy paste this into query analyzer to build the table:
Should look like this:
id = int (auto number)
tracker_date = datetime (default date using getdate())
tracker_count = int (default 0)
The basic way:
Let's begin, the only thing that needs to be present in your news letter is
an image tag like this:
<a href="http://www.YourWebSite.com">
<img border="0" src="http://www.YourWebSite.com/newstracker.asp"
</a>
The More Advanced Option:
The above will only count how many times the news letter is read...
lets go a little further!
<a href="http://www.YourWebSite.com">
<img border="0" src="http://www.YourWebSite.com/newstracker.asp?userid=USER_ID_HERE">
</a>
By knowing that the image above is being requested with this unique
URL we can update the user's record that he has read the news letter and
when he read it!
USER_ID_HERE = ID # of the user you are sending the news letter to,
for example, when my news letter script is sending out news letters it
simply does a record loop sending out news letters one at time until
there are no more records left to process so during the loop I simply
have the script write in the record ID of the user it currently sending
to.
Tracking by user will require an additional field in your news letter
database... I called the field last_read and it is datetime data type.
Save this file as newsletter.asp in the root of your web.
The monitering page:
That's really about it... pretty simple and it works great!
|