Skip to content

Instantly share code, notes, and snippets.

@zuzannamj
Created October 25, 2019 09:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zuzannamj/992ecb8436fb7ff1f8d3cdf8bef0e4d1 to your computer and use it in GitHub Desktop.
Save zuzannamj/992ecb8436fb7ff1f8d3cdf8bef0e4d1 to your computer and use it in GitHub Desktop.
<script type="javascript" runat="server">
Platform.Load("core","1");
var ip = Platform.Request.ClientIP();
var apiKey = '' //insert apiKey obtained from https://geo.ipify.org/subscriptions
var url = 'https://geo.ipify.org/api/v1?apiKey=';
var response = HTTP.Get(url + apiKey + ip);
Write("response.Status: " + response.Status + '<br />');
Write("response.Content: " + response.Content);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment