FAQ: How to check which Trade Policy is being rendered on my store's front-end?

This topic aims to provide a simple tutorial on how to identify which Trade Policy is being rendered on the front-end of our stores, which can help analyze various scenarios, especially for our customers who have a multi-store architecture.

There are several ways to check which Trade Policy is being reflected on the front-end of your store. In this tutorial, we’ll explain how to do this using the vtex_segment cookie. To check the trade policy being rendered directly in your store, you’ll need to use an extension — for Google Chrome, we typically use the Edit This Cookie extension. However, it’s worth noting that this extension was not created or is managed by VTEX — it’s simply an external tool we use to perform front-end analysis on stores running our platform in a straightforward way.

After installing this extension, you’ll be able to see a cookie icon “:cookie:” in the upper right corner of your browser, next to the page address you’re currently on:

This cookie is base64-encoded, so to decode it you’ll need to copy the value from that field and then decode its contents using an external tool, such as the ones listed below:

After copying the value from this cookie and decoding it in an external tool, you should get something in the following format:

{"campaigns":null,"channel":"1","priceTables":null,"regionId":null,"utm_campaign":null,
"utm_source":null,"utmi_campaign":null,"currencyCode":"BRL","currencySymbol":"R$",
"countryCode":"BRA","cultureInfo":"pt-BR","admin_cultureInfo":"pt-BR","channelPrivacy":"public"}

Looking at the information contained in this cookie, we can see that one of the fields is "channel":"1", which represents the Trade Policy currently being rendered on the front-end of your store!

If you have any further questions on the topic, feel free to ask here or open a new topic referencing this one! :smile:

Como o vtex_segment define a Política Comercial (salesChannel)?

Olá, @KarinaMota

Gostaria de entender melhor qual é a regra/mecanismo que o vtex_segment utiliza para selecionar e fixar a Política Comercial (channel).

Estou enfrentando um problema ao trocar a regionalização na loja: mesmo enviando o PATCH de atualização da Session (com o regionId e o salesChannel corretos), o cookie vtex_segment continua mantendo a política "1".

Alguém sabe o que pode estar sobrescrevendo ou impedindo a atualização do channel no segment?