Thanks for reaching out in our Community forums and for sharing your concern, I’d be happy to provide some alternative methods for you to consider.
I understand that you are looking to implement a solution that will filter the content on your site on a country to country basis. This is completely possible through code adjustments and third party apps. If you would like some hands on assistance, contactingShopify Experts would be a great idea. This is a marketplace that connects you to professionals in a variety of fields related to your e-commerce business. Doing so will allow you to outline your exact requirements and specifications to set this up on your store. If you would like to know more about finding the right Expert,please click here.
You can also look to introduce an app that will allow you to set country specific content, products, collections, locations, and currency without requiring multiple stores and redirects. So, if you’re wanting a customer from a certain country would only be able to view a specific blog that is available to their region. You can check out an app called Advanced Store Localization which may offer the functionalities necessary for you to accomplish this, or browse our other Geolocation apps that offer similar functionalities.
I’d love to know more about your business! What type of products are you selling and how are you planning to market them to multiple regions?
I know this is an old post, but I thought I’d give my input on the topic as the response you got wasn’t very helpful from the experts. And as I’ve just had the same issue, I found the code you provided to work just fine.
I think what your issue may have been, is that the country wasn’t really selected - therefore the generic content was shown? Or it’s not necessarily a ‘visitor of the country’ that gets shown the content, it’s the country you have actually selected that you’re ordering to.
Meaning if you tested that code and had a ?country=NL in your URL, or manually changed/forced the country selection to be Netherlands - it’d show. But this is only from my understanding if the country selection is a part of a market that can genuinely be selected. The ?country=XX / manual selection won’t work on my Shopify store for countries that are not in the market. Hope that makes sense!