# Collecting feedback for one codebase with two brands

> Give each brand its own product when the brands have different customers, domains or reporting needs. Use a brand key in metadata only when the same customers use one product and you only want to slice the data. Set the key and accent color per build so each brand's widget reports to the right place.

Source: https://escutaproduto.com/resources/one-codebase-two-brands
Last updated: 2026-10-11

## Does a shared codebase decide how to set up feedback?

No. The codebase is an implementation detail that your customers never see. What decides the setup is who the customers are, which domain they visit, and who reads the reports. Two brands can share most of their code and still need separate feedback streams, or they can share a product and still need a brand label. Start from the audience, then pick the tool setup.

## When should each brand get its own product?

Create a separate product in Escuta Produto for each brand when any of these is true:

- The brands have different customers, even if the software is the same.
- Each brand runs on its own domain, and you want each domain's form and origins to stay separate.
- A different person or team reads each brand's feedback.
- You report to different stakeholders, or you need a clean export for each brand.

A separate product gets its own key, hosted page, allowed origins, notification webhook, accent color and CSV export. Nothing from one brand appears in the other brand's inbox, and the statuses and counts are kept apart from the start.

## When is a metadata field enough?

A metadata field works when the same customers use one product that appears under two brand names, and you mainly want to ask "which brand did this come from?" Attach the brand to each person with identify, or to the feedback with setMetadata:

```js
EscutaProduto.identify({
  email: user.email,
  name: user.name,
  userId: user.id,
  brand: "acme-notes",
});
```

Metadata is stored with each item and kept as JSON text. The inbox does not filter by metadata, and the text search covers only the name, email and message fields. To see one brand's items, you export the CSV and filter the metadata column in a spreadsheet. For example, if you see 12 items from one brand and 5 from the other in a week, that is a useful split. If you need to triage one brand every day, that is a sign it deserves its own product.

## How do you give each brand its own look?

The widget accepts a data-color attribute, so each build can match its brand. The hosted feedback page uses the accent color you set on the product, so set that per product as well. Keep both values in one place in your build config, so a color change never happens in one channel and not the other.

Because the codebase is the same, choose the brand at build time. Read a single environment variable and look up the key and color from a small table:

```js
const brands = {
  acme: { key: "pk_acme_key", color: "#0f766e" },
  beta: { key: "pk_beta_key", color: "#7c3aed" },
};

const brand = brands[process.env.BRAND];
```

The public key is not a password, and the value you paste into the snippet is the one the widget reads. The point of the table is that each build sends feedback to exactly one product, and a missing brand fails loudly instead of sending to the wrong inbox.

## What goes wrong when both brands share one product?

Several things, and most of them show up only after a few weeks:

1. The rating average blends two audiences, so a drop for one brand hides behind a rise for the other.
2. Alerts arrive in one channel. Unless the message names the brand, people guess from the page URL.
3. The status queue mixes both brands, so a planned feature for one brand looks like a promise to the other.
4. Allowed origins must list both domains, which means a single key accepts submissions from both sites.

The page URL saved on each item shows which domain it came from, which helps when you read one item. It does not group the inbox by domain, so the filter still shows everything together.

A useful test is to ask whether a stranger reading one alert could tell which brand sent it. If the alert names the product and the page URL is visible, the answer is yes. If the alert gives them nothing but a message, the two brands are already mixed up in your team's head, even if the data is technically separate.

## How do you keep the two reports apart?

Pick one of two approaches and stick to it. The first is a separate product per brand, with a CSV export per product and no mixing. The second is one product with a brand key in metadata, and a weekly spreadsheet step that filters on that key. The second is cheaper to set up but slower to read, and it puts the burden on whoever builds the spreadsheet.

If you choose the second approach, add the brand key to every submission from the start. Old items without the key cannot be sorted later, so backfilling is harder than starting clean.

## Wiring two brands into Escuta Produto

Create two products with names that are easy to tell apart. The [naming guide](/resources/naming-products-and-slugs) explains why the name is set once and what happens when two names collide. Give each product its accent color, its allowed origins for that brand's domains, and its own notification webhook so each brand's alerts land in the channel its owner reads.

Then set the data-key and data-color in each build as shown above. The [widget guide](/docs/widget) lists every option, including data-locale for the language of the form. Once both products are live, check one item from each brand in its own inbox and confirm the page URL matches the right domain.

If the two brands should still feel like one family to customers, read [keeping the feedback experience consistent across apps](/resources/consistent-feedback-experience). It covers what should match across products and what should differ.

## Frequently asked questions

### Should two brands from one codebase share a feedback product?

Usually not. Give each brand its own product when the customers, domains or reporting differ. Share one product only when the same customers use it and you just need to label which brand a message came from.

### Can I filter one brand's feedback in the inbox?

The inbox filters by status, type and text search, and the search covers the name, email and message fields. It does not filter by metadata. To see one brand inside a shared product, export the CSV and filter the metadata column in a spreadsheet.

### How do I set a different widget color for each brand?

Set the data-color attribute in each build, choosing the value from a lookup table keyed by brand. Also set the accent color on each product so the hosted feedback page matches the brand.
