VTEX Developer Portal

Indicating alternate versions of localized pages in cross border stores

Indicating alternate versions of localized pages in cross border stores

If you have different versions of a landing page for each region your store is present, we recommend that you save them as alternate versions.

This way, search engines will be aware of the different versions of your page and able to provide the right content to the right audience.

Notice that this is especially useful for improving your store's SEO.

Keep in mind that when indicating alternate versions of a page, you must do it in pairs. For example, if you point the USA version of a page to a Brazilian variant, then the Brazilian page must point to the USA version as well.

By doing that, search engines are capable of understanding the relationship between those two pages, avoiding issues such as indicating the incorrect title for a given page or wrong indexing.

Frame 15Frame 15

Hence, be aware that you'll need to perform the following step by step for each localized version of your landing page.

It's important for search engines that each version of a page indicates itself as well as the other localized versions as alternates. However, you don't need to worry about self-referencing since we already do that for you.

Step by step

  1. Install the [email protected] app using your terminal.
  2. In your browser, access your account's admin and go to the GraphQL IDE section.
  3. From the GraphQL IDE dropdown list, choose the vtex.rewriter app.
  4. Run the following query to get the internal data related to the specified page path.
{
  internal {
    get(path: "/{URL}") {
      from
      declarer
      type
      id
      binding
    }
  }
}

Remember to replace the values between the curly brackets according to your scenario.

  1. Save the returned data.
  2. Erase the previous query and fill in the main text box with the following mutation command.
mutation saveInternal($args: InternalInput!) {
  internal {
    save(route: $args) {
      id
    }
  }
}
  1. Click on Query Variables at the bottom of the page and, according to the following example and the following explanations, fill in the Query Variables section.
{
    "args": {
        "from": "/US/about-us",
        "declarer": "[email protected]",
        "type": "userRoute",
        "id": "[email protected]:store.custom::us-about-us",
        "binding": "748aafcf-3572-456d-5dec-6ddb3f26e43f",
        "alternates": [
            {
                "binding": "7cf37a3b-efc0-4e47-8201-d8b58kd4d3fd",
                "path": "/BR/sobre-nos"
            },
            {
                "binding": "8cf37a3b-edc0-4a47-8241-d8b58kfsd3fd",
                "path": "/UK/about-us"
            }
        ]
    }
}
  • Replace the from, declarer, type, id, and binding values with the information obtained in step 4.
  • Regarding the alternates field, fill in the binding and path values according to the alternate landing page's data.

If you don't know the binding values of your stores, follow this step by step on checking your account's binding ids.

Once you perform these changes, remember to repeat the process from step 4 as many times as the number of existing versions of that landing page, using each alternate page as the path.

Updated about 17 hours ago


Indicating alternate versions of localized pages in cross border stores


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.