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
php /your/directory/update-country.php > /dev/null 2>&1
Time Interval: */15 * * * *
*/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 love how users can create their own extra code to enhance Sendy -- well done @gavn8r.
Would the image pixel idea involve amending the existing Sendy code? Not ideal for amateur/non-coders.
@colcol Regarding the creation of the image pixel, I would say it only needs a new PHP page and probably also a new line in the .htaccess file. Existing Sendy code wouldn't need to be amended.
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.
@gavn8r Thanks. I understand that some products are country-specific. I'm just under an impression that the majority of people hardly keep relocating between countries.
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.
That's something I didn't know. Thanks for that clarification, Ian.
You're welcome, gavn8r.
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?
Nice mod, thanks! Its very resource intensive with huge lists. I changed the cron to run daily instead of every 15 minutes.
Does this work with Sendy 4?
Does anyone have a copy of this code? I get a 404 for that google doc.