jdavidbakr / mail-tracker

Package for Laravel to inject tracking code into outgoing emails.
MIT License
562 stars 129 forks source link

Avoid logging open & click from bots #228

Closed louis-l closed 5 months ago

louis-l commented 11 months ago

Hi there,

Thanks for the awesome package. We are using this to send out newsletter and track the open/click stats. However, I realised recently that whenever an email is sent, some email clients are trying to scan the links, which triggers as an open/click.

It'd be nice to have a config to filter out those actions or at least a way to hook into the flow so other people could implement their own filtering logic as well.

Thanks.

bretto36 commented 5 months ago

@louis-l - would you be using the User Agent to determine whether it's a bot or some other mechanism?

louis-l commented 5 months ago

@bretto36 I think so, unless there is better way

bretto36 commented 5 months ago

I think a great way to do it might be to have another event and then each person can implement their own technique for skipping the tracking.

Would that work for you? Then you could do IP or user agent or even a timing thing. If you get a click within the first 30 seconds of sending that could indicate it's a spam checker

louis-l commented 5 months ago

@bretto36 That'd be great. Long as we can hook into that and maybe set a flag to skip the tracking.

bretto36 commented 5 months ago

@louis-l see the PR #242

louis-l commented 5 months ago

@bretto36

That was quick, tyvm 🙏 Will give it a try soon.