PHP Developers Network
http://forums.devnetwork.net/

Swift Mailer and Newsletter Stats
http://forums.devnetwork.net/viewtopic.php?f=52&t=136418
Page 1 of 1

Author:  Pavilion [ Wed Aug 08, 2012 2:56 pm ]
Post subject:  Swift Mailer and Newsletter Stats

Hello:

One of my clients is interested in newsletter processing capabilities. I've done enough testing to know that I can build the ability to manage addresses, send emails, etc...

But... is it possible for SwiftMailer or phpMailer to track:
  1. Count of emails opened?
  2. Number of links clicked and followed to their website?
  3. Email addresses of those folks who open &/or click on links?

Thanks in advance - Pavilion

Author:  tr0gd0rr [ Thu Aug 09, 2012 1:43 pm ]
Post subject:  Re: Swift Mailer and Newsletter Stats

To track those things, you need to embed links that go to a web site you control. Email opens can be tracked using a 1x1 pixel gif with a special URL that ties that newsletter to that recipient. For example: `http://example.com/open/abcdefghijklmnopqrstuvwxyz`. You look up the abc... part in your database and mark the email as opened.

Same for links. You need to rewrite the links so they go to your site with a special URL that ties that link in that newsletter to that recipient. For example: `http://example.com/link/abcdefghijklmnopqrstuvwxyz`. So you look up the abc... part in your database, get the proper destination url, and forward the user to that destination.

You can also use a service like SendGrid which will insert tracking images and rewrite links for you, but then you have to connect to their api to pull the data from them into your system.

Author:  Pavilion [ Thu Aug 09, 2012 8:00 pm ]
Post subject:  Re: Swift Mailer and Newsletter Stats

tr0gd0rr wrote:
To track those things, you need to embed links that go to a web site you control. Email opens can be tracked using a 1x1 pixel gif with a special URL that ties that newsletter to that recipient. For example: `http://example.com/open/abcdefghijklmnopqrstuvwxyz`. You look up the abc... part in your database and mark the email as opened.

Same for links. You need to rewrite the links so they go to your site with a special URL that ties that link in that newsletter to that recipient. For example: `http://example.com/link/abcdefghijklmnopqrstuvwxyz`. So you look up the abc... part in your database, get the proper destination url, and forward the user to that destination.

You can also use a service like SendGrid which will insert tracking images and rewrite links for you, but then you have to connect to their api to pull the data from them into your system.


Hello tr0gd0rr:

Thanks for responding. You are confirming what I've read elsewhere. I take it Swift Mailer and/or phpMailer does not have any type of scripting already built for these functions?

I understand if they don't. It simply means learning other techniques. But, it makes sense to find out in advance if these capabilities already exist somewhere.

Thanks again - Pavilion

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/