Backlog Request - GEO Location (Liquid Variable)

Hey @Peter-Schmidt backlog request to have a GEO Location variable, similar to BC’s globals tag.

At the very least, using {{request.country}} which would output the shortened country name (i.e. CA, US, etc.), or the full name, and also {{request.city}} which would output the city name.

I have 3 sites that use this BC functionality so will definitely need this ASAP if bringing over to Treepl.

Thanks,
Aaron

Sure thing @A3CS - Added here:
https://treepl.co/public-backlog-state/geo-location-liquid-variable

Sorry for my late reply, have been away on holiday :snowboarder: :slight_smile:

Thanks @Peter-Schmidt

@A3CS - Hey Aaron.
Was playing around with the new JSON “component” and stumbled over something that might solve your problem. If you do a call to “https://ip-api.com” with the users IP address you would have some of the things available in liquid that you need. Maybe it could work as some sort of a workaround until this is implemented.

I guess this one I found has restrictions for the free version but they do have a pro version. Maybe there are other (cheaper) solutions, but just found this on a list of public APIs (https://github.com/public-apis/public-apis) and though it was interesting.

You can try it out with this to see what you get :slight_smile:

{% component type: "json", source_type:"url", source:"http://ip-api.com/json/{{request.request_data.ip}}", layout:"", collectionVariable:"jsonTest" %}
{{jsonTest}}

EDIT: This seems quite nice with a lot of details, and it seems there is “no” limit for free it seems: https://ipgeolocationapi.com/

If you check their status on the page it doesn’t seem that they have had any downtime in the recent months so maybe that is not to bad for a free solution :+1:

1 Like

Oh that is cool, thanks for sending this! Will definitely check it out.

Totally works! Thanks Peter

No worries Aaron! :+1: