Title: Help with Canada Detection Code
Last modified: December 26, 2019

---

# Help with Canada Detection Code

 *  [adminpoumie](https://wordpress.org/support/users/adminpoumie/)
 * (@adminpoumie)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/help-with-canada-detection-code/)
 * Hi – we have GEO IP detection hooked to say no tax in states outside of Illinois
   and it works beautifully, however, I want to add some code to detect Canada and
   say our flat rate shipping. I am using a VPN to test and when I goto Canada I
   am not seeing the text I want, which is this code: [geoip_detect2_show_if country
   =”CA”]Flat Rate $15 Canada Shipping[/geoip_detect2_show_if]
 * Here is our current code that is working – and my new code that doesn’t show:
   
   [http://prntscr.com/qg4sc7](http://prntscr.com/qg4sc7)
 * This is to show that the one code is working:
    [http://prntscr.com/qg4spj](http://prntscr.com/qg4spj)
 * here is our data source selection:
    [http://prntscr.com/qg4tbr](http://prntscr.com/qg4tbr)
 * Any help as to why the Canada code isn’t working would be most helpful – thank
   you
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fhelp-with-canada-detection-code%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 4 replies - 1 through 4 (of 4 total)

 *  [douglasuk](https://wordpress.org/support/users/douglasuk/)
 * (@douglasuk)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/help-with-canada-detection-code/#post-12275756)
 * (I am **not** associated with the developers.)
 * First thing I’d do is test it, if you can, by putting your own country code in
   and trying it not over the VPN. You could also put some temporary code somewhere
   that shows the country the browser believes you are in:
    [geoip_detect2 property
   =”country.name” default=”an unknown country” lang=”en”] or even better just tuck
   this somewhere discreet temporarily: [geoip_detect2 property=”country.isoCode”
   default=”**”]
 * That will at least reassure you that you are ‘in’ the country you think you are.
 * Other than that, I note that you are trying to show both texts if the user is
   in Canada; both the ‘No tax charged in’ and the ‘Flat rate … shipping’. Yet you
   are getting _neither_. So the problem might not be with the second text at all,
   but that the first is coming up empty and shoving the second notice out of sight?
 * Just some thoughts.
 *  Thread Starter [adminpoumie](https://wordpress.org/support/users/adminpoumie/)
 * (@adminpoumie)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/help-with-canada-detection-code/#post-12287273)
 * Thanks for your help – I tried adding US instead of CA and also added your code–
   still got nothing: [https://prnt.sc/qikw16](https://prnt.sc/qikw16)
 * also tried deleting the other non-firing part to see if it was pushing down but
   its not.
 * Any other ideas would be great thanks again.
 * Also – that code is there [geoip_detect2 property=”country.isoCode” default=”**”]
   how can we use that?
 *  Thread Starter [adminpoumie](https://wordpress.org/support/users/adminpoumie/)
 * (@adminpoumie)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/help-with-canada-detection-code/#post-12287532)
 * ok – so some progress – my state is blocked – so when I did vpn from another 
   state – I got all the messages 🙂
 * [https://prnt.sc/qim8jh](https://prnt.sc/qim8jh)
 * so now what? this confirms the country code works? If I set to CA then should
   it show in canada?
 * Thanks for your help
 *  Thread Starter [adminpoumie](https://wordpress.org/support/users/adminpoumie/)
 * (@adminpoumie)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/help-with-canada-detection-code/#post-12287540)
 * I think the div ID may only be showing in US?
 * [https://prnt.sc/qim9sm](https://prnt.sc/qim9sm)

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Help with Canada Detection Code’ is closed to new replies.

 * ![](https://ps.w.org/geoip-detect/assets/icon-256x256.jpg?rev=978998)
 * [Geolocation IP Detection](https://wordpress.org/plugins/geoip-detect/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/geoip-detect/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/geoip-detect/)
 * [Active Topics](https://wordpress.org/support/plugin/geoip-detect/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/geoip-detect/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/geoip-detect/reviews/)

## Tags

 * [canada](https://wordpress.org/support/topic-tag/canada/)
 * [geo-ip](https://wordpress.org/support/topic-tag/geo-ip/)
 * [IP detection](https://wordpress.org/support/topic-tag/ip-detection/)

 * 4 replies
 * 2 participants
 * Last reply from: [adminpoumie](https://wordpress.org/support/users/adminpoumie/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/help-with-canada-detection-code/#post-12287540)
 * Status: not resolved