<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Retrieve visitor country code?]]></title><description><![CDATA[<p dir="auto">Is it possible to get the visitors country from the back-end?</p>
<p dir="auto">I know it's available from CloudFront-Viewer-Country and can be passed to the Lambda.</p>
]]></description><link>https://community.appdrag.com/topic/352/retrieve-visitor-country-code</link><generator>RSS for Node</generator><lastBuildDate>Mon, 14 Sep 2026 23:46:12 GMT</lastBuildDate><atom:link href="https://community.appdrag.com/topic/352.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 10 Sep 2020 07:45:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Retrieve visitor country code? on Thu, 03 Dec 2020 07:14:13 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.appdrag.com/uid/2">@Wassim</a></p>
<p dir="auto">Super, then I don't need to worry about that <img src="https://community.appdrag.com/plugins/nodebb-plugin-emoji/emoji/android/270c.png?v=lfk1vimvd74" class="not-responsive emoji emoji-android emoji--v" title=":v:" alt="✌" /></p>
]]></description><link>https://community.appdrag.com/post/2087</link><guid isPermaLink="true">https://community.appdrag.com/post/2087</guid><dc:creator><![CDATA[ThomasD]]></dc:creator><pubDate>Thu, 03 Dec 2020 07:14:13 GMT</pubDate></item><item><title><![CDATA[Reply to Retrieve visitor country code? on Thu, 03 Dec 2020 07:06:23 GMT]]></title><description><![CDATA[<p dir="auto">@Thomas-Djärf said in <a href="/post/2082">Retrieve visitor country code?</a>:</p>
<blockquote>
<p dir="auto">Wanted to detect the country so I can apply the correct language automatically.</p>
</blockquote>
<p dir="auto">Yes language is automatically detected and a cookie "lng" is set. Then it depends on your page translations from the page builder.</p>
]]></description><link>https://community.appdrag.com/post/2086</link><guid isPermaLink="true">https://community.appdrag.com/post/2086</guid><dc:creator><![CDATA[Wassim]]></dc:creator><pubDate>Thu, 03 Dec 2020 07:06:23 GMT</pubDate></item><item><title><![CDATA[Reply to Retrieve visitor country code? on Wed, 02 Dec 2020 15:34:42 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.appdrag.com/uid/9">@Daniel-Mulroy</a></p>
<p dir="auto">Wanted to detect the country so I can apply the correct language automatically.</p>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.appdrag.com/uid/2">@Wassim</a> Maybe that is already done?</p>
<p dir="auto">Google seem to be very picky about localization:</p>
<p dir="auto"><a href="https://developers.google.com/search/docs/advanced/crawling/managing-multi-regional-sites" rel="nofollow ugc">https://developers.google.com/search/docs/advanced/crawling/managing-multi-regional-sites</a></p>
]]></description><link>https://community.appdrag.com/post/2082</link><guid isPermaLink="true">https://community.appdrag.com/post/2082</guid><dc:creator><![CDATA[ThomasD]]></dc:creator><pubDate>Wed, 02 Dec 2020 15:34:42 GMT</pubDate></item><item><title><![CDATA[Reply to Retrieve visitor country code? on Sat, 19 Sep 2020 16:27:22 GMT]]></title><description><![CDATA[<p dir="auto">Can you help me understand the use-case a bit more? Maybe I'll get a flash of inspiration if I know more about what you're trying to do <img src="https://community.appdrag.com/plugins/nodebb-plugin-emoji/emoji/android/1f642.png?v=lfk1vimvd74" class="not-responsive emoji emoji-android emoji--slightly_smiling_face" title=":)" alt="🙂" /></p>
]]></description><link>https://community.appdrag.com/post/1386</link><guid isPermaLink="true">https://community.appdrag.com/post/1386</guid><dc:creator><![CDATA[Daniel Mulroy]]></dc:creator><pubDate>Sat, 19 Sep 2020 16:27:22 GMT</pubDate></item><item><title><![CDATA[Reply to Retrieve visitor country code? on Fri, 18 Sep 2020 09:10:48 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.appdrag.com/uid/9">@Daniel-Mulroy</a></p>
<p dir="auto">Glad you wrote that!</p>
<p dir="auto">I looked for it using the "Try" feature, but that doesn't return the CloudFront headers. I would have missed it for sure.</p>
<p dir="auto">Problem is, this will eat up the back-end quota instantly because every visitor would need to execute it...</p>
]]></description><link>https://community.appdrag.com/post/1381</link><guid isPermaLink="true">https://community.appdrag.com/post/1381</guid><dc:creator><![CDATA[ThomasD]]></dc:creator><pubDate>Fri, 18 Sep 2020 09:10:48 GMT</pubDate></item><item><title><![CDATA[Reply to Retrieve visitor country code? on Mon, 14 Sep 2020 15:41:55 GMT]]></title><description><![CDATA[<p dir="auto">In case you haven't found this out yourself yet, you can access it from within a CloudBackend function using:</p>
<pre><code>event["HEADERS"]["CloudFront-Viewer-Country"]
</code></pre>
<p dir="auto">Hope this helps!</p>
]]></description><link>https://community.appdrag.com/post/1368</link><guid isPermaLink="true">https://community.appdrag.com/post/1368</guid><dc:creator><![CDATA[Daniel Mulroy]]></dc:creator><pubDate>Mon, 14 Sep 2020 15:41:55 GMT</pubDate></item><item><title><![CDATA[Reply to Retrieve visitor country code? on Thu, 10 Sep 2020 11:53:36 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="https://community.appdrag.com/uid/9">@Daniel-Mulroy</a></p>
<p dir="auto">Yeah, I can use a GeoIP lookup service since the IP is in the headers.</p>
<p dir="auto">Just thought I'd avoid the extra cost since it's already available in AWS.</p>
]]></description><link>https://community.appdrag.com/post/1334</link><guid isPermaLink="true">https://community.appdrag.com/post/1334</guid><dc:creator><![CDATA[ThomasD]]></dc:creator><pubDate>Thu, 10 Sep 2020 11:53:36 GMT</pubDate></item><item><title><![CDATA[Reply to Retrieve visitor country code? on Thu, 10 Sep 2020 11:46:16 GMT]]></title><description><![CDATA[<p dir="auto">You could try looking in the headers. If not, the best thing to do would probably do a Geo IP lookup, you can indeed get the IP from the backend. I don't think browser headers send country code, they barely send timezone info <img src="https://community.appdrag.com/plugins/nodebb-plugin-emoji/emoji/android/1f609.png?v=lfk1vimvd74" class="not-responsive emoji emoji-android emoji--wink" title=";)" alt="😉" /></p>
<p dir="auto">I think I have code for extracting the IP address if you need it, but if you print all the headers from the request you should see how to access it.</p>
<p dir="auto">Cheers <a class="plugin-mentions-user plugin-mentions-a" href="https://community.appdrag.com/uid/208">@ThomasD</a></p>
]]></description><link>https://community.appdrag.com/post/1330</link><guid isPermaLink="true">https://community.appdrag.com/post/1330</guid><dc:creator><![CDATA[Daniel Mulroy]]></dc:creator><pubDate>Thu, 10 Sep 2020 11:46:16 GMT</pubDate></item></channel></rss>