Get answers quicker by searching

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

[Mod] Update User Country Code by Campaign Opens - Sendy Version 3.0.9.1
  • Vote Up0Vote Down gavn8rgavn8r
    Posts: 7Sendy user

    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.

  • 9 Comments
  • Vote Up0Vote Down IanIan
    Posts: 15Sendy user

    Thanks for your contribution. I'm curious and have two questions. Could you kindly advise?

    1. 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?

    2. 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

  • Vote Up0Vote Down colcolcolcol
    Posts: 16Sendy user

    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.

  • Vote Up0Vote Down IanIan
    Posts: 15Sendy user

    @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.

  • Vote Up0Vote Down gavn8rgavn8r
    Posts: 7Sendy user

    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.

  • Vote Up0Vote Down IanIan
    Posts: 15Sendy user

    @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.

  • Vote Up0Vote Down IanIan
    Posts: 15Sendy user

    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.

  • Vote Up0Vote Down gavn8rgavn8r
    Posts: 7Sendy user

    That's something I didn't know. Thanks for that clarification, Ian.

  • Vote Up0Vote Down IanIan
    Posts: 15Sendy user

    You're welcome, gavn8r.