Foreign visitor, different stock location and prices

Hello,

We have a store with 2 locations (EU and US),

We are trying to show / hide the “Add to cart” button based on the visitor IP address location.

So far what we have achieved:

  1. get the country by AJAX
  2. import locations quantities in the metafields
  3. send the country to a local server through a proxy

But now I don’t figure out how to inject somewhere in the pages the proxy response e.g. {“country”: “FR”}, and if I can inject it, can it be used as a Liquid element?

Thanks