Expected values for address.country_code

RAd_Tag_Team
New Member
2 0 1

Hi!

I searched for an answer but couldn't find a similar question. I am curios if there is a list of expected country codes for the "Shopify.checkout.shipping_address.country_code" property?

We use it to decide whether we need to deduct a certain tax rate from prices in our Rakuten Advertising conversion tracking code. So far we have used "UK" to check for orders from the UK and to deduct 20% VAT. After seeing tracking discrepancies we saw that sometimes the country code "GB" was used.

Can anyone confirm if both "UK" and "GB" codes are used for UK orders or only "GB" or only in certain instances?

This will help us to improve accuracy in our tracking which clients implement in Shopify.

Thanks!

Rakuten Advertising

 

RAd_Tag_Team
New Member
2 0 1

I think I can answer my own question now stumbling upon: https://www.shopify.com/partners/blog/order-status-page

Seems "GB" in checkout.shipping_address.province_code is the official country code for United Kingdom/Great Britain as shown in the code snippet example on that page.

 

<script>
  {% if checkout.shipping_address.country_code == 'US'  and checkout.shipping_address.province_code == 'NY' %}
  Shopify.Checkout.OrderStatus.addContentBox(
    '<h2>Visit us in-store</h2>',
    '<p>Our store on 5th Avenue is open everyday from 9am to 5pm.</p>'
      )
   {% elsif checkout.shipping_address.country_code == 'GB'  %}
   Shopify.Checkout.OrderStatus.addContentBox(
     '<h2>Visit us in-store</h2>',
     '<p>Check here for our store map</p>'
      )
  {% endif %}
</script>

 

 

 

 

 

0 Likes