It looks like you're new here. If you want to get involved, click one of these buttons!
I love how campaign reports in Sendy show the countries that users are in when they open an email. I wanted to have the country code inside the subscribers table updated each time a subscriber opens an email so I can have updated segments, which I've created by country.
I'm an amateur coder, and created a PHP file to accomplish this goal.
Download it here: https://drive.google.com/open?id=1h2BgHJLNQdwJtl-5Ax0qzYk8DxAMab6B
Install it by uploading it into your Sendy root directory.
Set a cron job to call the php file:
Command: php /your/directory/update-country.php > /dev/null 2>&1
Time Interval: */15 * * * *
Use at your own risk. It's working perfectly for me.
Thanks for your contribution. I'm curious and have two questions. Could you kindly advise?
Is this feature created mainly to use on subscribers who travel a lot and to know which countries they are traveling to? Are there other use cases?
What's your consideration of using cron job to do the task every 15 minutes rather than using an embedded-in-email image pixel (which would update each subscriber's country only when he/she opens an email)?
The image pixel idea sounds more efficient IMO
I like the idea of the image pixel. That's beyond my capability, I think. I'd love it if someone more talented could pick up the ball and run with it.
The reason I did it in the first place was simply to be able to send different messages to people in different geographies. My client has offers that are territory-specific. The reason for the 15 minute interval was completely arbitrary. It could be set up to update less frequently.
Besides, lots of people use Gmail. And Google caches images (including Sendy's tracking image pixel) on their servers. So sometimes after you test opening an email sent by Sendy, you check the statistics and see the email was opened in PH (Philippine). That's because that Sendy's tracking image pixel was cached on Google's Philippine server. Therefore country detecting done by the tracking image pixel isn't always reliable.
I've just added this and I have to say it has a superb use case for me. Our clients are predominantly in the Middle East, where people frequently travel and can be gone for months at a time before returning. This is a game-changer for one of my clients.
However, setting the cron to once per week is plenty for now.
This is interesting, thanks for the contribution! I've just added automated capture of country on the signup form, so brand new users have their country stamped into their records. Older ones don't, though; and this seems a nice way to quickly add this data.
Question: if User A has their subscriber country set to "Australia" but opens an email from a "Canada" IP address, does it say "Canada" or "Australia" in the campaign dashboard for that email?
Does this work with Sendy 4?
Does anyone have a copy of this code? I get a 404 for that google doc.