0

I have created a email marketing tool in Codeigniter, I am able to track whether the email was opened and were the links clicked.

Onclick of links I am inserted the IP, the URL(which was clicked from the email newsletter) in cookies and the opened_datetime in the database .

The links would be only from our company website, I wrote a cron that will fire a ajax event on window unload event, that will pull the IP and URL from users cookies and update the record by matching IP and URl and the closed_datetime.

The issue is that the unload event does not get fired everytime.

Need a solution to it.

Kamlesh Katpara
  • 373
  • 2
  • 8
  • 31
  • Sounds like you're attempting to reinvent Google Anayltics. I'd suggest using that instead, with UTMs on your email links so you can track users. – Rory McCrossan Jan 05 '18 at 09:54
  • @RoryMcCrossan My Company does not want to go for Google Analytics. I have almost completed this application. Just missing on this unload event. – Kamlesh Katpara Jan 05 '18 at 09:57
  • `I wrote a cron that will fire a ajax event`, Why? use directly javascript `onunload` and `onbeforeunload`: https://stackoverflow.com/a/3888938/2275490 – Vickel Jan 05 '18 at 20:03

0 Answers0