I am using this code to find the IP address of the user. I then want to send this to a service using API to find the country they’re visiting from.
Based on this information, I want to display different sections using Conditional Logic.
My first step is to get a valid response to my API.
If i hard-code the IP address into the API endpoint, I get a valid result
However, if I substitute the IP address with the shortcode [display_IP], I get an invalid result even though the request URL seems to be the same as before.
I tried this with different API providers, with the same result.
Is there a better way to accomplish what I’m trying to achieve? Is there a reason the IP address using the shortcode is returning an error, even though the IP address returned is the same?