I have been using GeotargetingWP plugin to geotarget on my website and it has been working ok up until now, when suddenly TTFB has taken a big hit. Never had a problem with it before but yeah…
So now I noticed Cloudflare has a geotargeting feature which means I might not need a plugin? Can I use this to geotarget certain sections on each page? For example, display one table on a page for UK visitors and another table for US visitors?
Thank you. How do you actually serve it though? With GeotargetingWP plugin it is very simple, I just add shortcodes like [geo UK]text here[/geo UK] or [geo exclude UK]text here[/geo exclude UK]
Aside from that, you can use PHP to parse the CF-IPCountry header mentioned by @KianNH to get the visitor’s country code and do/show whatever you want based on that.