Restricting traffic by country

Short description of issue

Recently, we have see a huge spike in sessions from China (a country we do not sell to). This new traffic is now making up about 2/3 of all sessions on our store. Since it’s clearly not legit, I would like to block it.

Link to Shopify Store

Reproduction steps

Create an analytics report that is showing sessions over time, grouped by country.

Additional info

I have reached out to Shopify Plus support about this since our domain is managed through Shopify. I know Shopify uses Cloudflare for routing and since Geo restriction is a feature of Cloudflare, I was hoping this is something that could be enabled for our store but they told me that that is not an option. I asked them about transferring management of our domain to our own Cloudflare account so we could manage this type of thing ourselves and they strongly recommended against that since it’s not supported and has been known to cause SSL and other technical issues.

That is basically where they left it. Yes, there is an issue and yes, being able to restrict this unwanted traffic would be a great feature their support team can share with the developer team but besides that, we’re basically out of luck. Since I don’t see that as a resolution to my issue, I wanted to put it out into the Dev community to see if anyone else who has run into this in the past could suggest a working solution.

What type of topic is this

Troubleshooting
Feature request
General discussion

Hi @Jeff_Nelon

Have you seen this doc on Cloudflare’s site that shows how to proxy through Cloudflare even with using Shopify?

Then with the Cloudflare WAF, you can disable individual geolocations.

@Dylan , I did but was trying to avoid the nameserver change on Shopify’s recommendation. it may still come to that but in the meantime, found an app that works pretty well. Most of the apps I tried are more built around routing geo traffic but this one actually seems to work at blocking it entirely which is what I wanted. Would still be nice if Shopify had a native way to manage this but for now, this seems to be working.