Localize your product prices for search engines

Update your theme to make sure that the prices that appear in search engine results match your customers' currencies.

Search engines often return the price of a product in their search results. When you sell in multiple currencies, sometimes the currency in the results doesn't match your customer's local currency.

If your customers are experiencing this type of currency mismatch in their search results, then you need to edit your store's theme so that it includes information about the locales and currencies that you sell in. In most cases, you can do this by adjusting the following settings in your theme:

  • structured data
  • hreflang links
  • canonical URL settings

For example, you sell in Australia and New Zealand. A customer in New Zealand searches for your t-shirt. In their search results, they see the price in Australian dollars ($20 AUD). When this customer clicks on the result, they are directed to the New Zealand version of the t-shirt's product page. On this page, your customer sees the price in New Zealand dollars ($22 NZD). The customer notices the differences in price between the search results and the product page and is confused. This customer delays making a purchase.

Use structured data

You can use in-page markup to structure your data so that it tells search engines about the currencies that you sell in. Structured data is used by search engines to classify the content on your pages. It is also used to enable search result features, such as displaying the price of a product in the results.

For each currency that you support, you need to use the product structured data type and include the priceCurrency property. This property describes the currency (in ISO 4217 format), and it needs to be set to cart.currency.iso_code (not shop.currency).

The Debut theme uses a different format for structured data, making these steps unnecessary. If you use Debut, then you can skip these steps and start at Use hreflang attributes.

Steps:

  1. Search your theme for the priceCurrency property that is nested in an offers itemscope. Usually, priceCurrency is defined in the product-template.liquid in the Sections folder. If you can’t find this property, then add it to Sections/product-template.liquid.
  2. Make sure that priceCurrency is set to cart.currency.iso_code.

For example, your code should look like the following:

<div itemscope itemtype=”http://schema.org/Product . . .
<div itemprop="offers" itemscope itemtype="http://schema.org/Offer">
  <meta
    itemprop="priceCurrency"
    content="{{ cart.currency.iso_code }}"
  />
  . . .
</div>

You can use the Structured Data Testing Tool to test your changes.

Use hreflang attributes

You can use hreflang attributes to tell search engines about the different versions of your product pages. For each currency that you sell in, you need to specify the language (ISO 639-1 format) and region ( ISO 3166-1 Alpha 2 format) that the currency applies to.

Steps:

  1. Open your theme.liquid file. This file should contain <link ... > elements.
  2. For each currency that you sell in, make sure that there is a link rel=alternate element, such as the following element:
<link
  rel="alternate"
  hreflang="LANG-CTRY"
  href="{{ canonical_url}}?currency=XXX"
/>`.

For example, if you sell in USD, GBP, and JPY currencies, then make sure that your theme.liquid contains the following lines:

<head>
  ...
  <link
    rel="alternate"
    hreflang="en-us"
    href="{{ canonical_url }}?currency=USD"
  />
  <link
    rel="alternate"
    hreflang="en-gb"
    href="{{ canonical_url }}?currency=GBP"
  />
  <link
    rel="alternate"
    hreflang="ja-jp"
    href="{{ canonical_url }}?currency=JPY"
  />
  ...
</head>

If you sell in euros (EUR), then you need to specify the locales (language/country) that you support. For each EUR locale that you support, add a <link> element and include an hreflang attribute for that locale.

For example, the following lines tell the search engine that the EUR version of the product page should be shown to French speakers in France, German speakers in Germany, and both English and Dutch speakers in the Netherlands:

...
<link
  rel="alternate"
  hreflang="fr-fr"
  href="{{ canonical_url }}?currency=EUR"
/>
<link
  rel="alternate"
  hreflang="de-de"
  href="{{ canonical_url }}?currency=EUR"
/>
<link
  rel="alternate"
  hreflang="en-nl"
  href="{{ canonical_url }}?currency=EUR"
/>
<link
  rel="alternate"
  hreflang="nl-nl"
  href="{{ canonical_url }}?currency=EUR"
/>
...
  1. Add a link rel=alternate element and set the hreflang to x-default. Search engines use this fallback link when your customer is from a locale that you don’t support:
<link
  rel="alternate"
  hreflang="x-default"
  href="{{ canonical_url }}"
/>

Step 3: Use a canonical URL

You can tell the search engine what URL to use as the canonical URL. This tells a search engine that the country-specific page being referred to is a distinct, stand-alone page, rather than a duplicate of another page. When set, this helps the search engine determine what currency to display. Use <link rel="canonical" href="{{ canonical_url }}"> and include the cart.currency.iso_code.

Steps:

  1. In theme.liquid, search for the canonical link. If you can't find this link, then add one:
<link rel="canonical" href="{{ canonical_url }}>"
  1. Make sure that your canonical URL includes the cart.currency.iso_code:
<link
  rel="canonical"
  href="{{ canonical_url }}?currency={{ cart.currency.iso_code }}"
/>
Ready to start selling with Shopify?Try it free