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:
- Search your theme for the
priceCurrency
property that is nested in anoffers
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. - Make sure that
priceCurrency
is set tocart.currency.iso_code
.
For example, your code should look like the following:
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:
- Open your theme.liquid file. This file should contain
<link ... >
elements. - For each currency that you sell in, make sure that there is a
link rel=alternate
element, such as the following element:
For example, if you sell in USD, GBP, and JPY currencies, then make sure that your theme.liquid contains the following lines:
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:
- Add a
link rel=alternate
element and set thehreflang
tox-default
. Search engines use this fallback link when your customer is from a locale that you don’t support:
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:
- In theme.liquid, search for the canonical link. If you can't find this link, then add one:
- Make sure that your canonical URL includes the
cart.currency.iso_code
: