Hi
I have a newsletter app running through php/mysql which has a sub/unsubscribe function and can deliver emails to the subscriber list in either html or straight text.
I want to expand my app so that I can track on the delivery/opened/links/campaign number/clicked thros etc of the email.
The tracking needs to be inserted into the database and be able to be queried for results/logs etc.
Im not too sure where to start looking for information, or even if I should be looking at javascript/php for the answer.
Can anyone point me in the right direction? ideas? links? articles?
Thanks in advance for any assistance offered.
Voddie
Tracking of html emails
Moderator: General Moderators
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
sounds like you are a *shudder* SPAMMER! ah well i guess we are all sinners.
the best way to do the tracking of if the email was opened is to have a image that is 1px by 1px in the page and have it as a php like like
that way the person has to make a request to your server to get that information and then you can track the users IP address that opened the email and the email address that opened it and all of that happy stuff. then just store it in your db and run some querys to get that info out
the best way to do the tracking of if the email was opened is to have a image that is 1px by 1px in the page and have it as a php like like
Code: Select all
<img src="e;www.site.com/index.php?email=the_email_this_is_sent_to@server.com"e;>Hi Shiznatix
We all have to make a living, but id dont like to think of spamming anyone, least of all my newsletter subscribers.
I came across that way of tracking, quite crude really, but wanted something a little more effective like what time they opened, whether it was deleted, what links they clicked so as to make my newsletter more receptive of their needs.
I see thousands of companies offering this as a professional service, so the coding logic behind must be available, if only in description.
I searched under different terms to no avail, I just want to know how they do it using php and maybe javascript.
Cheers anyway
Voddie
We all have to make a living, but id dont like to think of spamming anyone, least of all my newsletter subscribers.
I came across that way of tracking, quite crude really, but wanted something a little more effective like what time they opened, whether it was deleted, what links they clicked so as to make my newsletter more receptive of their needs.
I see thousands of companies offering this as a professional service, so the coding logic behind must be available, if only in description.
I searched under different terms to no avail, I just want to know how they do it using php and maybe javascript.
Cheers anyway
Voddie
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
ya i understand but i gave you a perfect way of how to do it. you make a image like this
then on site.com/index.php
i dont have time to write you a entire script but you can do the same style of stuff for the links the clicked on (if it is a link to a page on your server) and everything else. so do you get the idea?
Code: Select all
<img src="e;www.site.com/index.php?email=the_email_this_is_sent_to@server.com"e; height="e;1"e; width="e;1"e;>Code: Select all
if (isset($_GET['email']))
{
$ip = $_SERVER["REMOTE_ADDR"];
$email_address_that_opened_email = $_GET['email'];
$query = '
INSERT INTO
table_name_here
(ip, time, email)
VALUES
("'.$ip.'", now(), "'.$email_address_that_opened_email.'")
';
$do_query = mysql_query($query) or die(mysql_error().__LINE__);
}
//then if you want to query from the table
$query = '
SELECT
*
FROM
table_name_here
WHERE
email="'.$some_email_address.'"
';
$do_query = mysql_query($query) or die(mysql_error().__LINE__);
while ($info = mysql_fetch_assoc($do_query))
{
echo 'IP Address: '.$info['email'].'<br>';
echo 'Time: '.$info['time'].'<br>';
echo 'Email: '.$info['email'];
}This method WILL NOT be 100% accurate...a lot of email programs DO NOT automatically download additional email content i.e. images unless you tell it to do so.shiznatix wrote:sounds like you are a *shudder* SPAMMER! ah well i guess we are all sinners.
the best way to do the tracking of if the email was opened is to have a image that is 1px by 1px in the page and have it as a php like likethat way the person has to make a request to your server to get that information and then you can track the users IP address that opened the email and the email address that opened it and all of that happy stuff. then just store it in your db and run some querys to get that info outCode: Select all
<img src="e;www.site.com/index.php?email=the_email_this_is_sent_to@server.com"e;>